Howto setup Instant messenger (IM) notifications in nagios

Recently i undertook a project to setup Instant Messenger alerts from nagios .

Nagios is highly configurable.Once we understand the elegant nature in which nagios works and get configured ,extending nagios to send IM alerts is quite childs play .Thanks to many user contributed scripts that allow you to connectto many Instant Messaging Gateways. I used a modified version of

http://nagios.sourceforge.net/download/contrib/notifications/notify_via_jabber

contributed by David Cox to the Nagios Community . For the need of a XMPP server , i installed my own private OpenFire ( http://www.igniterealtime.org/projects/openfire/index.jsp ) server . You may also try to setup accounts in public XMPP servers like http://jabber.org for this purpose. Basically the perl script connects to the jabber server you specified in the script and sends out the notification to you

Here is the configuration :

1. You have to define a command that can be used to acomplish something when there is a host/service related event. For the first timers if you are recieving email notifications from nagios;you can check your commands.cfg file to see something like notify-host-by-email command defenition!

similarly for IM alerts we define a command

==========
# This command is used to notify recipients of service problems:
# 'notify-by-jabber' command definition
define command{
command_name notify-by-jabber
command_line /usr/local/nagios/libexec/notify_via_jabber.pl $CONTACTADDRESS1$ "$HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$\r\nAdditional Info: $SERVICEOUTPUT$"
}
# This command is used to notify recipients of host problems:
# 'host-notify-by-jabber' command definition
define command{
command_name host-notify-by-jabber
command_line /usr/local/nagios/libexec/notify_via_jabber.pl $CONTACTADDRESS1$ "$NOTIFICATIONTYPE$: $HOSTNAME$ is $HOSTSTATE$\n$HOSTOUTPUT$"
}

=====================

As you can see we have called a command_line program => /usr/local/nagios/libexec/notify_via_jabber.pl

which is our perl script

Please download the following perl script from http://gnusys.net instead of the sourceforge one ;as i got it working only after having a small change in the perl script

==========

wget http://gnusys.net/downloads/notify_via_jabber.pl

==========

Find the following lines in the script and change it accordingly

==============


use constant SERVER => 'gnusys.net';
use constant PORT => 5222;
use constant USER => 'notify@gnusys.net';
use constant PASSWORD => 'd3fault';

===============

What more……….?

You need to use the notification commands somewhere.

==========================


define contact{
contact_name anoop
use generic-contact
alias Anoop
email no-email@gnusys.net
address1 no-im@gnusys.net
host_notification_commands notify-host-by-email,host-notify-by-jabber
service_notification_commands notify-by-jabber
host_notification_period 24x7
service_notification_period 24x7
service_notification_options c,r
}

===============================

Now if you are logged into no-im@gnusys.net ; you should start receiving alerts from notify@gnusys.net

If you need help setting this up contact anoop[at]gnusys.net

Source : http://gnusys.net/kb/index.php/2008/09/howto-setup-instant-messenger-im-notifications-in-nagios/

BSNL launches 3G in Kerala

Kannur/Kozhikode: Bharat Sanchar Nigam Limited launched its 3G network service in Kerala today. In the first phase, the service is available in Kozhikode and Kannur. BSNL plan to cover 21 cities in Kerala by the end of this month.

3G allows simultaneous use of speech and advanced data services with unprecedented quality in voice call as well as a wide range of compelling data services. 3G will be available within a limit of 30 km from the city and is available on the move. The data transfer speed is 10 times better than the current system. As of now Only BSNL & MTNL are providing 3G services in India.

Source : http://keralaitnews.com/index.php?option=com_content&view=article&id=712:bsnl-launches-3g-in-kerala&catid=1115:other-cities&Itemid=524

Seven golden sysadmin rules

1. Document everything you do ; You or someone else would come accross the same issue sometime else and from my long experiance; if you dont document you probably would have to start over again!

2. Face the issue from the head and tackle it from the tail! . The best sysadmin practice would be to tackle every issue by studying the issue from its outputs and visual errors and tackling the issue by checking the logs and the internals

3.Do not delete anything as far as possible.These days disks comes very cheap.But data recovery is a costly affair

4.Keep your Os as clean as possible.A clean and tidy place is a lott better to work and troubleshoot

5. Love and respect your operating system and i am sure it will respect you back.Remember the dialog by Nicolas Cage in “Gone in 60 seconds” > Baby if you take care of me…I will take care of you.That should be your relationship with your OS

6. Drop your ego’s. Share with others.Take others advise.Give others credits for their work

7.Feel proud of what you do .Enjoy what you do .You know after all we make the INTERNET work!

Source : http://gnusys.net/kb/index.php/2008/05/seven-golden-sysadmin-rules/