I have a CMD file that checks the contents of a PerfMon counter. Any chance that PRTG will incorporate the use of TYPEPERF as a sensor? This would help on those pesky servers that don't want to provide a value via WMI or WQL.
Here's the cmd file contents:
:: GetASPSessions.cmd\\ :: Remote PerfMon Query of ASP Sessions count\\ :: expects a parameter passed, which is the servername\\ :: SYNTAX = GetASPSessions.cmd servername\\ \\ :: Set environment\\ @echo off\\ set COMP=%1\\ \\ :: Check parameter\\ IF [%1]==[] (ECHO Computer name missing! && GOTO:EOF)\\ \\ :: Skip to 2nd line of TYPEPERF output and dump just the value\\ for /f "skip=1 tokens=3 delims=, " %%i in ('typeperf "\ASP.NET State Service\State Server Sessions Active" -sc 1 -s %COMP% ^| find ","') do (set RESULT=%%~i)\\ \\ :: force format value to integer\\ SET /A MODRESULT=RESULT\\ \\ :: Success\\ echo %MODRESULT%:Ok\\ GOTO:EOF\\
Add comment