Page 1 of 1

Unable to start nagios.

Posted: Thu Nov 23, 2017 9:01 am
by Rapsy
Hello! I'm kind of new to this and I please you to help me if you have any ideea what is happening.

So.. the problem is with http conection i guess, because I am able to acces my server and see the nagios page, but I can't acces services or anything else on this page.. it shows this:

"
Error: Could not read host and service status information!

The most common cause of this error message (especially for new users), is the fact that Nagios is not actually running. If Nagios is indeed not running, this is a normal error message. It simply indicates that the CGIs could not obtain the current status of hosts and services that are being monitored. If you've just installed things, make sure you read the documentation on starting Nagios.

Some other things you should check in order to resolve this error include:

Check the Nagios log file for messages relating to startup or status data errors.
Always verify configuration options using the -v command-line option before starting or restarting Nagios!
Make sure you read the documentation on installing, configuring and running Nagios thoroughly before continuing. If all else fails, try sending a message to one of the mailing lists. More information can be found at https://www.nagios.org.
"

The nagios service is active, /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg command returns everything ok:
"
Checking objects...
Checked 163 services.
Warning: Host 'Bit Router' has no default contacts or contactgroups defined!
Checked 56 hosts.
Checked 8 host groups.
Checked 0 service groups.
Checked 3 contacts.
Checked 1 contact groups.
Checked 45 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 56 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 1
Total Errors: 0
"
Everything has stoped on the web interface after a restart... i tried several restarts but no succes.

Please help

Thank you in advance!
George

Re: Unable to start nagios.

Posted: Mon Nov 27, 2017 4:08 pm
by dwhitfield
Rapsy wrote: I am able to acces my server and see the nagios page
Everything has stoped on the web interface after a restart
These two statements don't make sense together. Was it working and now it's not? It sounds like to me you might have two versions of nagios installed. What version of Core are you using? Was it compiled from source or installed from distro repos? On what OS/version is nagios running? cat /etc/*-release may be of use. Those questions will help us determine file paths so that we can help you.

If you are on something that uses yum, what's the output of rpm -qa | grep nagios?

Re: Unable to start nagios.

Posted: Tue Nov 28, 2017 1:23 am
by Rapsy
Hello. My english is not that good :) solved meanwhile but still acting strange.. i will update you soon about the status. Not at pc now.

Thank you!

Re: Unable to start nagios.

Posted: Tue Nov 28, 2017 2:31 am
by Rapsy
hello.

this is the output.
nagios-plugins-bdii-1.0.14-1.el6.x86_64
nagios-plugins-bonding-1.4-3.el6.x86_64
nagios-plugins-openmanage-3.7.12-1.el6.x86_64
nagios-common-4.3.4-4.el6.x86_64
nagios-4.3.4-4.el6.x86_64

Meanwhile i managed to start it, but... when i define a new host or service and restart the service, it doesn't appear on web interface even if I refresh the page. I saw that this command /usr/local/nagios/bin/nagios -x /usr/local/nagios/etc/nagios.cfg is refreshing the service somehow. Another problem is that I have defined the api for ServerAlarms on phone and it appears that I have a winserver defined but the "windows.cfg" in nagios.cfg is disabled... strange things are happening :)) if you had some of this problems and you could point me in any direction I would apreciate. Thank you in advance!

Re: Unable to start nagios.

Posted: Tue Nov 28, 2017 2:33 am
by Rapsy
I forgot. Sorry.

It is Centos 7. And I'm kind of new on this. Still trying to understand how it works, but my boss had me to monitor some linux servers with Nagios.

Re: Unable to start nagios.

Posted: Tue Nov 28, 2017 4:58 pm
by npolovenko
Hello, @Rapsy.
when i define a new host or service and restart the service, it doesn't appear on web interface even if I refresh the page.
After you define a new host or service you need to restart nagios by running the following command:

Code: Select all

service nagios restart
That will make nagios reload configurations and you should be able to see the new host in the web interface.

If that doesn't work please send us your definitions so we can double check them. Also, did you create a new file for the host/service definitions? If so you'd need to add the path to this file inside nagios.cfg.

Code: Select all

cfg_file=/usr/local/nagios/etc/...the rest of the path
As far as the API goes, is that a mobile app? We generally do not support any third party Nagios mobile apps. Can you share the link to that API with us? You may need to contact the app developers with your second question.