External rule
Hello,
I'm having some behaviour in the external rules. I explain:
I have a vbscript file that download a https web in a file, after this I look for a text in this text file and if the code is what I'm waiting, it returns 1. In other case it returns 0.
But it doesn't work.
Then, I've changed the vbs file to the next:
extrau_web.vbs:
wscript.echo "hello"
extrau_web.cmd:
cscript extrau_web.vbs
If I put in the expected value hello Serverscheck says "DOWN".
If I put as expected value a it returns OK.
How should I do this?
Thanks,
Francesc
I'm having some behaviour in the external rules. I explain:
I have a vbscript file that download a https web in a file, after this I look for a text in this text file and if the code is what I'm waiting, it returns 1. In other case it returns 0.
But it doesn't work.
Then, I've changed the vbs file to the next:
extrau_web.vbs:
wscript.echo "hello"
extrau_web.cmd:
cscript extrau_web.vbs
If I put in the expected value hello Serverscheck says "DOWN".
If I put as expected value a it returns OK.
How should I do this?
Thanks,
Francesc
This discussion has been closed.
Comments
Take a look: The vbs script has only this command:
WScript.echo 0
The cmd file contains this command:
cscript extrau_web.vbs
And the field where I put the expected value contains the value 0
If I check this rule, it returns OK. That's right.
But if I put in the expected value 1 or 2 or 3, Servers Check also returns OK.
Then, all values are corrects?????
What is what I'm doing bad?
Greetings,
Francesc
Francesc
1/ The cscript needs to be called from a batch file. For example test.bat
2/ In test.bat enter following:
cd D:Program FilesServersCheck_Monitoringexternal
cscript extrau_web.vbs
It is important to do a CD to your main ServersCheck directory as a service does not run from a specific directory.
The extrau_web.cmd file contains:
cd c:Program FilesServersCheck_Monitoringexternal
cscript extrau_web.vbs
And the extrau_web.vbs contains:
WScript.echo "a"
Then, whet I execute the TEST ALERT I have this behaviour:
- With the expected value a, the test returns STATUS: OK
- With the expected value b, the test returns STATUS: OK
- With the expected value 1, the test returns STATUS: OK
- With the expected value 10, the test returns STATUS: Estatus: DOWN?
Error Retornado: 10 not returned by external check
Could you test this with your system? I think this is not correct.
Francesc
--------------------
D:Program FilesServersCheck_Monitoringexternal>cscript extrau_web.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
a
--------------------
In this output the letter "a" appears, "b" too, "1" too but "10" not