monit not invoking python scripts

Issue #1033 resolved
Venkata M created an issue

check file tsttempfile1 with path /temp/file1
if failed checksum then exec "/bin/sh -c ‘/temp/printargs.py -t "svc" -e "evnt" -b "descr"’"

[root@vm-almwebdev01 temp]# monit -V
This is Monit version 5.30.0

Comments (3)

  1. Lutz Mader

    Hello Venkata,
    any additional information about your python script?

    Are you using a proper shebang in the python script, for example

    #!/usr/bin/python

    With regards,
    Lutz

  2. Venkata M reporter

    i added shebang line too, but after adding PATH variable to shell script, it worked for me.
    By default, any process (crontab) which is invoking scripts passing a minimal set of environment variables to your scripts/jobs. To get around that, i set PATH variable at the top of the script after shebang line(interpretor).

  3. Venkata M reporter

    By default, any process (crontab) which is invoking scripts passes a minimal set of environment variables to your scripts/jobs. To get around that, just set your own PATH variable at the top of the script after shebang line(interpretor).

  4. Log in to comment