root@YborStudent /root # dnf install -y nagios nagios-plugins-all Last metadata expiration check: 0:07:57 ago on Sat Jun 23 18:25:05 2018. Package nagios-4.3.4-3.fc27.x86_64 is already installed, skipping. Package nagios-plugins-all-2.2.1-9.fc27.x86_64 is already installed, skipping. Dependencies resolved. Nothing to do. Complete! root@YborStudent /root # cd /etc/httpd/conf.d root@YborStudent /etc/httpd/conf.d # ls BackupPC.conf manual.conf mrtg.confphp.conf ssl.conf README mediawiki.conf nagios.conf phpldapadmin.conf userdir.conf autoindex.conf mediawiki.conf-old nss.confrt.conf webalizer.conf lookup_identity.conf mod_dnssd.conf perl-HTML-Mason.conf squid.conf welcome.conf mailman.conf mod_security.conf perl.conf squirrelmail.conf root@YborStudent /etc/httpd/conf.d # cat nagios.conf # SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER # # This file contains examples of entries that need # to be incorporated into your Apache web server # configuration file. Customize the paths, etc. as # needed to fit your system. ScriptAlias /nagios/cgi-bin "/usr/lib64/nagios/cgi-bin/" # SSLRequireSSL Options ExecCGI AllowOverride None = 2.3> Require all granted # Require host 127.0.0.1 AuthName "Nagios Access" AuthType Basic AuthUserFile /etc/nagios/passwd Require valid-user Order allow,deny Allow from all # Order deny,allow # Deny from all # Allow from 127.0.0.1 AuthName "Nagios Access" AuthType Basic AuthUserFile /etc/nagios/passwd Require valid-user Alias /nagios "/usr/share/nagios/html" # SSLRequireSSL Options None AllowOverride None = 2.3> Require all granted # Require host 127.0.0.1 AuthName "Nagios Access" AuthType Basic AuthUserFile /etc/nagios/passwd Require valid-user Order allow,deny Allow from all # Order deny,allow # Deny from all # Allow from 127.0.0.1 AuthName "Nagios Access" AuthType Basic AuthUserFile /etc/nagios/passwd Require valid-user root@YborStudent /etc/httpd/conf.d # cd /etc/nagios/ root@YborStudent /etc/nagios # ls cgi.cfg conf.d/ nagios.cfg objects/ passwd private/ root@YborStudent /etc/nagios # cat passwd nagiosadmin:RbdO4ou4PNyMg root@YborStudent /etc/nagios # pwqgen XXXXXXXXXXXX root@YborStudent /etc/nagios # htpasswd -c passwd nagiosadmin New password: XXXXXXXXXXXX Re-type new password: XXXXXXXXXXXX Adding password for user nagiosadmin root@YborStudent /etc/nagios # cat passwd nagiosadmin:$apq1$IJ84iu/lLt6eZVpwnTC91 root@YborStudent /etc/nagios # cd root@YborStudent /root # systemctl start nagios root@YborStudent /root # systemnctl status nagios nagios.service - Nagios Network Monitoring Loaded: loaded (/usr/lib/systemd/system/nagios.service; disabled; vendor preset: disabled) Active: active (running) since Sat 2018-06-23 18:36:34 EDT; 8s ago Docs: https://www.nagios.org/documentation/ Process: 24030 ExecStart=/usr/sbin/nagios -d /etc/nagios/nagios.cfg (code=exited, status=0/SUCCESS) Process: 24029 ExecStartPre=/usr/sbin/nagios -v /etc/nagios/nagios.cfg (code=exited, status=0/SUCCESS) Main PID: 24031 (nagios) Tasks: 6 (limit: 9830) CGroup: /system.slice/nagios.service 24031 /usr/sbin/nagios -d /etc/nagios/nagios.cfg 24033 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh 24034 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh 24035 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh 24036 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh 24042 /usr/sbin/nagios -d /etc/nagios/nagios.cfg Jun 23 18:36:34 YborStudent nagios[24031]: nerd: Channel hostchecks registered successfully Jun 23 18:36:34 YborStudent nagios[24031]: nerd: Channel servicechecks registered successfully Jun 23 18:36:34 YborStudent nagios[24031]: nerd: Channel opathchecks registered successfully Jun 23 18:36:34 YborStudent nagios[24031]: nerd: Fully initialized and ready to rock! Jun 23 18:36:34 YborStudent nagios[24031]: wproc: Successfully registered manager as @wproc with query handler Jun 23 18:36:34 YborStudent nagios[24031]: wproc: Registry request: name=Core Worker 24033;pid=24033 Jun 23 18:36:34 YborStudent nagios[24031]: wproc: Registry request: name=Core Worker 24035;pid=24035 Jun 23 18:36:34 YborStudent nagios[24031]: wproc: Registry request: name=Core Worker 24036;pid=24036 Jun 23 18:36:34 YborStudent nagios[24031]: wproc: Registry request: name=Core Worker 24034;pid=24034 Jun 23 18:36:35 YborStudent nagios[24031]: Successfully launched command file worker with pid 24042 root@YborStudent /root # systemctl enable nagios Created symlink /etc/systemd/system/multi-user.target.wants/nagios.service /usr/lib/systemd/system/nagios.service. ********************************************************************** ************ Use all parts of Nagios from web browser **************** ********************************************************************** root@YborStudent /etc/nagios # cd root@YborStudent /root # grep nagios /var/log/audit/audit.log |audit2allow -M mynagios ******************** IMPORTANT *********************** To make this policy package active, execute: semodule -i mynagios.pp root@YborStudent /root # cat mynagios.te module mynagios 1.0; require { type nagios_script_t; type nagios_spool_t; type nagios_etc_t; type nagios_log_t; type nagios_t; class file map; } #============= nagios_script_t ============== allow nagios_script_t nagios_etc_t:file map; allow nagios_script_t nagios_log_t:file map; allow nagios_script_t nagios_spool_t:file map; #============= nagios_t ============== allow nagios_t nagios_log_t:file map; root@YborStudent /root # semodule -i mynagios.pp root@YborStudent /root # setenforce 1 root@YborStudent /root # exit