Loading...
середа, 21 серпня 2013 р.

Adding RSS feed to Nagios

Nagios is a very handy monitoring system just out the box. But, as for me, e-mail notifications (alerts) is not enough for convenient monitoring. Actually, there are lots of manuals describing how to add SMS alerts (or even voice calls) to Nagios, but not so much information about sending alerts to RSS feed.
I have tried some RSS Nagios plug-ins for this purpose. I think, the Blosxom4Nagios plug-in is the best one.
Actually, this plug-in consists of Nagios plug-in itself (gathering data) and microblog engine called Blosxom, used for visualization of alerts. RSS feed is produced by  Blosxom.
 Installing Blosxom4Nagios is quite simple procedure.
First of all, you should download archive and unzip it to some folder. By default, all blosxom stuff should be placed in the following folder: /var/log/nagios/blosxom
Next, you should install following CPAN modules for perl (and perl itself, of course, if it had not been installed before):
- Filter::Simple
- Logger::Syslog

Just type sudo cpan in terminal, following prompt will appear
cpan> 
type: install  - Filter::Simple and press 'Enter' ;
type: install  - Logger::Syslog and press 'Enter' .
Do this as nagios user
Now you should cd to the  /var/log/nagios/blosxom  folder and type bin/setup command.
After that you could edit files blosxom.conf, atomfeed, rss20 in the config/ folder or use default ones

Uncomment lines in the blosxom4nagios.conf file to use CGI or VirtualHost (I used cgi):
AddHandler cgi-script .cgi
Alias /nagios/blosxom/themes /var/log/nagios/blosxom/themes
Alias /nagios/blosxom/images /var/log/nagios/blosxom/images
Alias /nagios/blosxom /var/log/nagios/blosxom/cgi
<Directory /var/log/nagios/blosxom/cgi>
Options +Indexes
DirectoryIndex blosxom.cgi
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/nagios/blosxom
RewriteRule ^(.*)$ /nagios/blosxom/blosxom.cgi/$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/blosxom
RewriteRule ^(.*)$ /blosxom/blosxom.cgi/$1 [L,QSA]
<FilesMatch "\.cgi$">
Options +ExecCGI
</FilesMatch>
</Directory>
<Location /nagios/blosxom>
SetEnv BLOSXOM_CONFIG_DIR /var/log/nagios/blosxom/config
</Location>

Run following as root:
# cd /etc/httpd/conf.d
# ln -s /var/log/nagios/blosxom/config/blosxom4nagios.conf
# service httpd restart
# chgrp apache /var/log/nagios/blosxom/state
# chmod g+ws /var/log/nagios/blosxom/state

Include following line to nagios.cfg:
cfg_file=/var/log/nagios/blosxom/config/commands_blosxom.cfg
and add new notifications to users/usergroups:
'host-notify-via-blosxom'
'notify-via-blosxom'

Restart nagios. Blosxom should be available by following URL: http://your-nagios-server/nagios/blosxom



0 коментарі:

 
TOP