Created
March 12, 2012 20:44
-
-
Save bdha/2024575 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/bash | |
# | |
# [email protected] | |
# determines if server has cstates enabled or not | |
SERVER=`hostname`; | |
VAR=`/usr/sbin/dtrace -q -n ' | |
fbt:unix:cpupm_next_cstate:entry | |
{ | |
counts++; | |
} | |
profile:::tick-1sec | |
{ | |
exit(0); | |
} | |
dtrace:::END | |
{ | |
printf("%d", counts); | |
} | |
'` | |
if [ "${VAR}" -gt "0" ]; then | |
echo "| ${SERVER} | enabled |"; | |
else | |
echo "| ${SERVER} | disabled |"; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment