CentOS Stream 8
Sponsored Link

Nagios 4 : Install2021/06/03

Install Nagios 4 which is an enterprise open source monitoring system.
[3] Install Nagios Server.
Also Install basic plugins to monitor Nagios Server itself.
# install from EPEL

[root@dlp ~]#
dnf --enablerepo=epel -y install nagios nagios-plugins-{ping,disk,users,procs,load,swap,ssh,http}
[4] Configure Nagios.
[root@dlp ~]#
vi /etc/httpd/conf.d/nagios.conf
# line 16-17 : change access permission if you need ( also change line 47-48 )

Require all granted
Require host
# add nagios admin user

[root@dlp ~]#
htpasswd /etc/nagios/passwd nagiosadmin

New password:    
# set any password

Re-type new password:
Adding password for user nagiosadmin
[root@dlp ~]#
systemctl enable --now nagios

[root@dlp ~]#
systemctl restart httpd

[5] If SELinux is enabled, change policy.
# install from EPEL

[root@dlp ~]#
dnf --enablerepo=epel -y install nagios-selinux
[root@dlp ~]#
vi nagios-php.te
# create new

module nagios-php 1.0;

require {
        type httpd_t;
        type nagios_spool_t;
        class file { getattr open read };

#============= httpd_t ==============
allow httpd_t nagios_spool_t:file { getattr open read };

[root@dlp ~]#
checkmodule -m -M -o nagios-php.mod nagios-php.te

checkmodule: loading policy configuration from nagios-php.te
checkmodule: policy configuration loaded
checkmodule: writing binary representation (version 19) to nagios-php.mod
[root@dlp ~]#
semodule_package --outfile nagios-php.pp --module nagios-php.mod

[root@dlp ~]#
semodule -i nagios-php.pp

[6] If Firewalld is running, allow HTTP service.
[root@dlp ~]#
firewall-cmd --add-service={http,https} --permanent

[root@dlp ~]#
firewall-cmd --reload

[7] Access to [http://(Nagios server's hostname or IP address)/nagios/] from a client which is in the network allowed by Nagios server and authenticate to login with the Nagios administration user [nagiosadmin] you added.
[8] After successing authentication, Nagios admin site is displayed.
[9] It's possible to see system status to click [Tactical Overview] and so on.
Matched Content