Skip to main content
use markdown style code block to format code
Source Link

Not sure how relevant this is, but I saw one small issue in the original script (possibly elsewhere):

In the comparison with top, grep is used to filter out results, but "hardcoded" to mysql, which doesn't seem to be generic... i.e. proc = subprocess.Popen("top -p %s -b -n 1 | grep -w mysql | awk '{print $9}'" % pid, shell=True, stdout=subprocess.PIPE)

proc = subprocess.Popen("top -p %s -b -n 1 | grep -w **mysql** | awk '{print $9}'" % pid, shell=True, stdout=subprocess.PIPE)

I'd suggest replacing "mysql" with the process name that is linked to the PID in question.

Not sure how relevant this is, but I saw one small issue in the original script (possibly elsewhere):

In the comparison with top, grep is used to filter out results, but "hardcoded" to mysql, which doesn't seem to be generic... i.e. proc = subprocess.Popen("top -p %s -b -n 1 | grep -w mysql | awk '{print $9}'" % pid, shell=True, stdout=subprocess.PIPE)

I'd suggest replacing "mysql" with the process name that is linked to the PID in question.

Not sure how relevant this is, but I saw one small issue in the original script (possibly elsewhere):

In the comparison with top, grep is used to filter out results, but "hardcoded" to mysql, which doesn't seem to be generic... i.e.

proc = subprocess.Popen("top -p %s -b -n 1 | grep -w **mysql** | awk '{print $9}'" % pid, shell=True, stdout=subprocess.PIPE)

I'd suggest replacing "mysql" with the process name that is linked to the PID in question.

added 1 character in body
Source Link
Mast
  • 13.8k
  • 12
  • 57
  • 127

notNot sure how relevant this is, but I saw one small issue in the original script (possibly elsewhere).:

In the comparison with top, grep is used to filter out results, but "hardcoded" to mysql, which doesn't seem to be generic... i.e. proc = subprocess.Popen("top -p %s -b -n 1 | grep -w mysql | awk '{print $9}'" % pid, shell=True, stdout=subprocess.PIPE)

i wouldI'd suggest replacing "mysql" with the process name that is linked to pidthe PID in question...

not sure how relevant this is, but I saw one small issue in the original script (possibly elsewhere). In the comparison with top, grep is used to filter out results, but "hardcoded" to mysql, which doesn't seem to be generic... i.e. proc = subprocess.Popen("top -p %s -b -n 1 | grep -w mysql | awk '{print $9}'" % pid, shell=True, stdout=subprocess.PIPE)

i would suggest replacing "mysql" with the process name that is linked to pid in question...

Not sure how relevant this is, but I saw one small issue in the original script (possibly elsewhere):

In the comparison with top, grep is used to filter out results, but "hardcoded" to mysql, which doesn't seem to be generic... i.e. proc = subprocess.Popen("top -p %s -b -n 1 | grep -w mysql | awk '{print $9}'" % pid, shell=True, stdout=subprocess.PIPE)

I'd suggest replacing "mysql" with the process name that is linked to the PID in question.

Source Link

not sure how relevant this is, but I saw one small issue in the original script (possibly elsewhere). In the comparison with top, grep is used to filter out results, but "hardcoded" to mysql, which doesn't seem to be generic... i.e. proc = subprocess.Popen("top -p %s -b -n 1 | grep -w mysql | awk '{print $9}'" % pid, shell=True, stdout=subprocess.PIPE)

i would suggest replacing "mysql" with the process name that is linked to pid in question...