Net::NSCA::Client::Connection - Represents a connection between the client and the server.
This documentation refers to version 0.009
use Net::NSCA::Client::Connection; # Create a new connection my $connection = Net::NSCA::Client::Connection->new( remote_host => 'nagios.example.net', remote_port => $nsca_port, ); # Send a packet $connection->send_data_packet($data_packet);
Represents a connection between the NSCA client and server.
This 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.
This will construct a new object.
%attributes is a HASH where the keys are attributes (specified in the "ATTRIBUTES" section).
%attributes
$attributes is a HASHREF where the keys are attributes (specified in the "ATTRIBUTES" section).
$attributes
# Set an attribute $object->attribute_name($new_value); # Get an attribute my $value = $object->attribute_name;
This is a Net::NSCA::Client::InitialPacket object which represents the initial packet received when the connection to the NSCA server was established.
Required
This is the host name or IP address of the remote NSCA server.
This is the port number of the remote NSCA server.
This specifies the configuration of the remote NSCA server. See Net::NSCA::Client::ServerConfig for details about using this. Typically this does not need to be specified unless the NSCA server was compiled with customizations.
This is the timeout for reading from the socket. The default is set to "$DEFAULT_TIMEOUT".
This is a Net::NSCA::Client::Connection::TLS object that specifies the transport layer security that will be used when sending the data packet.
This is the socket object (IO::Socket::INET) that represents the TCP connection to the NSCA server.
This will restart the connection.
This will clear the "transport_layer_security" attribute removing any transport layer security.
This will return a Boolean of if the connection is protected by transport layer security.
This will send a data packet to the remote NSCA server. The method takes one argument which is the Net::NSCA::Client::DataPacket object. If the UNIX timestamp of the data packet is not set to the correct timestamp the server is expecting, then the data packet is cloned and the correct timestamp is set before sending the packet.
Constants provided by this library are protected by the Const::Fast module.
$DEFAULT_TIMEOUT
This is the default timeout that will be used if no timeout value is specified.
$SOCKET_READ_SIZE
This is the number of bytes that will be read from the socket at a time.
Const::Fast
English
IO::Socket::INET
Net::NSCA::Client::InitialPacket
Net::NSCA::Client::ServerConfig
Moose 0.89
MooseX::StrictConstructor 0.08
namespace::clean 0.04
Douglas Christopher Wilson, <doug at somethingdoug.com>
<doug at somethingdoug.com>
Please 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.
bug-net-nsca-client at rt.cpan.org
I highly encourage the submission of bugs and enhancements to my modules.
Copyright 2009 Douglas Christopher Wilson.
This program is free software; you can redistribute it and/or modify it under the terms of either:
the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or
the Artistic License version 2.0.
To install Net::NSCA::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::NSCA::Client
CPAN shell
perl -MCPAN -e shell install Net::NSCA::Client
For more information on module installation, please visit the detailed CPAN module installation guide.