Error: Could not read object configuration data!
-
ukzerosniper
- Posts: 17
- Joined: Wed Feb 13, 2013 9:44 am
Re: Error: Could not read object configuration data!
I searched in my nagios.cfg file and could not find anywhere "nagios-admin". I didnt include the ""
.
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Error: Could not read object configuration data!
Whoops my mistake I looked at that backwards and am now going to use the "I need more caffeine" excuse. Check your commands.cfg file, usually located in:
Make sure that you have the following defined:
Code: Select all
/usr/local/nagios/etc/commands.cfgCode: Select all
define command {
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
define command {
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}-
ukzerosniper
- Posts: 17
- Joined: Wed Feb 13, 2013 9:44 am
Re: Error: Could not read object configuration data!
Hi,
Mine is located at
and is configured as follows.
Does that all look ok to you?
Mine is located at
Code: Select all
/etc/nagios/objects/commands.cfgCode: Select all
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
# 'notify-service-by-email' command definition
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Re: Error: Could not read object configuration data!
It does not look like your commands.cfg file is included in your nagios.cfg file. You will have to uncomment or add some cfg_file directives to the object config file section of nagios.cfg. For example, /etc/nagios/objects/commands.cfg is not defined in your nagios.cfg, so you will want to add the line:
There seems to be a bunch of inconsistencies with your nagios.cfg compared to the cfg files on your system. The following cfg files are declared:
And the following cfg files are commented out:
Could you post a listing of the following directories?
Code: Select all
cfg_file=/etc/nagios/objects/commands.cfgCode: Select all
cfg_file=/etc/nagios/checkcommands.cfg
cfg_file=/etc/nagios/misccommands.cfg
cfg_file=/etc/nagios/minimal.cfg
Code: Select all
#cfg_file=/etc/nagios/contactgroups.cfg
#cfg_file=/etc/nagios/contacts.cfg
#cfg_file=/etc/nagios/dependencies.cfg
#cfg_file=/etc/nagios/escalations.cfg
#cfg_file=/etc/nagios/hostgroups.cfg
#cfg_file=/etc/nagios/hosts.cfg
#cfg_file=/etc/nagios/services.cfg
#cfg_file=/etc/nagios/timeperiods.cfg
#cfg_file=/etc/nagios/hostextinfo.cfg
#cfg_file=/etc/nagios/serviceextinfo.cfg
#cfg_dir=/etc/nagios/servers
#cfg_dir=/etc/nagios/printers
#cfg_dir=/etc/nagios/switches
#cfg_dir=/etc/nagios/routersCode: Select all
ls -la /etc/nagios
ls -la /etc/nagios/objectsFormer 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.
"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.
-
ukzerosniper
- Posts: 17
- Joined: Wed Feb 13, 2013 9:44 am
Re: Error: Could not read object configuration data!
Sure thing.
Code: Select all
# ls -la /etc/nagios
total 156
drwxr-xr-x. 3 root root 4096 Feb 14 16:56 .
drwxr-xr-x. 69 root root 4096 Feb 4 16:22 ..
-rw-rw-r--. 1 nagios nagios 9506 Oct 20 20:50 cgi.cfg
-rw-r--r--. 1 root root 4816 Oct 20 20:50 checkcommands.cfg
-rw-r--r--. 1 root root 15860 Nov 26 2010 command-plugins.cfg
-rw-r--r--. 1 root root 26 Oct 20 20:50 htpasswd.users
-rw-r--r--. 1 root root 11330 Oct 20 20:50 minimal.cfg
-rwxrwxrwx 1 root root 1568 Feb 14 09:02 misccommands.cfg
-rw-rw-r--. 1 nagios nagios 30519 Oct 20 20:50 nagios.cfg
-rw-rw-r-- 1 root root 30521 Feb 14 08:51 nagios.cfg.test
-rw-r--r--. 1 root root 7207 Nov 11 2010 nrpe.cfg
-rw-r--r--. 1 root root 5326 Nov 12 2010 nsca.cfg
drwxr-xr-x. 2 nagios nagios 4096 Oct 20 20:47 objects
-rw-r--r-- 1 root root 0 Feb 14 08:53 One
-rw-rw----. 1 nagios nagios 1340 Nov 26 2010 resource.cfg
-rw-r--r--. 1 root root 1628 Nov 12 2010 send_nsca.cfg
# ls -la /etc/nagios/objects
total 56
drwxr-xr-x. 2 nagios nagios 4096 Oct 20 20:47 .
drwxr-xr-x. 3 root root 4096 Feb 14 16:56 ..
-rw-rw-r--. 1 nagios nagios 7696 Nov 26 2010 commands.cfg
-rw-rw-r--. 1 nagios nagios 2166 Nov 26 2010 contacts.cfg
-rw-rw-r--. 1 nagios nagios 5403 Nov 26 2010 localhost.cfg
-rw-rw-r--. 1 nagios nagios 3124 Nov 26 2010 printer.cfg
-rw-rw-r--. 1 nagios nagios 3293 Nov 26 2010 switch.cfg
-rw-rw-r--. 1 nagios nagios 10812 Nov 26 2010 templates.cfg
-rw-rw-r--. 1 nagios nagios 3209 Nov 26 2010 timeperiods.cfg
-rw-rw-r--. 1 nagios nagios 4019 Nov 26 2010 windows.cfg
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Error: Could not read object configuration data!
Code: Select all
/usr/bin/nagios -v /etc/nagios/nagios.cfg-
ukzerosniper
- Posts: 17
- Joined: Wed Feb 13, 2013 9:44 am
Re: Error: Could not read object configuration data!
That produces the following
Code: Select all
/usr/bin/nagios -v /etc/nagios/nagios.cfg
Nagios Core 3.2.3
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-03-2010
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Warning: comment_file variable ignored. Comments are now stored in the status a nd retention files.
Warning: downtime_file variable ignored. Downtime entries are now stored in the status and retention files.
Warning: aggregate_status_updates directive ignored. All status file updates ar e now aggregated.
Read main config file okay...
Processing object config file '/etc/nagios/checkcommands.cfg'...
Processing object config file '/etc/nagios/misccommands.cfg'...
Processing object config file '/etc/nagios/minimal.cfg'...
Read object config files okay...
Running pre-flight check on configuration data...
Checking services...
Checked 5 services.
Checking hosts...
Checked 1 hosts.
Checking host groups...
Checked 1 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 1 contacts.
Checking contact groups...
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 20 commands.
Checking time periods...
Checked 1 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
Re: Error: Could not read object configuration data!
Looks like you are set to start configuring hosts/services and fire up the web interface.
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.
"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.
-
ukzerosniper
- Posts: 17
- Joined: Wed Feb 13, 2013 9:44 am
Re: Error: Could not read object configuration data!
Lol, thanks for the help so far,
I am still getting this message
I am still getting this message
Code: Select all
Whoops!
Error: Could not read object configuration data!
Here are some things you should check in order to resolve this error:
Verify configuration options using the -v command-line option to check for errors.
Check the Nagios log file for messages relating to startup or status data errors.
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.Re: Error: Could not read object configuration data!
Nagios might have a problem finding the correct cfg file to use. How are you starting the nagios process?
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.
"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.