Novell has bundled Nagios with SLES. You can deploy Nagios by compiling the binaries or using the RPMs provided with SLES. This article will address installation and configuration of Nagios using the current RPMs delivered with SLES 10 SP3 x64.
Build the SLES 10 SP3 x64 environment. You will need to build the environment to your organization’s specifications.
Build Considerations for Nagios:
- Heavy I/O on /var/log/nagios
- Heavy reads on /etc/nagios during starts and restarts.
- Bandwidth: consider connection bonding if you have more than one network interface. Nagios will use bandwidth, but you also need to consider the users connecting to the instance via a web browser.
- Memory: Nagios will run with 32 MB of memory. However, you need to consider Nagios is a web-based application and has a caching mechanism and Apache’s caching mechanism.
- Revision Control System (RCS): You want to be able to catalog changes to the production Nagios system.
Nagios Installation
- Open yast2. Open: Software → Software Management
- Install Packages:
Apache2
Apache2-prefork
Apache2-mod_php5
nagios
nagios-nsca
nagios-nsca-client
nagios-plugins
nagios-plugins-extras
nagios-www
rcs – if the package was not installed during the operating system installation. - Press: “Continue” to accept additional packages. You should see packages like fping and libmcrypt to be added to the RPM configurations.
- After the packages have installed, select: “No” to “install or remove more packages?”
- Quit out of yast2.
- The installation is complete. At this time you can start Nagios (/etc/init.d/nagios start) and it will work. You can also start Apache (/etc/init.d/apache2 start) and it will work as well. However, you will still need to “tweak” Nagios and Apache to receive the desired results.
- Install Packages:
Where are the files?
In order to have your system become fully operational you need to know where all the pieces are located. Here is a listing of where the Nagios components are located:
- Host, Service and Nagios Configurations: /etc/nagios/
Web Interface Files: /usr/share/nagios/
Nagios Log and Archives: /var/log/nagios/
Nagios Lock File: /var/run/nagios/
Nagios Log Rotating: /etc/logrotate.d/nagios
Nagios Data Files: /var/lib/nagios/
Nagios Plugins: /usr/lib/nagios/plugins/
CGI Files: /usr/lib/nagios/cgi/
Configuring Nagios and Web Interface
- Add a nagcmd group to the system. sudo /usr/sbin/groupadd -g 5544 nagcmd
- Add a nagios user. sudo /usr/sbin/useradd -u 1209 -g 5544 -c “Nagios” -d /home/nagios -s /bin/bash -m nagios.
- You will also need to add the user nagios to the wwwrun group. Sudo /usr/sbin/usermod -g wwwrun nagios
- Give the nagios user a password. sudo passwd nagios (write this down, because you will need to know it later).
- Start Nagios: sudo /etc/init.d/nagios start.
- In /etc/apache2/conf.d/nagios.conf, comment out the Directive lines “deny from all.”
- Restart apache2: sudo /etc/init.d/apache2 restart.
- Open a web browser and go to your host’s URL: http://your-host-name.com/nagios. You will be presented with the basic Nagios screen. However, if you select any of the “Monitoring” links you will receive a permissions error message.
- Create a .htaccess_users file under /usr/share/nagios and add the nagiosadmin user and create a password: sudo htpasswd2 -c /usr/share/nagios/.htaccess_users nagiosadmin
- Add the .htaccess file path to /etc/apache2/conf.d/nagios.conf under each “Directive” category:
AuthName “Nagios Access”
AuthType Basic
AuthUserFile /usr/share/nagios/.htaccess_users
Require valid-user - Restart apache: sudo /etc/init.d/apache2 restart
- Uncomment the following lines in /etc/nagios/cgi.cfg:
authorized_for_system_information
authorized_for_configuration_information
authorized_for_system_commands
authorized_for_all_services
authorized_for_all_hosts
authorized_for_all_service_commands
authorized_for_all_host_commands - Restart Nagios: /etc/init.d/nagios restart
- Refresh your browser window and you will be prompted to login. Login using the nagiosadmin user name and the password you created in step 9.
- SECURITY CONSIDERATIONS: Change the ownership of /usr/share/nagios/.htaccess_users to wwwrun (apache user) and the permissions to 400. This will ensure Apache can read the file. Root will always be able to read and append to the file. Restart apache for the change to take effect.
That is all there is to installing Nagios on SLES 10 SP3 using Novell’s Nagios bundle. I am sorry to say that Novell is bundling Nagios version 2.6, but it is a start.
Enjoy and please provide comments and or insight.





0 Response to “Nagios RPMs bundled with Novell’s SLES”