资源说明:Parser of nagios's mails, notifier and dzen2 status daemon
== DESCRIPTION: This bunch of scripts are for analizing emails from Nagios. While letters comes, the scripts will store events in spool directory and notify you using popup messages and statusbar. == SCRIPTS: * parser.pl: Is for reading and parsing emails from Nagios. Call it from procmail or similar and it will save new event in the spool directory, then notify your using notify.pl script. * notify.pl: Shows red/green/yellow popup when new event come. Is called by parser.pl. * daemon.pl: Scans spool and shows current events using permanent dzen2 statusbar or just write it to run/status file. * get_status.pl Just scans spool directory and returns formated status if there are events and empty string otherwise == REQUIRMENTS: * perl and nonstandart perl modules: * GetOpt::Long * Linux::Inotify2 * Config::Auto * dzen2 == INSTALL: === Base installation: 1. Copy this tree to .dzen2/nagios. If you decide to use another dir, than do not forget to pass --base param to every script. 2. Copy config.example to config. Edit it if you want. You can check is all setted up correctly by running: cat test/h-down.msg | ./parser.pl and after a while cat test/h-up.msg | ./parser.pl You should see red and green popups and in directory spool a file should be created and removed. === Integrate it with your mail reader: Ex. for procmail: :0: * ^From:.nagios@example.com { # Firstly copy to .Nagios/ maildir (or mailbox) :0 c $MAILDIR/.Nagios/ # Then pipe to script: :0 | $HOME/.dzen2/nagios/parse.pl } === Integrate it with dzen2: There is three ways to do this: I. daemon.pl with standalone dzen2 statusbar (if you haven't your own dzen2 statusbar) Edit section [daemon] in config and run daemon.pl at session startup II. daemon.pl without own statusbar. Run daemon.pl --dump at session startup, then read ~/.dzen2/nagios/run/status in your statusbar script. III. run get_status.pl in your statusbar script. It's simple but more expensive way, because it does not use inotify and polls spool dir every time.
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。