Check_command executing remote python script returns error

This forum was archived to /woltlab and is now in read-only mode.
  • Hello.


    I'm trying to define a service that execute in a windows server a python script. If I execute the python script in a cmd window runs without problems.


    object CheckCommand "DivaInfo" {

    import "plugin-check-command"

    command = [ "E:\\Monitorizacion_DIVA\\test.py" ]

    }


    apply Service "DivaInfo" {

    check_command = "DivaInfo"


    assign where host.vars.client_endpoint == "server"


    }



    This returns this error:

    [2017-07-25 10:59:58 Romance Daylight Time] warning/PluginCheckTask: Check command for object 'server!DivaInfo' (PID: 0, arguments: 'E:\Monitorizacion_DIVA\test.py') terminated with exit code 127, output: Command E:\Monitorizacion_DIVA\test.py failed to execute: 193, "%1 is not a valid Win32 application."



    If we change the script by a Hello_world.py the result is the same.

    #!c:/Python27/python.exe -u

    print "Hello"



    Any idea?


    Thanks in advance.

  • You need to run python.exe with the script as a parameter, something like:


    Code
    1. object CheckCommand "DivaInfo" {
    2. import "plugin-check-command"
    3. command = [ "c:\\python2.7.13\\python.exe", "E:\\Monitorizacion_DIVA\\test.py" ]
    4. }

    Hint: it is a common mistake to put the command and arguments in the same string, so watch out !

  • Hi sru.


    Thank you for your advice. I've added the python.exe in the command and works fine.