Nagios
This site documents the Nagios package.
Installation
- Install the package CSWnagios
The package will create a user nagios and a group nagios if not already present on the system.
Configuration
Location of configuration and log files
- Package revision 2009.03.20 and earlier:
- Config files are located by default in /opt/csw/nagios/etc/
- Log files are stored in /opt/csw/nagios/var/
- Package revision 2010.04.02 and later
- Config files are located by default in /etc/opt/csw/nagios/
- Log files are stored in /var/opt/csw/nagios/
(Examples on this site are for revisions 2010.04.02 and later!)
Configuration of the web server
- The package uses the CSW Apache by default.
- Include the sample Apache config file to your Apache configuration in /opt/csw/apache2/etc/httpd.conf:
Include /etc/opt/csw/nagios/httpd-nagios.conf
- Add a user (nagiosadmin is the predefined admin user for the webinterface) to your Apache authentication file (by default: /etc/opt/csw/nagios/htpasswd.users):
/opt/csw/apache2/sbin/htpasswd -c /etc/opt/csw/nagios/htpasswd.users nagiosadmin
- Put the user the webserver is running with into the group nagioscm (the CSW Apache runs under the user nobody):
nagioscm::101:nagios,nobody
- Restart your web server
svcadm restart cswapache2
You should now be able to access your Nagios installation with http://<yourserver>/nagios/index.php
Check the Nagios configuration
/opt/csw/nagios/bin/nagios -v /etc/opt/csw/nagios/nagios.cfg
Start / stop Nagios
- For Solaris 9:
/etc/init.d/cswnagios start|stop
- For Solaris 10:
svcadm enable|disable cswnagios
Upgrading from package revisions 2009.03.20 and earlier to revisions 2010.04.02 or later
As mentioned above, the configuration and log files of Nagios were stored in older package revisions in /opt/csw/nagios/etc/ or /opt/csw/nagios/var/. To apply the standards of OpenCSW the location of these files has been changed to /etc/opt/csw/nagios/ and /var/opt/csw/nagios/.
Upgrading from an older revision to a newer one (which means pkgrm and pkgadd) is not harmful but can result in some additional work. Here are the points:
- Make a backup of /opt/csw/nagios/etc/!
- Standard config files, as nagios.cfg or commands.cfg, will be moved automatically. Nevertheless you have to check and change all the path names in these files.
- Config files, which were created by yourself, have to be moved manually to the new location. Path names in these files have to be checked and changed too.
- Changing the pathes could be done mostly with a simple search and replace in vi or with sed.
- Check your new configuration - see Check the Nagios configuration
page revision: 4, last edited: 16 Sep 2012 19:08