Difference between revisions of "How to Set Up NAL (Nagios Alarm Handler) to monitor an EPICS network"
Line 2: | Line 2: | ||
===Nagios default installation=== | |||
The default nagios installation can be done by doing like so | The default nagios installation can be done by doing like so | ||
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 | With that I've installed nagios.i386 0:2.9-1.fc7 version; this is the last | ||
Line 15: | Line 13: | ||
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. | ||
root> ''yum -y install nagios-plugins nagios-plugins-all | root> ''yum -y install nagios-plugins nagios-plugins-all | ||
'' | '' | ||
Line 21: | Line 19: | ||
===Nagios Default Folder Locations=== | |||
By default Nagios yum installation, Nagios stores the following file location into your harddisk | By default Nagios yum installation, Nagios stores the following file location into your harddisk | ||
Line 34: | Line 32: | ||
===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 | 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 | ||
Line 40: | Line 38: | ||
Change the permission to check_caget_dev_gw.sh | Change the permission to check_caget_dev_gw.sh | ||
root> ''chmod +x check_caget_dev_gw.sh | root> ''chmod +x check_caget_dev_gw.sh | ||
'' | '' | ||
now verify that is usable with: | now verify that is usable with: | ||
> ''./check_caget_dev_gw.sh --help'' | > ''./check_caget_dev_gw.sh --help'' | ||
verfing using camonitor a PV, ie for me giacchinHost:aiExample | verfing using camonitor a PV, ie for me giacchinHost:aiExample | ||
> ''camonitor 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 | 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'' | root> ''ifconfig'' | ||
and test the plugin with the follow command: | and test the plugin with the follow command: | ||
> ''./check_caget_dev_gw.sh -pv giacchinHost:aiExample -H 192.168.0.47'' | > ''./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. | if that reply correctly the status of your PV you can continue the installation. | ||
Line 65: | Line 63: | ||
'''Now install the EPICS logos images''' | '''Now install the EPICS logos images''' | ||
> ''cd /usr/share/nagios/html/images/logos'' | > ''cd /usr/share/nagios/html/images/logos'' | ||
download there the usr.share.nagios.html.images.logo.tar availabe at same place in nagiosexchange.org | download there the usr.share.nagios.html.images.logo.tar availabe at same place in nagiosexchange.org | ||
Line 71: | Line 69: | ||
===Save the original Nagios setup and replace it=== | |||
Go to /etc folder and save the original setup | Go to /etc folder and save the original setup | ||
root> ''tar cvf nagios.or.tar ./nagios/'' | root> ''tar cvf nagios.or.tar ./nagios/'' | ||
download there the etc.nagios.tar available at same place at nagiosexchange.org | download there the etc.nagios.tar available at same place at nagiosexchange.org | ||
Line 81: | Line 79: | ||
and restore the nagios folder with that: | and restore the nagios folder with that: | ||
root> ''tar xvf ./etc.nagios.tar'' | root> ''tar xvf ./etc.nagios.tar'' | ||
Note: Now looking around the files into /etc/nagios and adjust that to meet your network setup requirements. | 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 | For sanity checking, make sure you verify Nagios config files. This can be done like so | ||
root> ''nagios -v /etc/nagios/nagios.cfg | root> ''nagios -v /etc/nagios/nagios.cfg | ||
'' | '' | ||
Line 96: | Line 94: | ||
===HTTPD configuration=== | |||
Check the presence of line: "include conf.d/*.conf" | Check the presence of line: "include conf.d/*.conf" | ||
Line 117: | Line 115: | ||
Now create a nagios user with the following command: | Now create a nagios user with the following command: | ||
root> ''htpasswd -c /etc/nagios/passwd nagiosadmin | 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. | Basically, at this point of basic Nagios configuration, restarting Nagios should be successful. | ||
Line 127: | Line 125: | ||
Reload your apache service together with your Nagios service like so | Reload your apache service together with your Nagios service like so | ||
root> ''service httpd restart'' | root> ''service httpd restart'' | ||
root> ''service Nagios stop'' | root> ''service Nagios stop'' | ||
root> ''service Nagios start'' | root> ''service Nagios start'' | ||
root> ''service Nagios status'' | root> ''service Nagios status'' | ||
Open your favourite web-browser on http://localhost/nagios/ | Open your favourite web-browser on http://localhost/nagios/ | ||
Line 138: | Line 136: | ||
===See my nagios screenshots in action:=== | |||
Line 158: | Line 156: | ||
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. | 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. | ||
More information about NAL could be keeped at : http://www.lnl.infn.it/~epics/NAL.html | |||
You should find there a special LivEPICS (Linux Live CD EPICS fully equipped) with NAGIOS pre-setted and ready to use. | |||
Thank you for your attention! | 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. | 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. | ||
[mailto:Mauro.Giacchini_at_lnl.infn.it Mauro Giacchini (INFN-LNL)] | |||
--[[User:MauroGiacchini|MauroGiacchini]] 00:40, 15 Nov 2007 (CST) | --[[User:MauroGiacchini|MauroGiacchini]] 00:40, 15 Nov 2007 (CST) |
Revision as of 07:16, 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.
More information about NAL could be keeped at : http://www.lnl.infn.it/~epics/NAL.html You should find there a special LivEPICS (Linux Live CD EPICS fully equipped) with NAGIOS pre-setted and ready to use.
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)