Skip to content

Instantly share code, notes, and snippets.

@petersirka
Created December 5, 2016 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petersirka/c47d5cf9b213e5ca6142bbebdf0132cc to your computer and use it in GitHub Desktop.
Save petersirka/c47d5cf9b213e5ca6142bbebdf0132cc to your computer and use it in GitHub Desktop.
const Exec = require('child_process').exec;
var cmd = 'ps aux | grep "mysql" | grep -v "grep" | awk {\'print $2\'}';
Exec(cmd, function(err, response) {
var pid = response.trim();
cmd = 'ps -p {0} -o %cpu,rss,etime'.format(pid);
console.log(cmd);
Exec(cmd, function(err, response) {
console.log('---> POSLAT SIROVI:', arguments);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment