• LOGIN
  • No products in the cart.

DevOps on AWS – Python Scripts 11 : Process Info

processInfo.py


import commands, os, string

program = raw_input(“Enter the name of the program to check: “)

try:
    #perform a ps command and assign results to a list
    output = commands.getoutput(“ps -f|grep ” + program)
    proginfo = string.split(output)

    #display results
    print “n
    Full path:tt”, proginfo[5], “n
    Owner:ttt”, proginfo[0], “n
    Process ID:tt”, proginfo[1], “n
    Parent process ID:t”, proginfo[2], “n
    Time started:tt”, proginfo[4]
except:
    print “There was a problem with the program.”

February 22, 2021

0 responses on "DevOps on AWS - Python Scripts 11 : Process Info"

    All rights reserved.
    error: Alert: Content is protected !!
    X