Skip to content

Commit

Permalink
Merge pull request matryer#233 from oliviernt/monitoring
Browse files Browse the repository at this point in the history
Adding process monitoring plugin
  • Loading branch information
keithamus committed Feb 23, 2016
2 parents f9f1f68 + 0969bf6 commit c7022dc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Dev/Monitoring/process-monitoring.1s.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
#
# <bitbar.title>process-monitoring</bitbar.title>
# <bitbar.version>v0.1.0</bitbar.version>
# <bitbar.author>Olivier Tille</bitbar.author>
# <bitbar.author.github>oliviernt</bitbar.author.github>
# <bitbar.desc>Monitors CPU and Memory usage for a certain process</bitbar.desc>
# <bitbar.image>http://i.imgur.com/ApLSN8L.png</bitbar.image>
# <bitbar.dependencies></bitbar.dependencies>
# <bitbar.abouturl>https://github.com/oliviernt/bitbar-plugins/blob/monitoring/Dev/Monitoring/process-monitoring.1s.sh</bitbar.abouturl>

PROCESS="BitBar.app"

id=`ps aux | grep -i "${PROCESS}" | grep -v grep | awk '{print $2}'`
echo -n "${PROCESS}: "
top -l 1 -pid "$id" -stats cpu,mem | tail -1 | awk '{print "CPU: " $1 " - MEM: " $2}'
echo "---"
top -l 1 -pid "$id"

0 comments on commit c7022dc

Please sign in to comment.