0 subscribers Search:
last edited 6 years ago by Will

10.6. Using Jabber with Mon and Nagios

This section provides some tips on how Jabber can be used with system-monitoring tools, such as Mon and Nagios. Jabber alerting is a useful feature for these tools because email alerts do not provide instant notification. Jabber provides a free instant notification anywhere the user is logged into Jabber. This is especially valuable for open source developers who, most likely, are not going to pay for a pager to receive server alerts.

This guide is intended to demonstrate how Jabber can be used with these monitoring tools. See the respective Mon and Nagios sites for instructions on how to use these applications.

10.6.1. Using Jabber with Mon

Mon is a basic service monitoring tool. On startup, Mon reads a configuration file and then performs tests as scheduled in the configuration file. Mon tests consist (primarily) of Perl scripts located in /etc/mon/mon.d. If a test fails, Mon calls the alert as specified in the configuration file. Mon alerts are Perl scripts located in /etc/mon/alert.d. As of this writing, the Mon distribution comes with neither a Jabberd monitor nor a Jabber alerter; however, the Jabberdoc tools folder contains scripts for both these tasks.

The jabber_alert.pl script was originally written as an alerter for Mon. To use it with mon, simply copy it to the /etc/mon/alert.d directory, and chmod it so that it can be run. You may wish to rename it jabber.alert to maintain consistency with the other types of alerts.

Once jabber.alert is in your alert.d directory, you can use it to send Mon alerts. For example, this sample section of a mon.cf script would jab user1@somedomain.org if the web server for www.somedomain.com failed:

      hostgroup webservers www.somedomain.com

      watch webservers      
          service HTTP_Server_Check
              interval 1m
              monitor http.monitor -p 80 -t 30 
              period wd {Mon-Sun} hr {0am-24pm}
                  alert jabber.alert -e user1@somedomain.org -n user2@somedomain.org -w mypassword

The tools folder also contains jabber.monitor, which is a script for monitoring Jabber servers. To use this monitor, copy it to the /etc/mon/mon.d directory and chmod it so that it can be run. Its use is similar to that of other Mon monitors. This section of a mon.cf script would test the jabber.somedomain.com server every minute:

      hostgroup jabberservers jabber.somedomain.com    

      watch jabberservers       
          service Jabberd_Server_Check
              interval 1m
              monitor jabber.monitor -p 5222
              period wd {Mon-Sun} hr {0am-24pm}
                  alert jabber.alert -e user@somedomain.org -n user2.somedomain.org -w mypassword

Of course, if you are monitoring a Jabber server, you want neither the Jabber alert sender nor recipient to be using the server being monitored. If you use the same Jabber server for monitoring and alerting, you would receive no alert messages if the server failed. You would want to choose a reliable Jabber server for sending and receiving alerts, and you may wish to peruse the Jabber Monitor Service, which provides graphical uptime statistics for public Jabber servers.

Mon installation and configuration is beyond the scope of this guide; however, I have included a mon.cf.sample configuration file in the tools folder. Note that this configuration relies on the alert and monitor scripts above in addition to a modified dns.monitor script. The modified dns.monitor script allows for testing of Jabber DNS SRV records.

A.10.6.2. Using Jabber with Nagios

Nagios offers many more features than Mon, including a web interface that is capable of providing graphical network maps showing problem areas. I am not yet familiar with Nagios; however, there is a Jabber alert script available for it.

View as PDF

Back

Up

Comments about this Document


full simple minimal   UserOptions ChangeLog   loginhelp
subject:
This is not a forum for resolving Jabberd 2 issues. Post Jabberd 2 specific questions to either the jadmin or jabberd mailing lists.
 

© 2003 Will Kamishlian and Robert Norris

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/1.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Powered by Zope Valid HTML 4.01! Valid CSS! Creative Commons License