Zabbix::Sender - A pure-perl implementation of zabbix-sender.
version 0.03
This code snippet shows how to send the value "OK" for the item "my.zabbix.item" to the zabbix server/proxy at "my.zabbix.server.example" on port "10055".
use Zabbix::Sender; my $Sender = Zabbix::Sender->new({ 'server' => 'my.zabbix.server.example', 'port' => 10055, }); $Sender->send('my.zabbix.item','OK');
Zabbix 1.8 uses a JSON encoded payload after a custom Zabbix header. So this initializes the JSON object.
The hostname of the sending instance may be given in the constructor.
If not it is detected here.
ZABBIX 1.8 TEMPLATE
a4 - ZBXD b - 0x01 c4 - Length of Request in Bytes (64-bit integer), aligned left, padded with 0x00 c4 - dito a* - JSON encoded request
This may be changed to a HashRef if future version of zabbix change the header template.
This method encodes the item and value as a json string and creates the required header acording to the template defined above.
This method tries to decode the answer received from the server.
Send the given item with the given value to the server.
Takes two arguments: item and value. Both should be scalars.
Disconnects any open sockets on destruction.
"Dominik Schulz", <"lkml at ds.gauner.org">
<"lkml at ds.gauner.org">
Please report any bugs or feature requests to bug-zabbix-sender at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Zabbix-Sender. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-zabbix-sender at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Zabbix::Sender
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Zabbix-Sender
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Zabbix-Sender
CPAN Ratings
http://cpanratings.perl.org/d/Zabbix-Sender
Search CPAN
http://search.cpan.org/dist/Zabbix-Sender/
This code is based on the documentation and sample code found at:
Copyright 2011 Dominik Schulz.
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; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
Dominik Schulz <dominik.schulz@gauner.org>
This software is copyright (c) 2012 by Dominik Schulz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Zabbix::Sender, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Zabbix::Sender
CPAN shell
perl -MCPAN -e shell install Zabbix::Sender
For more information on module installation, please visit the detailed CPAN module installation guide.