[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

This is an old revision of the document!


Install Nagios On Slackware

(Slackware 13.37)

1) Create the nagios group and user-

   groupadd -g 213 nagios
   useradd -u 213 -d /dev/null -s /bin/false -g nagios nagios

1a) Add the 'apache' user to the 'nagios' group, so that it can write to the /var/nagios/rw directory:

   usermod -G nagios apache

2) Install the Nagios::Plugin Perl module-

   cpan -i Nagios::Plugin

3) Use sbopkg and install the following in this order:

  • RRDTool
  • nagios (currently, the package is nagios-3.3.1.i486-1_SBo)
  • nagios-plugin package
  • nagios-graphing

3) Edit /etc/nagios/nagios.conf

   Turn off the logging-
        CHANGE: use_syslog=1		TO: use_syslog=0
        CHANGE: log_notifications=1	TO: log_notification=0

4) Edit /etc/httpd/extra/nagios.conf, after the <Directory “/var/www/htdocs/nagios”> line-

   CHANGE: Options None		TO: Options FollowSymLinks

5) Edit /etc/httpd/http.conf

   CHANGE:
   <IfModule dir_module>
   DirectoryIndex index.html
   </IfModule>
   
   TO:
   <IfModule dir_module>
   DirectoryIndex index.html index.php
   </IfModule>
   CHANGE:
   # Uncomment the following line to enable PHP:
   #
   # Include /etc/httpd/mod_php.conf
   
   TO:
   # Uncomment the following line to enable PHP:
   #
   Include /etc/httpd/mod_php.conf
   ADD:
   Include /etc/httpd/extra/nagios.conf

6) Make sure apache starts at boot and start/restart apache-

   chmod 755 /etc/rc.d/rc.httpd
   /etc/rc.d/rc.httpd restart

7) Set the password for nagiosadmin-

   htpasswd -c /etc/nagios/htpasswd.users nagiosadmin

8) (Not sure if this is necessary but, leaving it in until I can test) Make sure nagios starts at boot and start/restart nagios-

   edit /etc/rc.d/rc.local and add:
        # Start nagios:
        if [ -x /etc/rc.d/rc.nagios ]; then
             echo "Starting nagios..."
             /etc/rc.d/rc.nagios start
        fi
        # Stop nagios:
        if [ -x /etc/rc.d/rc.nagios ]; then
             echo "Stopping nagios..."
             /etc/rc.d/rc.nagios stop
        fi
   make rc.nagios executable:
        chmod 755 /etc/rc.d/rc.nagios
   Start nagios:
        /etc/rc.d/rc.nagios restart

Check That Nagios Is Running

Goto http://YOUR_MACHINE/nagios/ and it should work.

Add Users

1) Run the htpasswd command for each user-

   htpasswd -c /etc/nagios/htpasswd.users bob
   
   htpasswd -c /etc/nagios/htpasswd.users sue

2) Edit /etc/nagios/cgi.cfg and add the user to:

   authorized_for_all_services=nagiosadmin,bob,sue
   authorized_for_all_hosts=nagiosadmin,bob,sue
   
   (or * for all authenticated users)

Sources

* Originally written by arfon

 howtos:install_nagios_on_slackware ()