Adding perfmon counters using nrpe and centreon

In this little tutorial a detailed description on how to succesfully monitor and add various windows counters using the check_nrpe command and the NSClient++ agent for windows using the Centreon configuration and Monitoring GUI for Nagios. Yup, its all open source, and free for usage…

First Create a Command Definition inside Centreon that looks like this. Naturally alter the globals to fit inside your organisation.

Notice the Argument example, when you test it in this form you might also notice that you get a valid response from the server. Sadly this argument will not work inside the service definition.

Next Create a Service definition that utilizes this check command to check a specific counter. In my example i am using the MSExchange OWA\Total Users counter that is part of the new Exchange 2007 Perfmon counters. It will not work with a older exchange version. Use Perfmon on the destination machine to locate the right counters for your organisation.

Notice the difference in the passed Argument. To make this check command work you need to slightly alter the argument because the application is making the strings “save” when these settings are stored. The result is that some of the characters will be escaped. This can luckly be countered by participating this behavior.

We need the check_nrpe binairy to parse the escaped characters as literals and make centreon believe that we have already escaped the unsafe chars by adding slashes to each present slash, and add a double qoute at the start and the end to make check_nrpe binary parse the argument correctly. The outcome should look somewhat like this.

If this is the counter you want to check, and lets make it chalanging 🙂

\MSExchangeTransport Queues(_total)\Messages Queued For Delivery

Then the service argument for $ARG1$ in my example should look like this inside the Centreon service definition.

!\"\\MSExchangeTransport Queues(_total)\\Messages Queued For Delivery\"!(ARG2)!(ARG3)!

The result will be the following.

I hope this will help you tackle the “Counter” chalanges that Centreon will present when using the NSCLient++ and Check_NRPE commands.

Tools used in this setup

NSClient++ for Windows (32Bit / 64Bit) Using the NRPE option instead of the NS option.

NSClient manual for Check_Counter

NSC.Ini file that we used on our remote machines (do add your nagios server IP to the allowed hosts section)
NSC.ini (Rename it by removing the .doc part or simply copy paste its contence)

Check_nrpe Command.


One thought on “Adding perfmon counters using nrpe and centreon

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s