Page 1 of 2
Adding hosts/clients to Nagios Core 3.5(Red Hat 6.4)
Posted: Thu Sep 05, 2013 1:37 pm
by ricardowesley
I am new to Nagios....I have recently installed nagios core 3.5 w/nrpe plugin on a Red Hat server. It appears that the installation was successful. I am now trying to add some host and clents to prove that it works. My Nagios web interface is up and monitoring itself.
FYI---In my /usr/local/nagios/etc/objects it contains commands, contacts, localhost, printer, templates, timeperiods, and window.cfg. I thought a host.cfg, hostgroups.cfg, addhost, and service would normally be there also.
Simply, how do I add hosts/clients and to which files to this NEW install. examples please!
Re: Adding hosts/clients to Nagios Core 3.5(Red Hat 6.4)
Posted: Thu Sep 05, 2013 2:19 pm
by sreinhardt
Those files are not included by default, as each environment can be vastly different and different administrative techniques can also be applied. You will in need to create each host and service by hand. If this is a large environment, I would highly suggest looking into templating and groups.
http://nagios.sourceforge.net/docs/nagios-3.pdf
http://nagios.sourceforge.net/docs/3_0/quickstart.html
Re: Adding hosts/clients to Nagios Core 3.5(Red Hat 6.4)
Posted: Fri Sep 06, 2013 12:58 pm
by ricardowesley
I created these files populating these according to nagios helps(host.cfg, hostgroups.cfg, addhost, and service.cfg) in the directory. So far, Nagios is not recognizing the nodes(servers, switches, controllers, etc). Suggestions are welcome
Re: Adding hosts/clients to Nagios Core 3.5(Red Hat 6.4)
Posted: Fri Sep 06, 2013 1:51 pm
by slansing
Are you listing multiple hosts in "host.cfg?" If so, it must be named hosts.cfg and the same for services.cfg. If you are using host.cfg for only one host, be sure to title the CFG as the host's name, also, please share the contents of host.cfg if the above is true.
Re: Adding hosts/clients to Nagios Core 3.5(Red Hat 6.4)
Posted: Tue Sep 10, 2013 7:21 am
by ricardowesley
Here are some of entries in my host.cfg file
define host{
use linux-server
host_name Network_DB_Server
hostgroups solaris-servers
parents 1059_Switch
alias drifter
address drifter
}
define host{
use linux-server
host_name paris2
hostgroups solaris-servers
parents 1059_Switch
alias dhcp
address 10.172.13.129
}
define host{
use linux-server
host_name daldc01
hostgroups solaris-servers
parents 1059_Switch
alias domain controller
address 10. 172.14.112
}
define host{
use linux-server
host_name londondc2
hostgroups solaris-servers
parents 1059_Switch
alias domain controller
address 10. 172.15.79
Re: Adding hosts/clients to Nagios Core 3.5(Red Hat 6.4)
Posted: Tue Sep 10, 2013 10:50 am
by slansing
Please run the following and share the output:
Code: Select all
cat /usr/local/nagios/etc/nagios.cfg | grep cfg_file=
I have a sneaking suspicion that the configuration file you are using is named incorrectly. A single configuration file with multiple hosts in it is generally named hosts.cfg by default not host.cfg.
Re: Adding hosts/clients to Nagios Core 3.5(Red Hat 6.4)
Posted: Tue Sep 10, 2013 10:51 am
by sreinhardt
Does your nagios.cfg reference each of these files that you have created, or the folder that they contain? It might be most helpful to just tar the etc directory with all of your configurations and post it for us. Of course feel free to censor IPs and passwords!
Re: Adding hosts/clients to Nagios Core 3.5(Red Hat 6.4)
Posted: Tue Sep 10, 2013 11:06 am
by ricardowesley
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
Re: Adding hosts/clients to Nagios Core 3.5(Red Hat 6.4)
Posted: Tue Sep 10, 2013 1:16 pm
by ricardowesley
My nagios web interface is monitoring a few of my switches. I am now configuring/tweaking my host.cfg file (Windows portion)because when I run(after I modified
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg>>>>I receive
Error: Could not find any hostgroup matching 'allhosts' (config file '/usr/local/nagios/etc/objects/hosts.cfg', starting on line 165)
Error processing object config files!
****I have changed the hostgroup name several times and get the same message above.more.
I have also simultanaeouly change the windows.cfg hostgroups name to match the hosts.cfg and received the error above. suggestions?
Re: Adding hosts/clients to Nagios Core 3.5(Red Hat 6.4)
Posted: Tue Sep 10, 2013 3:11 pm
by abrist
Have you defined the "allhosts" hostgroup? You have declared it as a hostgroup for one of your hosts (line 165), but have you actually defined the hostgroup itself?