Page 1 of 1

Nagios Configuration Help Please

Posted: Sat Oct 17, 2015 9:23 am
by kwhogster
Raspbery Pi Raspbian Jesse
Apache2 running
Windows 10 Ie or Edge
Nagios 4.0.8

When I browse the Nagios Main Page I see Nagios Core big display and under it is displays RED X NOT RUNNNIG
That is issue One

Issue two

in Nagios.cfg file I changed this line

#cfg_file=/usr/local/Nagios/etc/objects/windows.cfg
to
cfg_file=/usr/local/Nagios/etc/objects/windows.cfg

Removed the #

did a service Nagios reload

root@raspberrypi:/usr/local/nagios/etc# service nagios reload
Running configuration check...

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Unexpected token or statement in file '/usr/local/nagios/etc/objects/windows.cfg' on line 65.
Error processing object config files!


***> One or more problems was encountered while processing the config files...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.

If I put the # back
root@raspberrypi:/usr/local/nagios/etc# service nagios reload
Running configuration check...
[ ok ] Starting nagios (via systemctl): nagios.service.
root@raspberrypi:/usr/local/nagios/etc#

Then Nagios starts

root@raspberrypi:/usr/local/nagios/etc# service nagios status
● nagios.service - Nagios
Loaded: loaded (/etc/systemd/system/nagios.service; enabled)
Active: active (running) since Sat 2015-10-17 14:04:12 UTC; 11min ago
Main PID: 935 (nagios)
CGroup: /system.slice/nagios.service
├─935 /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg
├─936 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─937 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─938 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─939 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
└─940 /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg

Oct 17 14:04:13 raspberrypi nagios[935]: wproc: Registry request: name=Core Worker 937;pid=937
Oct 17 14:04:13 raspberrypi nagios[935]: wproc: Registry request: name=Core Worker 938;pid=938
Oct 17 14:04:13 raspberrypi nagios[935]: wproc: Registry request: name=Core Worker 939;pid=939
Oct 17 14:04:13 raspberrypi nagios[935]: wproc: Registry request: name=Core Worker 936;pid=936
Oct 17 14:04:13 raspberrypi nagios[935]: wproc: Registry request: name=Core Worker 937;pid=937
Oct 17 14:04:13 raspberrypi nagios[935]: wproc: Registry request: name=Core Worker 938;pid=938
Oct 17 14:04:13 raspberrypi nagios[935]: wproc: Registry request: name=Core Worker 939;pid=939
Oct 17 14:04:13 raspberrypi nagios[935]: Successfully launched command file worker with pid 940
Oct 17 14:04:13 raspberrypi nagios[935]: Successfully launched command file worker with pid 940
Oct 17 14:15:18 raspberrypi systemd[1]: Started Nagios.
root@raspberrypi:/usr/local/nagios/etc#


But the Nagios Core Home Page still shows RED X NOT RUNNING



Issue Three
Other problem with my browsers from the Main Home Page not matter which menu Item I choose example under current status I select HOSTS the display is all unreadable characters



So

1. Nagios Home Page shows RED X NOT RUNNING

2. Removing # from Nagios.cfg file causes Nagios to fail to start

3. Nagios Home page bad output when displaying any element

Any help would be appreciated.

Thanks

Re: Nagios Configuration Help Please

Posted: Sat Oct 17, 2015 12:51 pm
by kwhogster
Update

Just upgraded to Nagios 4.1.1 Plugins 2.1.1

Same results as above.

Need help

Thanks

New Note

I am now able to update the Nagios.cfg I was able to remove the # and now the reload works.

just can not browse the page Thoughts

Re: Nagios Configuration Help Please

Posted: Sat Oct 17, 2015 6:58 pm
by eloyd
The plugins do not have anything to do with Nagios Core itself.

This error leaps out at me and I'm not sure I see anything that addresses it:

Code: Select all

Error: Unexpected token or statement in file '/usr/local/nagios/etc/objects/windows.cfg' on line 65.
Can you post that file?

Re: Nagios Configuration Help Please

Posted: Mon Oct 19, 2015 2:55 pm
by tmcdonald
Usually we see that with copy+paste mixups in the configs, from an open "define" line or mismatched curly brace.

Re: Nagios Configuration Help Please

Posted: Thu Oct 22, 2015 10:15 am
by kwhogster
I got it working now

Was not Nagios it was Apache2

To get rid of the Red X Not running message and the CGI pages not working to work

Had to run this

sudo a2enmod cgi
sudo service apache2 restart


Thanks

Re: Nagios Configuration Help Please

Posted: Thu Oct 22, 2015 10:25 am
by hsmith
Thank you for sharing the fix with us! Is there anything else we can do for you, or is this one all right to lock up?

Re: Nagios Configuration Help Please

Posted: Thu Oct 22, 2015 3:24 pm
by kwhogster
Yes all good problem solved