Mojo-Zabbix-APP The application of Mojo-Zabbix moduleгЂ‚ Get data from zabbix data include hostпјЊitems, Triggers and warns and so on. Mojo::Zabix:APP - жЇMojo::ZabixжЁЎеќ—зљ„еє”з”ЁжЁЎеќ—пјЊеЇ№zabbix api常见模块进行打包 可以方便的获取zabbix信息,目前包括zabbix版本,主机列表,监控列表,触发器,и¦е‘Љ з‰пјЊеЏЇд»Ґж №жЌ®йњЂж±‚提供更多的操作。 ### Example use Mojo::Zabbix::APP; my @myzinfo = <DATA>; ##(get zabbix info from __DATA__ ) # Define for debug and traceing processe infomaition。(打开调试和跟踪) my $DEBUG=0; my $TRACE=0; #my @myzinfo = ('test1 http://test1/zabbix testuser pass'); # @еЏЇд»Ґе®љд№‰дёєе¤љиЎЊж•°жЌ®пјЊж јејЏжЊ‰з…§иї™з§ЌпјЊдёЂдёЄzabbix жњЌеЉЎењ°еќЂдёЂдёЄ for (@myzinfo) { next if /^#/; next if /^\s*$/; my ( $name, $url,$user, $pass ) = split; print "\n$name\n"; my $z; eval { $z = initZ( $url,$user,$pss ); }; if ($@) { print "Error $@!\n"; } else { ## Print the version of zabbix api. 打印zabbix 版本 pVersion($z); ## Print all host listsгЂ‚ иЋ·еЏ–ж‰Ђжњ‰зљ„дё»жњєе€—иЎЁ print getAllhost($z); ## Print warning info of Triggers。打印取得的所有触发器告и¦дїЎжЃЇ pTriggers($z); ## Print the history data of given items, default for past 24 hours. ## 打印给定时间段的item历史数据,如果й»и®¤дёЌз»™ж—¶й—ґй»и®¤дёєиї‡еЋ»24е°Џж—¶е†…зљ„ pHitems($z); } } =cut =========结果展示 name Warning info of Triggers 2016-10-19 23:29:57 : 192.168.1.* : {HOST.NAME}дёЉзљ„80з«ЇеЏЈе…ій— 2016-10-19 22:58:28 : 192.168.2.* : зі»з»џз›®еЅ•/etc/sysconfig/еЏ‘з”џеЏеЊ– 2016-10-19 22:24:32 : 192.168.3.* : зі»з»џз›®еЅ•/etc/init.d/еЏ‘з”џеЏеЊ– 2016-10-19 19:12:53 : 192.168.3.* : зЈЃз›sda IO利用率超过95% 2016-10-19 18:03:03 : 192.168.4.* : Too many processes on {HOST.NAME} more example/example.pl INSTALLATION You can easyly install this modue use perl packages like cpanm cpanm Mojo::Mojo::APP To install this module, run the following commands: perl Makefile.PL make make test make install SUPPORT AND DOCUMENTATION After installing, you can find documentation for this module with the perldoc command. perldoc Mojo::Zabbix::APP You can also look for information at: RT, CPAN's request tracker (report bugs here) http://rt.cpan.org/NoAuth/Bugs.html?Dist=Mojo-Zabbix-APP AnnoCPAN, Annotated CPAN documentation http://annocpan.org/dist/Mojo-Zabbix-APP CPAN Ratings http://cpanratings.perl.org/d/Mojo-Zabbix-APP Search CPAN http://search.cpan.org/dist/Mojo-Zabbix-APP/ GitHub https://github.com/bollwarm/Mojo-Zabbix-APP Oschina https://git.oschina.net/ijz/Mojo-Zabbix-APP ### License This software is copyright (c) 2016 by oragnge. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself