Class: MuninManager::Plugins::NotificationClassification
- Inherits:
-
Object
- Object
- MuninManager::Plugins::NotificationClassification
- Includes:
- ActsAsMuninPlugin
- Defined in:
- lib/munin_manager/plugins/notification_classification.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from ActsAsMuninPlugin
Class Method Details
.run ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/munin_manager/plugins/notification_classification.rb', line 17 def self.run allowed_commands = ['config'] if cmd = ARGV[0] and allowed_commands.include? cmd puts new.config else cmd = "mysql -u #{ENV['mysql_user']} --password=#{ENV['mysql_password']} -h #{ENV['host']} -e 'use #{ENV['database']}; select count(*) from notification_classifications where created_at >= \"#{1.hour.ago.to_s(:db)}\";' --skip-column-names --silent" puts "notification_rate.value %s" % `#{cmd}` end end |
Instance Method Details
#config ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/munin_manager/plugins/notification_classification.rb', line 8 def config "graph_title #{ENV['app']} Notification Classification Creation graph_vlabel new classifications / hour notification_rate.label new classifications / hour notification_rate.type derive notification_rate.warning 10 notification_rate.critical 100" end |