• 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

Contact Address

Rise ‘n’ Shine Technologies:
Third Floor, Plot No1(Part), near KPHB Metro Station, KPHB Bagyanagar Colony, Kukatpally Main road, Balanagar Mandal, Rangareddy Dist-500072

Landmarks : Above VIOLET & PURPLE, near PJR statue, kphb metro station

  8686 98 8042
rnstech.fmw@gmail.com

Location

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