Skip to content

Instantly share code, notes, and snippets.

@joeashcraft
Created December 7, 2015 20:49
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 joeashcraft/258b6cf8b0c01a6c5675 to your computer and use it in GitHub Desktop.
Save joeashcraft/258b6cf8b0c01a6c5675 to your computer and use it in GitHub Desktop.
config file for agent.mysql check with 1 alarm
type : agent.mysql
label : "MySQL Metrics"
disabled : false
period : 60
timeout : 30
details :
username : "raxmon"
password : "password"
alarms:
alarm1:
label: 'Max Connections'
notification_plan_id : npManaged
criteria : |
:set consecutiveCount=3
if( percentage( metric['threads.connected'], metric['max.connections'] ) > 90 ) {
return new AlarmStatus(CRITICAL, "Connection count is greater than 90% of max-connections for 3 minutes");
}
if( percentage( metric['threads.connected'], metric['max.connections'] ) > 80 ) {
return new AlarmStatus(WARNING, "Connection count is greater than 80% of max-connections for 3 minutes");
}
return new AlarmStatus(OK, "Connection count is nominal");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment