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
how to retrieve the result of a perl script ?
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
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
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
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
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
You may use "advanced mode" actions: http://www.ks-soft.net/hostmon.eng/mfra ... ncedactionpgobat 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
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)
Code: Select all
('%Status%'=='Warning') and (%Recurrences%==1)
Max