how to retrieve the result of a perl script ?

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
pgobat
Posts: 22
Joined: Tue Nov 25, 2008 9:22 am

how to retrieve the result of a perl script ?

Post by pgobat »

Hello everybody
May be it is a question from a newbe but :

I have some perl script used with another monitoring tools.
I had like to reuse them with Host Monitor but i don't know how to give the result of the script to Hostmonitor....

I have seen that there are templates for jscript and vbscript ...
Has anyone some experience about that ?

Would be nice

Best Regards
Philippe
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

You may use Shell Script test method to launch your script.
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell

You need to modify your scipt a little - it should write to stdout (standard output stream) single result string. This string should contain 3 parts separated by colon:
- First obligatory part is a marker "scriptres". It tells to HostMonitor or RMA that this string is the result string.
- Second obligatory part represents the test status, it can take one of the following values (case insensitive)
Host is alive
No answer
Unknown
Unknown host
Ok
Bad
Bad contents

- Third optional part contains Reply value, HostMonitor displays this value in Reply field, writes to log files, uses to displays charts (Log Analyzer), etc.

Several examples:
scriptres:Host is alive:1000 ms
scriptres:Unknown host:
scriptres:Ok:300 Kb


Please check the manual for more detailed information. If you are using latest version of HostMonitor, read the pages 98, 102-106
Printable manual in MS Word format located in the same folder where HostMonitor is installed (manual.doc file)

Regards
Alex
pgobat
Posts: 22
Joined: Tue Nov 25, 2008 9:22 am

Post by pgobat »

Thank you very much

It is allright but i see another solution to find

I recieve for instance 3 stauts from my script

Green -> ok
Red -> bad
Yellow which is a warning : i can for instance say that yellow is bad content

but i have a problem for sending the alarm after....

As using the shell script test , i would send 2 kind of alarm
red > directly on the pager of the maintenance engeener
yellow > an email to the hotline

Anyone think it is possible to do so ?

Best regards

Philippe
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

pgobat wrote:As using the shell script test , i would send 2 kind of alarm
red > directly on the pager of the maintenance engeener
yellow > an email to the hotline
You may use "advanced mode" actions: http://www.ks-soft.net/hostmon.eng/mfra ... ncedaction
Advanced mode allows you to use logical expression as a condition that triggers the alert action. An alert action is performed when a logical expression of a condition is true. For instance, you may use following expression for "Bad" status:

Code: Select all

('%Status%'=='Bad') and  (%Recurrences%==1) 
For the warning status you may use following:

Code: Select all

('%Status%'=='Warning') and  (%Recurrences%==1) 
Regards,
Max
Post Reply