Difference between revisions of "How to Set Up NAL (Nagios Alarm Handler) to monitor an EPICS network"
Line 10: | Line 10: | ||
root>'' yum -y install nagios'' | root>'' yum -y install nagios'' | ||
With that I've installed nagios.i386 0:2.9-1.fc7 version; this is the last stable version (the 3.0 is under development). | With that I've installed nagios.i386 0:2.9-1.fc7 version; this is the last | ||
stable version (the 3.0 is under development). | |||
Optional, but recomended if you have enough disk space: install more Nagios plugins and addons. | Optional, but recomended if you have enough disk space: install more Nagios plugins and addons. | ||
Line 91: | Line 92: | ||
root> ''nagios -v /etc/nagios/nagios.cfg | root> ''nagios -v /etc/nagios/nagios.cfg | ||
'' | '' | ||
The above command would show you for any erroneous lines frin Nagios config file. | The above command would show you for any erroneous lines frin Nagios config file. | ||
Line 101: | Line 103: | ||
Check the paths into the file : /etc/httpd/conf.d/nagios.conf | Check the paths into the file : /etc/httpd/conf.d/nagios.conf | ||
Make a file named .htaccess into /usr/lib/nagios/cgi-bin/ and /usr/share/nagios/html/ | Make a file named .htaccess into | ||
/usr/lib/nagios/cgi-bin/ | |||
and | |||
/usr/share/nagios/html/ | |||
which will contains: | which will contains: | ||
Revision as of 06:53, 15 November 2007
Here's how to install NAL using yum on Fedora Core 7 Linux box
Nagios default installation
The default nagios installation can be done by doing like so
root> yum -y install nagios
With that I've installed nagios.i386 0:2.9-1.fc7 version; this is the last stable version (the 3.0 is under development).
Optional, but recomended if you have enough disk space: install more Nagios plugins and addons.
root> yum -y install nagios-plugins nagios-plugins-all
That is not necessary but should be useful if you use NAL like a regular NAGIOS server more than only NAL (to monitor EPICS PVs network).
Nagios Default Folder Locations
By default Nagios yum installation, Nagios stores the following file location into your harddisk
* /etc/nagios/ - Nagios configuration folder locations * /var/log/nagios/ - Nagios log and messages folder locations * /usr/share/nagios/ - Nagios, docs, sounds, and image folder locations * /usr/lib/nagios/cgi-bin/ - Nagios CGI folder location * /usr/bin - Nagios binaries * /etc/httpd/conf.d/ - Nagios Apache folder files * /etc/logrotate.d/nagios/ - Nagios log rotation file
Insert the EPICS Nagios Plugins
Going to http://www.nagiosexchange.org ; using the "search" botton, look to "epics". You will find a project named "Nagios plugins for EPICS". Scroll down that page, click over "check_caget_dev_gw.sh". Download it and save into the /usr/lib/nagios/plugins/ Change the permission to check_caget_dev_gw.sh
root> chmod +x check_caget_dev_gw.sh
now verify that is usable with:
> ./check_caget_dev_gw.sh --help
verfing using camonitor a PV, ie for me giacchinHost:aiExample
> camonitor giacchinHost:aiExample
if everithings is good, now discover which is the IP number (for me it was 192.168.0.47) of your linux box by
root> ifconfig
and test the plugin with the follow command:
> ./check_caget_dev_gw.sh -pv giacchinHost:aiExample -H 192.168.0.47
if that reply correctly the status of your PV you can continue the installation.
Now install the EPICS logos images
> cd /usr/share/nagios/html/images/logos
download there the usr.share.nagios.html.images.logo.tar availabe at same place in nagiosexchange.org that contains : EPICSlogo.gd2 EPICSlogo.gif EPICSlogoSmall.gif
Save the original Nagios setup and replace it
Go to /etc folder and save the original setup
root> tar cvf nagios.or.tar ./nagios/
download there the etc.nagios.tar available at same place at nagiosexchange.org
and restore the nagios folder with that:
root> tar xvf ./etc.nagios.tar
Note: Now looking around the files into /etc/nagios and adjust that to meet your network setup requirements.
NAGIOS check configuration file
For sanity checking, make sure you verify Nagios config files. This can be done like so
root> nagios -v /etc/nagios/nagios.cfg
The above command would show you for any erroneous lines frin Nagios config file.
HTTPD configuration
Check the presence of line: "include conf.d/*.conf"
in /etc/httpd/conf/httpd.conf
Check the paths into the file : /etc/httpd/conf.d/nagios.conf
Make a file named .htaccess into /usr/lib/nagios/cgi-bin/ and /usr/share/nagios/html/
which will contains:
AuthName "Nagios Access" AuthType Basic AuthUserFile /etc/nagios/passwd require valid-user
Now create a nagios user with the following command:
root> htpasswd -c /etc/nagios/passwd nagiosadmin
NAGIOS as a Linux service
Basically, at this point of basic Nagios configuration, restarting Nagios should be successful.
Reload your apache service together with your Nagios service like so
root> service httpd restart root> service Nagios stop root> service Nagios start root> service Nagios status
Open your favourite web-browser on http://localhost/nagios/
login like "nagiosadmin", give your password and enjoy!
See my nagios screenshots in action:
NagiosServiceDetails
NagiosAlertHistogram
Theare a lot of other interesting feature that comes from free using NAGIOS, looking around you should find a lot yourself.
At this time Ralph Lange has realized a test to NAL at Bessy. A great aknowlegment to him, he has supported me since the idea of use Nagios born in my mind.
Thank you for your attention! Please, give me a your feedback, and fell free to drop me an email, I'll be happy to continue to work on this idea if someome is interested to use it.
--MauroGiacchini 00:40, 15 Nov 2007 (CST)