Skip to content

Instantly share code, notes, and snippets.

@bdha
Created March 12, 2012 20:44
Show Gist options
  • Save bdha/2024575 to your computer and use it in GitHub Desktop.
Save bdha/2024575 to your computer and use it in GitHub Desktop.
#!/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