Custom test

Need new test, action, option? Post request here.
Post Reply
User avatar
plambrecht
Posts: 151
Joined: Wed May 19, 2004 8:11 am
Location: Belgium
Contact:

Custom test

Post by plambrecht »

Hi,

Still testing Hostmonitor for some features...

Now we can create a Shell/Active script that returns OK/Bad results...
Works great !

expect....

I would like a test that runs a Shell/activescript. That script returns a value (like "scriptval:1024 MB").
Then hostmonitor will have decide of the value is ok or not...
with a simple gt/lt/eq dropbox or a field similar to the advanced alerting feature.

That would greatly expand the possibilities to create own tests...
I have a test that reads the version of a file, and returns it as OK:versionnbr
a BAD is only returned when the file is not found.
Next I have a Alert that checks if the value is < some other value, and send an email when this is the case...
The problem with this setup is that I always get a OK even when the version returned is not a good one.

Hope you get the idea, and see the amazing things that can be done...

regards

Pieter
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Truth to say I don't see sense. Value can be checked in the script. If you want to use the same script for different tests (checking different values), you may use parameters. HostMonitor can pass parameters to the script.

Regards
Alex
User avatar
plambrecht
Posts: 151
Joined: Wed May 19, 2004 8:11 am
Location: Belgium
Contact:

Post by plambrecht »

I can accomplish that within the script, that is correct.
But then, for every new test I make, I have to add the code to check values.
The script wouls get a parameter like : test.vbs "%reply%" "action" "refvalue"
Then I would have to create a 'switch' statement in the script for every possible 'action' (gt, lt, ge, le, eq, ne, ...)

It would be much easier if the checking of the value was done by HM...

I would see it like this : a script is a new test that returns a value, just like all other test just return a value.
Checking if the value that is returned is valid, is done with the setup of the test. (with a dropdownbox with <, >, <=, ... of with an advanced mode like the actions)

Anyone else that has the same view on this ?

Pieter
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Checking if the value that is returned is valid, is done with the setup of the test. (with a dropdownbox with <, >, <=, ... of with an advanced mode like the actions)
It makes test less flexible. Now script's behavior entirely is up to you. May be somebody want to compare file size to current date? Or set status depending on contents of the file while displaying file size? Or... I can invent a lot of examples. Even standard HTTP test may set status that depends on page contents while displaying reply time.
Then I would have to create a 'switch' statement in the script for every possible 'action' (gt, lt, ge, le, eq, ne, ...)
Why? You want to create some super-multipurpose script?

Regards
Alex
User avatar
plambrecht
Posts: 151
Joined: Wed May 19, 2004 8:11 am
Location: Belgium
Contact:

Post by plambrecht »

KS-Soft wrote:Why? You want to create some super-multipurpose script?
Sort of.. My script checks the version of a file (dll, exe, ...), the size of a file, etc.
All values that have to be compared with another value. and then return a bad/ok...

Other option is that you implement these tests... :-?
I wrote these :
- Read file version
- Read file size
- Read file modified date
- Delta (difference in % between Reply and LastReply)

Anyway, if you don't see the purpose, then I'll just add comparison code to those scripts...

Greetz

Pieter
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Yes, I don't want to add this option. I think Script test should be as flexible as possible

Regards
Alex
Post Reply