Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
I kept receiving ERROR: Site Nagios does not exist! After doing a little more research I thought I discovered that it was a problem with the suffix file being .cfg instead of .conf since I am running Apache 2.4.18
So I tried renaming and copying the file to the apache2 folder:
sudo a2enmod rewrite cgi
Module rewrite already enabled
AH00526: Syntax error on line 18 of /etc/apache2/sites-enabled/nagios.conf:
Invalid command 'log_file=/usr/local/nagios/var/nagios.log', perhaps misspelled or defined by a module not included in the server configuration
Module cgi already enabled
systemctl restart apache2
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details
systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Thu 2017-01-19 12:41:07 PST;
Docs: man:systemd-sysv-generator(8)
Process: 28995 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 28900 ExecReload=/etc/init.d/apache2 reload (code=exited, status=1/FAILURE)
Process: 30812 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)
Jan 19 12:41:07 AndyLinux apache2[30812]: * The apache2 configtest failed.
Jan 19 12:41:07 AndyLinux apache2[30812]: Output of config test was:
Jan 19 12:41:07 AndyLinux apache2[30812]: AH00526: Syntax error on line 18 of /etc/apache2/site-enabled/nagios.conf:
Jan 19 12:41:07 AndyLinux apache2[30812]: Invalid command 'log_file=/usr/local/nagios/var/nagios.log', perhaps misspelled or defined by a module
Jan 19 12:41:07 AndyLinux apache2[30812]: Action 'configtest' failed.
Jan 19 12:41:07 AndyLinux apache2[30812]: The Apache error log may have more information.
Jan 19 12:41:07 AndyLinux systemd[1]: apache2.service: Control process exited, code=exited status=1
Jan 19 12:41:07 AndyLinux systemd[1]: Failed to start LSB: Apache2 web server.
Jan 19 12:41:07 AndyLinux systemd[1]: apache2.service: Unit entered failed state.
Jan 19 12:41:07 AndyLinux systemd[1]: apache2.service: Failed with result 'exit-code'.
I am very lost and would love some direction. Thank you!
It looks like you copied over the nagios.cfg file, and made it a .conf - this is not the correct file that apache2 needs. nagios.cfg is what Nagios actually uses to run, which explains this error -
Ok wow I don't know what went wrong the first time I tried but this time around I did not receive any installation errors. Woot! I appreciate the link you suggested, thanks!
Feeling a little ignorant right now but I cannot access Nagios through the browser. I am using chrome. At both points in the instructions when it tells you to 'point your web browser to...' both options returns errors.
Does port 80 show up if you run nmap localhost on the Core machine? On what OS/version are you running this?
If 80 is not open and you are running Ubuntu (possibly others) run sudo ufw allow80/tcp. On some versions of CentOS/RHEL you'll want to use firewall-cmd. You'll likely want to make sure it's persistent in some way. We can help out with that once we know which OS/version you are running.