Ad Widget

Collapse

Monitor python or shell script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jcduss59
    Member
    • Jun 2011
    • 33

    #1

    Monitor python or shell script

    Hello,

    On linux, when you run a python or a shell script it runs as

    python myscript.py

    or
    /bin/sh myscript.sh

    how to monitor it with proc.num ???

    the "space" special character seams not to be readen when I set :
    proc.num["python myscript.py"]

    Is there regexp or something like it to test it?
    I don't want to only monitor python or /bin/sh cause it can be another script as myscript.py or myscript.sh which will report false positive.

    Thank you.
  • jcduss59
    Member
    • Jun 2011
    • 33

    #2
    Should have find it :


    proc.num[,,,/bin/sh myscript.sh]

    or

    proc.num[,,,python myscript.py]

    Comment

    • jcduss59
      Member
      • Jun 2011
      • 33

      #3
      Not totally solved...

      It depends on the way it is launched.

      ex: ps aux can retrieve:

      python ./myscript.py
      or
      python /mypathto/myscript.py

      It depends how it as been launched. Is there wildcard to match "/myscript.py" ???

      Comment

      Working...