MS KB281884 and Process Test

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
toppy
Posts: 8
Joined: Wed Mar 05, 2008 2:48 am
Location: Israel

MS KB281884 and Process Test

Post by toppy »

Hello,
After applying KB281884 (http://support.microsoft.com/kb/281884) my tests taht use test method "process" that counted if I have less than 1 process perl and sent a message started to fail.

When I checked it I saw that the name it sees now is perl_2543 (2543 is the PID) so now I don't have the abbility to count the process, because it's name is changed.

Is there a way to use wildcards in the process name?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

So, you have set ProcessNameFormat to 2, right? Hm. "Process" test method will not work with such a process names.
As a woprkaround, you may use "Shell Script" test method, I think: http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell

For instance, you may use script below to check number of processes and fire alert when the number of processes is less than specified value:

Code: Select all

@echo off

if "%1"=="" (
   echo ScriptRes:Unknown:Process name is required
   goto end
)

if "%2"=="" (
   echo ScriptRes:Unknown:Process threshold is required
   goto end
)


FOR /F "tokens=* delims=" %%A IN ('tasklist ^| find /c "%1"') DO SET proc_count=%%A 

IF %proc_count% LSS %2 (
   echo ScriptRes:Ok:%proc_count%
) ELSE (
   echo ScriptRes:Bad:%proc_count%
)

:end
Script requires two parameters:
1. Process name or part of the name
2. Numer to compare with

For instance, to check if you have less than 1 perl_ process, you should use parameters like these:

Code: Select all

perl_ 1
Regards,
Max
toppy
Posts: 8
Joined: Wed Mar 05, 2008 2:48 am
Location: Israel

It works. thanks

Post by toppy »

It works. thanks.
:D
Post Reply