How to monitor mutiple hosts

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.
Locked
listening723
Posts: 9
Joined: Fri Nov 23, 2012 2:54 am

How to monitor mutiple hosts

Post 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
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: How to monitor mutiple hosts

Post 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 ;) .
listening723
Posts: 9
Joined: Fri Nov 23, 2012 2:54 am

Re: How to monitor mutiple hosts

Post 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.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: How to monitor mutiple hosts

Post 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 ...
}
listening723
Posts: 9
Joined: Fri Nov 23, 2012 2:54 am

Re: How to monitor mutiple hosts

Post 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
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: How to monitor mutiple hosts

Post 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
}
listening723
Posts: 9
Joined: Fri Nov 23, 2012 2:54 am

Re: How to monitor mutiple hosts

Post by listening723 »

Thanks for the help Mr.Murphy
Locked