Send mon alerts to twitter

Just a quick proof of concept hack..

I modified twitter-cmdline script to fit mon‘s alert specs..

Download twitter-cmdline-1.03 and place it in /usr/lib/mon/alert.d (or appropriate path of your mon installation).

Then grab twitter.alert and put it there too.

Run twitter.pl and give your twitter credentials (stored in ~/.twitterrc the first time it runs). It’s probably a good idea to create an extra twitter account for this.

Now use twitter.alert in your mon config to send alerts in twitter, where people can follow them!

watch system01
    service disk_root
        interval 5m
        monitor munin.monitor -M df -F _dev_cciss_c0d0p1 -w 90 -c 95 -H
        depend SELF:ping
        period _ANYTIME_
            alertevery 15m summary
            comp_alerts
            alertafter 3
            alert twitter.alert
            upalert twitter.alert

Integrating Munin with Mon

Munin already integrates with Nagios .. But I didn’t find anything for mon ..

So I hacked check_munin.pl from Nagios Exchange to work with mon ..

Download munin.monitor and place it in mon.d/ of your mon installation.

Now you can monitor ANY munin value using mon.

Use something like the following in your systems_monitor.m4

watch system01
    service disk_root
        interval 5m
        monitor munin.monitor -M df -F _dev_cciss_c0d0p1 -w 90 -c 95 -H
        depend SELF:ping
        period _ANYTIME_
            alertevery 15m summary
            comp_alerts
            alertafter 3
            alert mail.alert _MY_EMAIL_
            upalert mail.alert _MY_EMAIL_
    service toomanyqueuedmails
        interval 5m
        monitor munin.monitor -M sendmail_mailqueue -F mails -w 50 -c 100 -H
        depend SELF:ping
        period _ANYTIME_
            alertevery 15m summary
            comp_alerts
            alertafter 3
            alert mail.alert _MY_EMAIL_
            upalert mail.alert _MY_EMAIL_
    service dnsresponse
        interval 5m
        monitor munin.monitor -M dnsresponse_193.92.110.1 -F avg -w 20 -c 50 -H
        depend SELF:ping
        period _ANYTIME_
            alertevery 15m summary
            comp_alerts
            alertafter 3
            alert mail.alert _MY_EMAIL_
            upalert mail.alert _MY_EMAIL_

Make sure that your MON server’s IP is allowed in munin-node.conf of your munin client.