Monitoring Microsoft performance counters Using the “check_nrpe” plugin we can use Opsview to monitor Microsoft “Performance counters”, which are part of most Microsoft software.

In our example, we are going to monitor performance counters built into Microsoft Exchange 2010.

To do this, we must first search for which counters we wish to monitor  - they will be similar to this example: “\MSExchangeIS Mailbox(_Total)\Messages Queued for Submission” found from the link here.


In this example scenario, we are monitoring performance counters for Microsoft Exchange 2010, which is installed on a Windows Server 2008 system with the Opsview agent pre-installed, and the host already added to the Opsview monitoring system.

After finding the counters we wish to add, we will need to create our new service check(s) to apply to our pre-configured Microsoft Exchange host on our Opsview server.

To do this, navigate to “SETTINGS -> SERVICE CHECKS” and click on the green plus icon in the top left and fill the template out as normal, i.e. name/description, etc. Now, the crux of this article. In the plugins drop down, choose “check_nrpe” and then in the arguments field, enter the following:

-H $HOSTADDRESS$ -c nsc_checkcounter -a '"\\MSExchangeIS Mailbox(_Total)\\Messages Queued for Submission" MaxWarn=10 MaxCrit=50 ShowAll'

NB: Please note, the counter name is wrapped in double quotation marks, and the whole string after “-a” is wrapped in single quotation marks.

Another very important note regarding a known issue, (this will trip up most people), due to the special character handling done in the service check arguments box, we need to enter DOUBLE back slashes. So in the counter, it may be “…(_Total)\Messages…” but we need to enter “…(_Total)\\Messages”, in order for Opsview to run it correctly. Otherwise it will complain about not being able to find that counter. If you run it from the CLI however, it will work with single backslashes as there is no special character handling done in bash.

Once you have added the arguments, click “SUBMIT” and your new service check will be available like so:

monitoring performance counters

Now we need to apply the service check to our Exchange server. To do this, navigate to “SETTINGS > HOSTS” and click on the Exchange host. Then, we need to navigate to “MONITORS” and select our new service check, as below:

monitoring microsoft performance counters

Finally, we need to click “SUBMIT” at the bottom of the page, and then apply our new service check via “SETTINGS > APPLY CHANGES” and click “RELOAD CONFIGURATION”.

Once this is done, our new service check is up and running against our Exchange server, as below:

monitoring Microsoft performance counters

We are also monitoring “messages queued for submission” too, along with many other counters for Exchange, however the counters can be taken from any Microsoft application which utilises them.