CentOS errors

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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: CentOS errors

Post by slansing »

I'd follow what cbeattie mentioned above and let us know!
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: CentOS errors

Post by MPIvan »

Yup now it is ok ... but i have now new problem ... i create new file in objects named routers.cfg ... and i put one host with service ping to check ... and in the nagios/etc nagios.cfg file i have add the the routers.cfg file and when i try to restart it gave me the status of the configurations like when i run the command /usr/local/nagios/bin/nagio -v /usr/local/nagios/etc/nagios.cfg and when i go to the page on services iv got this error message

Whoops!

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 http://www.nagios.org.
also i have notes that when i do ls i have dots "." at the end of the permission colon
[root@mpnagios etc]# ls -la
total 76
drwxrwxr-x. 3 nagios nagios 4096 Oct 22 16:52 .
drwxr-xr-x. 8 root root 4096 Oct 22 16:49 ..
-rw-rw-r--. 1 nagios nagios 12015 Oct 22 16:49 cgi.cfg
-rw-r--r--. 1 root root 26 Oct 22 16:52 htpasswd.users
-rw-rw-r--. 1 nagios nagios 44526 Oct 22 18:35 nagios.cfg
drwxrwxr-x. 2 nagios nagios 4096 Oct 22 17:45 objects
-rw-rw----. 1 nagios nagios 1312 Oct 22 16:49 resource.cfg
[root@mpnagios etc]#
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: CentOS errors

Post by tmcdonald »

The period is related to SELinux ACLs:

http://superuser.com/questions/230559/w ... with-chmod

As for whether or not that is related, I do not know.
Former Nagios employee
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: CentOS errors

Post by MPIvan »

No still nothing ... any way i think that thats not a problem at all ... because i can modify the nagios.cfg file, for example if i uncomment "#cfg_file=/usr/local/nagios/etc/objects/switch.cfg" it works ... but if i add another file like routers.cfg it wont work ...
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: CentOS errors

Post by sreinhardt »

Where did you put the routers.cfg, and what permissions are presently on it?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
IvanAK
Posts: 25
Joined: Sun Mar 17, 2013 9:43 am

Re: CentOS errors

Post by IvanAK »

Sorry i reply with this user ... but im in a hurry ... the routers.cfg files is in /usr/local/nagios/etc/objects ... where the switch cfg is and windows and template and etc.... and the permissions that it has is 664 ( rw-rw-r- and nagios:nagios ) ...
cbeattie
Posts: 19
Joined: Fri Oct 04, 2013 7:12 am

Re: CentOS errors

Post by cbeattie »

What does it say when you run Nagios' configuration check? (Adjust it if your paths are different)

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
If there's a problem with your configuration files, the config check will print the name of the offending file and the line number in that file. That'll tell us where to look next.
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: CentOS errors

Post by MPIvan »

No there is no problems im checking before im restarting

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.0.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-15-2013
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
        Checked 9 services.
Warning: Host 'RouterCiscoT' has no default contacts or contactgroups defined!
        Checked 2 hosts.
        Checked 2 host groups.
        Checked 0 service groups.
        Checked 1 contacts.
        Checked 1 contact groups.
        Checked 24 commands.
        Checked 5 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 2 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

Things look okay - No serious problems were detected during the pre-flight check
[root@mpnagios objects]#
and here is what iv got when im trying to restart

Code: Select all

[root@mpnagios objects]# /etc/init.d/nagios restart

Nagios Core 4.0.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-15-2013
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
        Checked 9 services.
Warning: Host 'RouterCiscoT' has no default contacts or contactgroups defined!
        Checked 2 hosts.
        Checked 2 host groups.
        Checked 0 service groups.
        Checked 1 contacts.
        Checked 1 contact groups.
        Checked 24 commands.
        Checked 5 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 2 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

Things look okay - No serious problems were detected during the pre-flight check
Object precache file created:
/usr/local/nagios/var/objects.precache
[root@mpnagios objects]#
Its the same output ...
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: CentOS errors

Post by MPIvan »

Ok i think i have solution .... in the previous reply and output there was 1 Warning about contact ... when i fix this, everything back to normal. I dont have this problem on Ubuntu or previous version of nagios is this some kind of bug or ??? because it is warning i think should be continue ...
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: CentOS errors

Post by abrist »

Did you change anything else? Config warnings should not cause this issue.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked