Struggling to find the counters to get the status of a service using perfmon. Is it even possible? We need to monitor the status of a service in Nagios but the only remote access avaliable is through Perfmon.

  • 1
    wow only having perfmon is kinda strange, is this a cloud based server? Are you completely sure you don't have wmi access?
    – tony roth
    Oct 25, 2011 at 16:01
  • btw what is the limiting you to perfmon only? Permissions,acls etc
    – tony roth
    Oct 25, 2011 at 19:02
  • @tony if we want to install any new software on the server there is a 6 month testing cycle required, we need these performance counters now and the Windows admins "don't have time" (I'm a UNIX/Oracle Admin, I don't touch Windows with a long pole) Oct 26, 2011 at 10:08
  • wmi does not require anything to be installed its what you need to do this and nagios works perfectly with wmi calls.
    – tony roth
    Oct 27, 2011 at 15:11
  • this should get you started thibault.info/node/2
    – tony roth
    Oct 27, 2011 at 15:13

4 Answers 4


There are no performance counters for services. For a kind of one-shot you could monitor the counters of the process your service is invoking - for example the process' private bytes or the number of threads.

As the process id is going to change on every restart, you would need to adjust your monitoring accordingly. But it will work as a quick & dirty solution unless you have something more robust in place.


The Performance Monitor is used to measure metrics of your machines performance, and not the status of a service.

While I know you're looking to monitor this status in Perfmon, I don't think it's the right tool for you. If you can get into services.msc you can navigate to the "Recovery" tab of that service. From here you can choose how your server reacts to different states that the service may be in. For instance you could choose to restart the service on the first failure, and run a script that e-mails you on the second and third failure of the service, etc.

  • In our situation this wouldn't work, when the service goes down, it causes a lot of other things to break, and simply restarting it won't help. We need to monitor the status in Nagios, and the only remote access we have is Perfmon. These are live servers so we can't install any new software without a 6 month testing cycle and they need this monitoring enabled by next week. Oct 25, 2011 at 13:18
  • 1
    boy somebody really screwed this one up didn't they?
    – tony roth
    Oct 25, 2011 at 19:05

You can fairly easily write powershell scripts (or small C# codelets even) which create custom Windows performance counters. Into these you can input whatever data you choose (like a numeric service status indicator?), at whatever intervall seems adequate, which is handy when perfmon is the only easy way to export data (I had the same bizarre problem once but it was a different monitoring application than Nagios).

Regrettably I am on holiday and only have this measly iphone, so I guess I'll have to return and paste in an example script when I can.

You can quickly and easily google a ton of powershell/C# solutions though, that's how I figured it out when I more or less had to. Still, I guess you'd have to find a way to do it which can slip past that 6 month qa cycle.


For anyone coming across this in the future, you can get a 1/0 status using the following:


(Get-Service MSSQL`$SQLEXPRESS | Where-Object -Property Status -eq Running | Measure).count



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.