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\\

Article Comments

Hello,

I don't think we are going to make a special sensor for this. You might want to check out the EXE/Script Advanced Sensor to use "typeref".

Best Regards.


Mar, 2011 - Permalink

Forgot to mention that I am using this as a "EXE/Script" custom sensor and the cmd file is easy enough to customize if I need to look at a different PerfMon value.


Mar, 2011 - Permalink