[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

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
howtos:install_nagios_on_slackware [2012/09/11 17:30 (UTC)] – CREATED arfonhowtos:install_nagios_on_slackware [2012/09/12 13:41 (UTC)] – [Install Nagios On Slackware] 11 & 12 shouldn't have been III and IV arfon
Line 3: Line 3:
 (Slackware 13.37) \\ (Slackware 13.37) \\
  
-1) Create the nagios group and user- +  - Create the nagios group and user: <code> 
-     groupadd -g 213 nagios +groupadd -g 213 nagios 
-     useradd -u 213 -d /dev/null -s /bin/false -g nagios nagios +useradd -u 213 -d /dev/null -s /bin/false -g nagios nagios 
- +</code> 
-1a) Add the 'apache' user to the 'nagios' group, so that it can write to the /var/nagios/rw directory: +   - Add the 'apache' user to the 'nagios' group, so that it can write to the ''/var/nagios/rw'' directory: <code> 
-     usermod -G nagios apache +usermod -G nagios apache 
- +</code> 
-2) Install the Nagios::Plugin Perl module-+  Install the Nagios::Plugin Perl module: <code>
      cpan -i Nagios::Plugin      cpan -i Nagios::Plugin
- +</code> 
- +  Use [[http://sbopkg.org/|sbopkg]] or install the individual packages using scripts from [[http://slackbuilds.org/|SlackBuilds.org]], and install the following in this order: 
-3) Use sbopkg and install the following in this order: +    * RRDTool 
- +    * nagios (currently, the package which can be built using a [[http://slackbuilds.org/network/nagios/ | SlackBuilds.org script]] is nagios-3.3.1) 
-  * RRDTool +    * nagios-plugin package 
-  * nagios (currently, the package is nagios-3.3.1.i486-1_SBo+    * nagios-graphing 
-  * nagios-plugin package +  Edit ''/etc/nagios/nagios.conf'' and turn off the logging: <code> 
-  * nagios-graphing +CHANGE: 
- +     use_syslog=1 
-3) Edit /etc/nagios/nagios.conf +TO: 
-     Turn off the logging- +     use_syslog=0 
-          CHANGE: use_syslog=1 TO: use_syslog=0 +CHANGE: 
-          CHANGE: log_notifications=1 TO: log_notification=0 +     log_notifications=1 
- +TO: 
-4) Edit /etc/httpd/extra/nagios.conf, after the <Directory "/var/www/htdocs/nagios"> line- +     log_notification=0 
-     CHANGE: Options None TO: Options FollowSymLinks +</code> 
- +  Edit ''/etc/httpd/extra/nagios.conf'', after the ''<Directory "/var/www/htdocs/nagios">'' line: <code> 
-5) Edit /etc/httpd/http.conf +CHANGE: 
-     CHANGE:+     Options None 
 +TO: 
 +     Options FollowSymLinks 
 +</code> 
 +  Edit ''/etc/httpd/http.conf'' <code> 
 +CHANGE:
      <IfModule dir_module>      <IfModule dir_module>
      DirectoryIndex index.html      DirectoryIndex index.html
      </IfModule>      </IfModule>
-      +TO:
-     TO:+
      <IfModule dir_module>      <IfModule dir_module>
      DirectoryIndex index.html index.php      DirectoryIndex index.html index.php
      </IfModule>      </IfModule>
- +CHANGE:
-     CHANGE:+
      # Uncomment the following line to enable PHP:      # Uncomment the following line to enable PHP:
      #      #
      # Include /etc/httpd/mod_php.conf      # Include /etc/httpd/mod_php.conf
-      +TO:
-     TO:+
      # Uncomment the following line to enable PHP:      # Uncomment the following line to enable PHP:
      #      #
      Include /etc/httpd/mod_php.conf      Include /etc/httpd/mod_php.conf
- +ADD:
-     ADD:+
      Include /etc/httpd/extra/nagios.conf      Include /etc/httpd/extra/nagios.conf
 +</code>
 +  - Make sure apache starts at boot and start/restart apache: <code>
 +# chmod 755 /etc/rc.d/rc.httpd
 +# /etc/rc.d/rc.httpd restart
 +</code>
 +  - Set the password for //nagiosadmin// : <code>
 +# htpasswd -c /etc/nagios/htpasswd.users nagiosadmin
 +</code>
 +  - (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: <code>
 +# Start nagios:
 +if [ -x /etc/rc.d/rc.nagios ]; then
 +  echo "Starting nagios..."
 +  /etc/rc.d/rc.nagios start
 +fi
 +</code>
 +    - Edit ''/etc/rc.d/rc.local_shutdown'' (you may have to create this file if it does not exist, and make it executable) and add: <code>
 +# Stop nagios:
 +if [ -x /etc/rc.d/rc.nagios ]; then
 +  echo "Stopping nagios..."
 +  /etc/rc.d/rc.nagios stop
 +fi
 +</code>
 +  - Make rc.nagios executable: <code>
 +# chmod 755 /etc/rc.d/rc.nagios
 +</code>
 +  - Start nagios: <code>
 +# /etc/rc.d/rc.nagios restart
 +</code>
  
-6) Make sure apache starts at boot and start/restart apache- +====== Check That Nagios Is Running ======
-     chmod 755 /etc/rc.d/rc.httpd +
-     /etc/rc.d/rc.httpd restart+
  
-7) Set the password for //nagiosadmin//+Goto **http://YOUR_MACHINE/nagios/** and you should see Nagios working.
-     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- +====== Add Users ======
-     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+  - Run the ''htpasswd'' command for each user<code> 
-          chmod 755 /etc/rc.d/rc.nagios+# htpasswd -c /etc/nagios/htpasswd.users bob 
 +# htpasswd -c /etc/nagios/htpasswd.users sue 
 +</code> 
 +  - Edit ''/etc/nagios/cgi.cfg'' and add the user(s) too: <code> 
 +authorized_for_all_services=nagiosadmin,bob,sue 
 +authorized_for_all_hosts=nagiosadmin,bob,sue 
 +</code> (or add "''*''" to allow all authenticated users)
  
-     Start nagios: 
-          /etc/rc.d/rc.nagios restart 
  
-====== Check That Nagios Is Running ====== +====== Sources ======
-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 ====== 
 <!-- If you are copying information from another source, then specify that source --> <!-- If you are copying information from another source, then specify that source -->
 <!-- * Original source: [[http://some.website.org/some/page.html]] --> <!-- * Original source: [[http://some.website.org/some/page.html]] -->
 howtos:install_nagios_on_slackware ()