Nagios NSClient++ Monitor Windows Services

Scenario / Question:

How do I monitor Windows Services and Processes using check_nt and Nagios NSClient++

Solution / Answer:

Use the check_nt command with the SERVICESTATE and PROCSTATE variables.

Install and Configure Nagios NSClient++ as per the following tutorial:

Nagios NSClient++ to Monitor Remote Windows Server

Edit windows.cfg object file to add services to monitor

On the Nagios Server edit the file /usr/local/nagios/etc/objects/windows.cfg:

# vi /usr/local/nagios/etc/objects/windows.cfg

Add the following to create a new service definition to monitor the process state of WinVNC.exe (VNC Server):

# Create a service for monitoring the WinVNC.exe process
# Change the host_name to match the name of the host you defined above

define service{
        use                     generic-service
        hostgroup_name          windows-servers
        service_description     VNC
        check_command           check_nt!PROCSTATE!-d SHOWALL -l WinVNC.exe
        }

Add the following to create a new service definition to monitor the Service state of the Print Spooler service:

define service{
        use                     generic-service
        hostgroup_name          windows-servers
        service_description     eTrust ITM Web Access Service
        check_command           check_nt!SERVICESTATE!-d SHOWALL -l "Print Spooler"
        }

To monitor a Service other then the Print Spooler, substitute Print Spooler with how the Name of the service appears in the Services window Name column

Windows_Services

Windows_Services

.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
Fabio Milano has written 79 articles for us. Fabio Milano is a certified RHCE, MCP, and CFOI. He runs an IT consulting and services company called RDS Support inc. Website:http://www.rdssupport.com
The information provided is for educational purposes only. All content including links and comments is provided "as is" with no warranty, expressed or implied. Use is at your own risk and you are solely responsible for what you do with it.

3 Comments so far

  1. Tt on January 5th, 2011

    ttt

  2. [...]   Nagios NSClient++ Monitor Windows Services [...]

  3. C on May 6th, 2011

    This isn’t *actually* monitoring the print spooler. Its monitoring the service. So unless all you need to know is if the print spooler is running/not running, this is useless.

Leave a reply