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} INSTALLATION 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