External rule

FrancescFrancesc
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

Comments

  • AdministratorAdministrator
    It generates an alert if it receives the expected value. Put as expected value "0"
  • FrancescFrancesc
    Yes, but it seems don't work.



    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
  • AdministratorAdministrator
    A developer will look into this and I will get back to you.
  • FrancescFrancesc
    Thank you very much. I will wait your answer.

    Francesc
  • AdministratorAdministrator
    Here is what you need to do:

    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.


  • FrancescFrancesc
    I test what you say and it doesn't work with my ServersCheck. Take a look:



    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


  • AdministratorAdministrator
    I think it is correct. Execute the batch file and you will see that it replies following:

    --------------------

    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
This discussion has been closed.