Page 2 of 2

Re: Adding hosts/clients to Nagios Core 3.5(Red Hat 6.4)

Posted: Wed Sep 11, 2013 3:41 am
by gshergill
Hi ricardowesley,

You posted the below result;

Code: Select all

root@plxnagios ~]# cat /usr/local/nagios/etc/nagios.cfg | grep cfg_file=
cfg_file=/usr/local/nagios/etc/objects/commands.cfg
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/objects/templates.cfg
cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
#cfg_file=/usr/local/nagios/etc/objects/windows.cfg
cfg_file=/usr/local/nagios/etc/objects/switch.cfg
#cfg_file=/usr/local/nagios/etc/objects/printer.cfg
I may be mistaken, bit it looks like you are missing the hosts.cfg and hostgroups.cfg defined in nagios.cfg?

Code: Select all

cfg_file=/usr/local/nagios/etc/objects/hosts.cfg
cfg_file=/usr/local/nagios/etc/objects/hostgroups.cfg
The names of you files may not be hosts.cfg and hostgroups.cfg, but just replace them with what you have.

For future, you also look to be missing services.cfg (where you define the services for the hosts in hosts.cfg).

Kind Regards,

Gary Shergill

Re: Adding hosts/clients to Nagios Core 3.5(Red Hat 6.4)

Posted: Wed Sep 11, 2013 8:16 am
by ricardowesley
I created a group allhosts in hostgroups.cfg located in /usr/local/nagios/etc/objects.
When I run /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg prior this change... I receive this message
Warning: Duplicate definition found for hostgroup 'linux-servers' (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 46)
Error: Could not add object property in file '/usr/local/nagios/etc/objects/localhost.cfg' on line 47.
Error processing object config files!
Where and I how do I correct this problem?...It is preventing me from moving on.

Re: Adding hosts/clients to Nagios Core 3.5(Red Hat 6.4)

Posted: Wed Sep 11, 2013 11:58 am
by abrist
I bet that the "linux-servers" hostgroup is not only defined in the localhost.cfg file, but also in the hostgroups.cfg file. Remove one of the declarations (probably from the localhost.cfg file) and try to verify once again.

Re: Adding hosts/clients to Nagios Core 3.5(Red Hat 6.4)

Posted: Wed Sep 11, 2013 11:59 am
by slansing
Do you have the hostgroup 'linux-servers' defined multiple times in that configuration file? I'd start by taking the line it told you the issue was revolving around and figure out where and what you need to remove, after each change "such as removing a hostgroup definition" verify your configurations as you did above and eventually you will run out of errors to fix!

Re: Adding hosts/clients to Nagios Core 3.5(Red Hat 6.4)

Posted: Thu Sep 12, 2013 10:39 am
by ricardowesley
Yes, My Nagios web interface is now showing the configured nodes....Thanks