Configure Nagios to Monitor Remote Windows Host

Share on:

To configure Nagios to monitor a remote Windows host, you’ll need to set up NSClient++ on the Windows Machine. 

 

Install Nagios on the Monitoring Server 

I did it in Install Nagios Core on Oracle Linux 8.5 (OL8.5) post.

 

On the Windows Server

  1. Download NSClient++ using this link Nsclient05.2
  2. For Installing Nsclient++ on the Windows server dot the following steps

Double-click on the installation file

host

 

Choose the generic option

host2

 

Choose the typical option

host3

 

Enter the Nagios server’s IP address and check the (check_nt) option

host4

 

Click install and finish

host5

host6

 

Go to the file C:\Program Files\NSClient++  path edit nsclient.ini file and enable the following Item by changing disabled to enabled or (=1)

host7

CheckExternalScripts = 1 
CheckHelpers = 1 
CheckEventLog = 1 
CheckNSCP = 1 
CheckDisk =1 
CheckSystem = 1

 

Restart the nsclient service on Windows

host8

 

On the Nagios Server

1. In nagios server, edit nagios.cfg file and uncomment windows

host9

 

2. Test whether the Nagios server can monitor the Windows server or not.

##Example: checking the Windows server uptime 
[root@emcl libexec]# ./check_nt -H 192.168.56.4 -p 12489 -v UPTIME 
System Uptime - 0 day(s) 1 hour(s) 27 minute(s) |uptime=87 

##Example: Checking memory used in the Windows server 
[root@emcl libexec]# ./check_nt -H 192.168.56.4 -p 12489 -v MEMUSE 
Memory usage: total:11839.65 MB - used: 1655.86 MB (14%) - free: 10183.79 MB (86%) | 'Memory usage'=1655.86MB;0.00;0.00;0.00;11839.65

 

3. Edit windows.cfg file, and add the new Windows host machine that we want to monitor.

[root@emcl ~]# vi /usr/local/nagios/etc/objects/windows.cfg 

define host { 
use           windows-server      ; Inherit default values from a template 
host_name     WIN-VV69BDNGNH2     ; The name we're giving to this server 
alias         windows-servers     ; A longer name for the server address 192.168.56.4 ; IP 
address       192.168.56.4        ; IP address of Windows remote
} 

define hostgroup { 
hostgroup_name windows-servers ; The name of the hostgroup 
alias Windows Servers ; Long name of the group
} 

define service{ 
use generic-service 
host_name WIN-VV69BDNGNH2 
service_description NSClient++ Version 
check_command check_nt!CLIENTVERSION 
check_interval 1 
max_check_attempts 1 
retry_interval 1 
} 

define service{ 
use generic-service 
host_name WIN-VV69BDNGNH2 
service_description Drive C Disk usage 
check_command check_nt!USEDDISKSPACE!-l C 
check_interval 1 
max_check_attempts 1 
retry_interval 1 
} 

 

Save the file and check if this is working without any errors and restart Nagios service on Nagios Server

[root@emcl etc]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg 
[root@emcl libexec]# systemctl restart nagios

host10

host11

 

Check the Nagios in the browser

host12

Share on:

More from this Author

Configure Nagios to monitor Remote Linux Host

Configure Nagios to monitor Remote Linux Host

To monitor a remote Oracle Linux host using Nagios, we’ll need to install Nagios Plugins and NRPE (Nagios Remote Plugin Executor) on the remote ... Read More

Install Nagios Core on Oracle Linux 8.5 (OL8.5)

Configure Nagios to Monitor Oracle Database on a Remote Linux Host Using CHECK_ORACLE_HEALTH

Monitoring the Oracle Database with Nagios involves using plugins and configurations that allow Nagios to check the status and performance of the ... Read More

Back to Top