![]() |
![]()
| ![]() |
![]()
NAMENet::NSCA::Client::ServerConfig - Specify configuration data for the remote NSCA server VERSIONThis documentation refers to version 0.009002 SYNOPSISuse Net::NSCA::Client::ServerConfig; # Specify the non-default server configuration my $config = Net::NSCA::Client::ServerConfig->new( max_hostname_length => 100, max_description_length => 128, max_pluginoutput_length => 3072, # 3 KiB! ); # Create a new connection with the configuration my $connection = Net::NSCA::Client::Connection->new( remote_host => 'nagios.example.net', server_config => $config, ); # Create a new client with the configuration my $nsca = Net::NSCA::Client->new( remote_host => 'nagios.example.net', server_config => $config, ); # Data packets will adhere to the server configuration $nsca->send_report( hostname => 'web1.example.net', service => 'MYSQL', message => $plugin_output, status => $Net::NSCA::Client::STATUS_OK, ); DESCRIPTIONWhen NSCA is compiled, there are constants that define the size of the packets that will be generated and accepted. If NSCA was compiled with custom values for these constants, then this module will allow the client to generate corresponding packets. CONSTRUCTORThis is fully object-oriented, and as such before any method can be used, the constructor needs to be called to create an object to work with. newThis will construct a new object.
ATTRIBUTES# Get an attribute my $value = $object->attribute_name; initialization_vector_lengthThis specifies the byte length of the initialization vector in the initial packet as specified in the "TRANSMITTED_IV_SIZE" constant in common.h. max_description_lengthThis specifies the maximum description length in bytes as specified in the "MAX_DESCRIPTION_LENGTH" constant in common.h. max_hostname_lengthThis specifies the maximum host name length in bytes as specified in the "MAX_HOSTNAME_LENGTH" constant in common.h. max_service_message_lengthThis specifies the maximum service message (plugin output) length in bytes as specified in the "MAX_PLUGINOUTPUT_LENGTH" constant in common.h. METHODSis_compatible_withThis takes another Net::NSCA::Client::ServerConfig instance and returns a Boolean specifying if the two server configurations are compatible with each other. This method is also accessible through an overloaded "==" and "!=". pack_data_packetThis takes a HASHREF that specify the members of the C structure and the values to pack in each member. This will return a string that is the raw packed byte data. pack_initial_packetThis takes a HASHREF that specify the members of the C structure and the values to pack in each member. This will return a string that is the raw packed byte data. repack_data_packetThis takes the raw packet as the first argument and a HASHREF (as specified in "pack_data_packet") as the second argument. The first argument (the raw packet) may be a scalar reference and the packet will be modified in place. The new raw packet or the same scalar reference will be returned, based on if the first argument was a scalar reference or not. # Repack by copying packet around my $no_crc32 = $packer->repack_data_packet($raw_packet, {crc32_value => 0}); # Repack in place $packer->repack_data_packet(\$raw_packet, {crc32_value => 0}); repack_initial_packetThis takes the raw packet as the first argument and a HASHREF (as specified in "pack_initial_packet") as the second argument. The first argument (the raw packet) may be a scalar reference and the packet will be modified in place. The new raw packet or the same scalar reference will be returned, based on if the first argument was a scalar reference or not. See "repack_data_packet" for usage examples. unpack_data_packetThis takes the raw packet and returns a HASHREF of the C structure names and values. The raw packet may be given as a string or as a scalar reference. unpack_initial_packetThis takes the raw packet and returns a HASHREF of the C structure names and values. The raw packet may be given as a string or as a scalar reference. DEPENDENCIES
AUTHORDouglas Christopher Wilson, "<doug at somethingdoug.com>" BUGS AND LIMITATIONSPlease report any bugs or feature requests to "bug-net-nsca-client at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-NSCA-Client>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. I highly encourage the submission of bugs and enhancements to my modules. LICENSE AND COPYRIGHTCopyright 2009 Douglas Christopher Wilson. This program is free software; you can redistribute it and/or modify it under the terms of either:
|