Page 1 of 1

How to monitor mutiple hosts

Posted: Fri Nov 23, 2012 3:34 am
by listening723
Hi Everyone

Am new to nagios. I have installed nagios in centos 5 where I have successfully installed it and able to configure and monitor a single host(Eg: single Host). My local area network consists of 15 servers and client computer. where I wish to monitor all the devices. But I have no knowledge how to configure windows.cfg file inorder to monitor all hosts in nagios. I have tried to configure using nagios 3.pdf but unable to do it. Need help to resolve this issue

Re: How to monitor mutiple hosts

Posted: Sun Nov 25, 2012 7:44 pm
by jsmurphy
Are you just not sure how to configure a host? Or are you experiencing errors when you try?

Are you able to provide us an example of how you are trying to configure it, that might be a good starting point. "How to configure windows" in Nagios is sort of a small book... I mean the beginners section in the documentation isn't exactly tiny so any explanation here would have to be equally as long.

Help us narrow it down to some specific issues and we can probably provide much better assistance ;) .

Re: How to monitor mutiple hosts

Posted: Tue Nov 27, 2012 2:21 pm
by listening723
I have configured the nagios for a single host but when am trying to configure the same for multiple hosts I am unable to do it. I have followed nagios_3.pdf document and gone through few configurations in tips and tricks page and the configured the following things in the windows.cfg file.

define host{
use windows-server ; Inherit default values from a template
host_name ERMS8-HP ; The name we're giving to this host
alias My Windows Server ; A longer name associated with the host
address 192.168.10.223 ; IP address of the host
}


----------------------------------------------------------------------


define service{
use generic-service
host_name ERMS8-HP
service_description NSClient++ Version
check_command check_nt!CLIENTVERSION
}

you can notice ERMS8-HP it was the first host which i have configured in windows.cfg which i can montior fine but when am trying to do the same for configuring mutiple hosts am unable to do it. After saving the edited configuration file with new lines below which i have mentioned


define host{
use windows-server ; Inherit default values from a template
host_name ERMS8-HP ; The name we're giving to this host
alias My Windows Server ; A longer name associated with the host
address 192.168.10.223 ; IP address of the host
}
define host{
use windows-server ; Inherit default values from a template
host_name ERMS9-HP ; The name we're giving to this host
alias My Windows Server ; A longer name associated with the host
address 192.168.10.118 ; IP address of the host
}


-----------------------------------------------------------------


define service{
use generic-service
host_name HOST1,HOST2,HOST3...HOSTN
service_description SOMESERVICE
other service directives ...
}


define service{
use generic-service
host_name ERMS8-HP
service_description NSClient++ Version
check_command check_nt!CLIENTVERSION
}

After this I have saved the windows.cfg and when am trying to restart nagios service following error message is been noticed and I could not able to monitor multiple hosts.

[root@centos Admin]# /etc/rc.d/init.d/nagios restart
Running configuration check... CONFIG ERROR! Restart aborted. Check your Nagios configuration.

Re: How to monitor mutiple hosts

Posted: Tue Nov 27, 2012 4:08 pm
by jsmurphy
Can you run the following and post it?

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
You should pretty much always run the verification before restarting Nagios after making a configuration change. It will tell you exactly what the errors are or if there even are any errors.

I'm assuming you didn't literally add this?
define service{
use generic-service
host_name HOST1,HOST2,HOST3...HOSTN
service_description SOMESERVICE
other service directives ...
}

Re: How to monitor mutiple hosts

Posted: Tue Nov 27, 2012 10:12 pm
by listening723
Mr.Murphy can you help me to configure mutiple hosts in nagios. Let me know which configuration files should be used to configure and what are the contents that I need to edit inorder to get the result

Re: How to monitor mutiple hosts

Posted: Wed Nov 28, 2012 7:24 pm
by jsmurphy
If that's really all the information you desire then...

windows.cfg
define host{
use windows-server ; Inherit default values from a template
host_name ERMS8-HP ; The name we're giving to this host
alias My Windows Server ; A longer name associated with the host
address 192.168.10.223 ; IP address of the host
}

define host{
use windows-server ; Inherit default values from a template
host_name ERMS9-HP ; The name we're giving to this host
alias My Windows Server ; A longer name associated with the host
address 192.168.10.118 ; IP address of the host
}
services.cfg
define service{
use generic-service
host_name ERMS8-HP, ERMS9-HP
service_description NSClient++ Version
check_command check_nt!CLIENTVERSION
}

Re: How to monitor mutiple hosts

Posted: Sat Dec 01, 2012 2:48 pm
by listening723
Thanks for the help Mr.Murphy