Last active
August 29, 2015 14:14
-
-
Save alder/5b70fa57501c2a3abea4 to your computer and use it in GitHub Desktop.
PerfMon EXEC examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Example1: Monitoring Linux cached memory size, used free utility output: | |
/bin/sh:-c:free | grep Mem | awk '{print $7}' | |
#Example2: Monitoring MySQL select query count: | |
/bin/sh:-c:echo "show global status like 'Com_select'" | mysql -u root | awk '$1 =="Com_select" {print $2}' | |
#Example3: Monitoring PostgreSQL CPU usage in percents: | |
/bin/sh:-c:ps aux | grep "postgres" | grep -v "grep" | grep "puser" | awk 'BEGIN {c = 0} {a = $3; c += a} END {print c}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment