Page 1 of 1
Adding Windows Nagios Target
Posted: Tue Jul 05, 2016 8:07 am
by nagiosnoobin
Hi all,
I am wanting to add a windows server as a Nagios target to be monitored, I would only like to monitor pings from this client. My question is... Is there a way to add a Nagios windows target without using NSClient++. I have been looking around and unable to find any information to add a target in this way.
Any help would be apreciated.
R
Re: Adding Windows Nagios Target
Posted: Tue Jul 05, 2016 9:43 am
by mcapra
nagiosnoobin wrote:I would only like to monitor pings from this client.
You could configure a host to use the default
check-host-alive command as it's check_command. At a bare minimum, your config file might look something like this:
Code: Select all
define host {
host_name <your host name>
use generic-host
alias <your host's alias>
check_command check-host-alive
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
register 1
address <your host's logical address>
register 1
}
So all you're really doing is telling Nagios "please ping this target and let me know if there is substantial packet loss". By default, this command will warn at 80% and critical at 100%:
Code: Select all
define command {
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
}
Re: Adding Windows Nagios Target
Posted: Tue Jul 05, 2016 11:01 am
by nagiosnoobin
Hi mcapra,
To which cfg file would I configure this? I am a true novice at this
Many thanks
R
Re: Adding Windows Nagios Target
Posted: Tue Jul 05, 2016 11:44 am
by rkennedy
You can add this into the configuration file of your liking by adding a line to your /usr/local/nagios/etc/nagios.cfg file. The part that matters is this -
(these are just examples)
Code: Select all
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
cfg_dir=/usr/local/nagios/etc/static
This would allow you to create a file called timeperiods.cfg, and add your configuration in there, or you could also create a directory called static, which will then absorb any .cfg files placed inside of it. That's what's powerful about Core, the choice is yours!