Install Nagios On Slackware
Install Nagios On Slackware
2. Add the 'apache' user to the 'nagios' group, so that it can write to the /var/nagios/rw
directory ('a' option prevents the user to be removed from other groups, the member of which
he is already):
cpan -i Monitoring::Plugin
4. Use sbopkg or install the individual packages using scripts from SlackBuilds.org, and install the
following in this order:
RRDTool
nagios (currently, the package which can be built using a SlackBuilds.org script is
nagios-4.0.8)
nagios-plugin package
nagios-graphing
5. Edit /etc/nagios/nagios.conf and turn off the logging:
CHANGE:
use_syslog=1
TO:
use_syslog=0
CHANGE:
log_notifications=1
TO:
log_notification=0
CHANGE:
Options None
TO:
Options FollowSymLinks
7. Edit /etc/httpd/http.conf
COMMENT:
LoadModule mpm_event_module lib64/httpd/modules/mod_mpm_event.so
UNCOMMENT:
#LoadModule mpm_prefork_module
SlackDocs - https://docs.slackware.com/
Last update:
2015/11/27 11:35 howtos:software:install_nagios_on_slackware https://docs.slackware.com/howtos:software:install_nagios_on_slackware
(UTC)
lib64/httpd/modules/mod_mpm_prefork.so
UNCOMMENT:
#LoadModule cgi_module lib64/httpd/modules/mod_cgi.so
(or #LoadModule cgi_module lib/httpd/modules/mod_cgi.so on 32bit
installs)
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
RIGHT AFTER:
DocumentRoot /srv/httpd/htdocs
ADD:
Include /etc/httpd/extra/nagios.conf
10. (Not sure if this is necessary but, leaving it in until I can test)
Make sure nagios starts at boot and start/restart nagios:
1. 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
2. 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:
# Stop nagios:
if [ -x /etc/rc.d/rc.nagios ]; then
echo "Stopping nagios..."
/etc/rc.d/rc.nagios stop
fi
# /etc/rc.d/rc.nagios restart
Add Users
1. Run the htpasswd command for each user:
authorized_for_all_services=nagiosadmin,bob,sue
authorized_for_all_hosts=nagiosadmin,bob,sue
TROUBLESHOOTING
ERROR: When browsing to the nagios webpage (as nagiosadmin) you get “You do not have
permission”
SlackDocs - https://docs.slackware.com/
Last update:
2015/11/27 11:35 howtos:software:install_nagios_on_slackware https://docs.slackware.com/howtos:software:install_nagios_on_slackware
(UTC)
—–
ERROR: When clicking on Nagios cgi pages, they are downloaded and not executed.
FIX: vi /etc/nagios/resource.cfg
CHANGE: $USER1$=/usr/libexec/monitoring-plugins
TO: $USER1$=/usr/libexec/nagios
ERROR: I've done the FIXes above and it's still not working…
/etc/rc.d/rc.httpd restart
/etc/rc.d/rc.nagios restart
Ignore the xinetd stuff, you have to run NRPE as a daemon on Slackware (unless you want to go
through the headache of replacing inetd with xinetd)
Test NRPE
/usr/libexec/nagios/check_nrpe -H localhost
NRPE v2.15
vi /etc/nagios/nrpe.cfg
allowed_hosts=127.0.0.1,192.168.1.77 (WHERE: 192.168.1.77 is the IP of
your Nagios server)
I did this:
vi /etc/nagios/nagios.cfg
ADD:
vi /etc/nagios/objects/linux.cfg_file
#########################################################
# Linux configuration file
#########################################################
define host {
use linux-server
host_name MyLinuxBox
alias LinuxBox1
address 192.168.1.110
register 1
}
define service{
host_name MyLinuxBox
service_description PING
check_command check_ping!100.0,20%!500.0,60%
max_check_attempts 2
check_interval 2
retry_interval 2
check_period 24x7
SlackDocs - https://docs.slackware.com/
Last update:
2015/11/27 11:35 howtos:software:install_nagios_on_slackware https://docs.slackware.com/howtos:software:install_nagios_on_slackware
(UTC)
check_freshness 1
contact_groups admins
notification_interval 2
notification_period 24x7
notifications_enabled 1
register 1
}
#########################################################
# END OF FILE
#########################################################
Restart Nagios
/etc/rc.d/rc.nagios restart
Sources
From:
https://docs.slackware.com/ - SlackDocs
Permanent link:
https://docs.slackware.com/howtos:software:install_nagios_on_slackware