Fedora 25: Install Nagios


Table of Contents

1 Install Nagios

The following script will install Nagios. NAGIOS_PASSWD will be used for Basic authentication password of nagiosadmin user.

#!/bin/shNAGIOS_PASSWD=nagiossudo dnf install -y nagios nagios-plugins-*# https://bugzilla.redhat.com/show_bug.cgi?id=1291718sudo mkdir /var/log/nagios/rwsudo chown nagios:nagios /var/log/nagios/rwsudo chmod 700 /var/log/nagios/rw# Apache2sudo htpasswd -db /etc/nagios/passwd “nagiosadmin” ${NAGIOS_PASSWD}sudo systemctl enable httpdsudo systemctl restart httpdsudo firewall-cmd –add-service=http –permanentsudo firewall-cmd –reload# https://bugzilla.redhat.com/show_bug.cgi?id=1291734cat <<EOF > nagios-socket.temodule nagios-socket 1.0;require { type nagios_t; type nagios_log_t; class sock_file { write create unlink }; class unix_stream_socket connectto;}allow nagios_t nagios_log_t:sock_file { write create unlink };allow nagios_t self:unix_stream_socket connectto;EOFcheckmodule -M -m -o nagios-socket.mod nagios-socket.tesemodule_package -m nagios-socket.mod -o nagios-socket.ppsudo semodule -i nagios-socket.pprm -f nagios-socket.te nagios-socket.mod nagios-socket.ppsudo systemctl enable nagiossudo systemctl restart nagios

Nagios configuration to Apache2 is written in the following file. You can change Nagios configuration like Digest authentication.

/etc/apache2/conf-available/nagios3.conf

2 Access to Nagios

Access to Nagios via the following URL.

http://<server>/nagios

Input nagiosadmin user and NAGIOS_PASSWD.

0001_BasicAuth.png

Nagios is displayed.

0002_Nagios.png

Android | Linux | SDL - Narrow Escape