Adding Windows Nagios Target

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
nagiosnoobin
Posts: 2
Joined: Tue Jul 05, 2016 8:02 am

Adding Windows Nagios Target

Post 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
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Adding Windows Nagios Target

Post 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
}
Former Nagios employee
https://www.mcapra.com/
nagiosnoobin
Posts: 2
Joined: Tue Jul 05, 2016 8:02 am

Re: Adding Windows Nagios Target

Post by nagiosnoobin »

Hi mcapra,

To which cfg file would I configure this? I am a true novice at this :)

Many thanks
R
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Adding Windows Nagios Target

Post 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!
Former Nagios Employee
Locked