How to monitor windows services
Subscribe

From OpenNMS

Jump to: navigation, search

Since release 1.3.10 the Win32ServiceMonitor enables OpenNMS to monitor the running state of any Windows service, by simply using SNMP traps (and no additional client). This documentation refers to versions prior to release 1.3.10, anyone using current versions, should refer to the how-to here Win32ServiceMonitor.


One of my main tasks was to implement a monitoring solution for the Windows Servers. Target was the monitoring of all our base services. Here we monitor: Symantec Antivirus, the eventlog service, the Server service, netlogon service, and the Remote procedure call.

Site note: I use the NSClient++; If you plan to use the NSClient or NRPE you might need to change the port property.

Here's how I did it (on 1.3.9):

1. Edit capsd-configuration.xml

<protocol-plugin protocol="NSC-Main-Windows-Services" class-name="org.opennms.netmgt.capsd.plugins.NsclientPlugin" 
 scan="on" user-defined="false">
  <property key="port" value="12489"/>
  <property key="timeout" value="3000"/>
  <property key="retry" value="2"/>
  <property key="command" value="SERVICESTATE"/>
  <property key="parameter" value="Symantec AntiVirus,Eventlog,lanmanserver,Netlogon,RpcSs"/>
</protocol-plugin>

2. Edit poller-configuration.xml

<service name="NSC-Main-Windows-Services" interval="30000" user-defined="false" status="on" >
 <parameter key="port" value="12489"/>
 <parameter key="timeout" value="30000"/>
 <parameter key="retry" value="2"/>
 <parameter key="command" value="SERVICESTATE"/>
 <parameter key="parameter" value="Symantec AntiVirus,Eventlog,lanmanserver,Netlogon,RpcSs"/>
</service>

Keep in mind, that the services name is not the display name in the service itself. You find the name when you double click a service in "services.msc". The Service name is the top-most name.

In addition add for every poller on the bottom of poller-configuration.xml:

<monitor service="NSC-Main-Windows-Services" class-name="org.opennms.netmgt.poller.monitors.NsclientMonitor"/>

3. Restart OpenNMS

Rescan a host to verify that it is working.