SlideShare a Scribd company logo
1 of 16
Download to read offline
Monitoring
A boring topic to most
Me

Ken Robertson

@krobertson

Demandbase

SF

Hiring! (HR made me do it)
DevOps
Sexy Server Talk
Y U NO LIKE?
Metis
Metis
Implements the Nagios NRPE protocol

Ruby daemon

Leverage gems

Simple framework for common stuff

Will add support for test helpers
define :eod do
  execute do
    if Time.now.hour >= 23
      critical("Real close now!")
    elsif Time.now.hour >= 21
      warn("Getting close to the end of the day")
    else
      ok("We're all good")
    end
  end
end
define :eod do
  execute do
    if Time.now.hour >= 23
      critical("Real close now!")
    elsif Time.now.hour >= 21
      warn("Getting close to the end of the day")
    else
      ok("We're all good")
    end
  end
end
define :eod do
  attribute :warning, :default => 21
  attribute :critical, :default => 23
  execute do
    if Time.now.hour >= params[:critical]
      critical("Real close now!")
    elsif Time.now.hour >= params[:warning]
      warn("Getting close to the end of the day")
    else
      ok("We're all good")
    end
  end
end
define :check_mysql_seconds_behind_master do
  attribute :host,     :kind_of => String, :default => ‘127.0.0.1’
  attribute :username, :kind_of => String
  attribute :password, :kind_of => String
  attribute :warning, :kind_of => Fixnum, :default => 20
  attribute :critical, :kind_of => Fixnum, :default => 60
  require_gem 'mysql'

  execute do
    connection = Mysql.new(params[:host], params[:username], params[:password])
    result = connection.query('show slave status')
    seconds = result.fetch_hash['Seconds_Behind_Master'].to_i
    result.free
    connection.close

    critical("We're behind a lot!") if seconds >= params[:critical]
    warn("We're behind some") if seconds >= params[:warning]
    ok
  end
end
define :check_mysql_seconds_behind_master do
  attribute :host,     :kind_of => String, :default => ‘127.0.0.1’
  attribute :username, :kind_of => String
  attribute :password, :kind_of => String
  attribute :warning, :kind_of => Fixnum, :default => 20
  attribute :critical, :kind_of => Fixnum, :default => 60
  require_gem 'mysql'

  execute do
    connection = Mysql.new(params[:host], params[:username], params[:password])
    result = connection.query('show slave status')
    seconds = result.fetch_hash['Seconds_Behind_Master'].to_i
    result.free
    connection.close

    critical("We're behind a lot!") if seconds >= params[:critical]
    warn("We're behind some") if seconds >= params[:warning]
    ok
  end
end
describe :check_mysql_seconds_behind_master do
  include Metis::TestHelpers

  it 'should return critical when very far behind' do
    mysql_result = double('result')
    mysql_result.stub(:fetch_hash).and_return({'Seconds_Behind_Master' => '120'})
    Mysql.any_instance.stub(:query).and_return(mysql_result)

    result = run_monitor(:check_mysql_seconds_behind_master)
    result.status.should == :critical
    result.message.should == "We're behind a lot!"
  end
end




* This isn’t actually implemented yet, but will soon!
Metis
http://github.com/krobertson/metis

gem install metis




photo credit: http://www.flickr.com/photos/mafleen/3295163029/

More Related Content

What's hot

Unity and WebSockets
Unity and WebSocketsUnity and WebSockets
Unity and WebSockets
Josh Glover
 
Websockets talk at Rubyconf Uruguay 2010
Websockets talk at Rubyconf Uruguay 2010Websockets talk at Rubyconf Uruguay 2010
Websockets talk at Rubyconf Uruguay 2010
Ismael Celis
 
Javascript Promises
Javascript PromisesJavascript Promises
Javascript Promises
intive
 

What's hot (20)

Asynchronous Programming FTW! 2 (with AnyEvent)
Asynchronous Programming FTW! 2 (with AnyEvent)Asynchronous Programming FTW! 2 (with AnyEvent)
Asynchronous Programming FTW! 2 (with AnyEvent)
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.eu
 
Clojure@Nuday
Clojure@NudayClojure@Nuday
Clojure@Nuday
 
JavaScript from Scratch: Getting Your Feet Wet
JavaScript from Scratch: Getting Your Feet WetJavaScript from Scratch: Getting Your Feet Wet
JavaScript from Scratch: Getting Your Feet Wet
 
Service worker: discover the next web game changer
Service worker: discover the next web game changerService worker: discover the next web game changer
Service worker: discover the next web game changer
 
Interactive subway map
Interactive subway mapInteractive subway map
Interactive subway map
 
TDC2017 | São Paulo - Trilha Programação Funcional How we figured out we had ...
TDC2017 | São Paulo - Trilha Programação Funcional How we figured out we had ...TDC2017 | São Paulo - Trilha Programação Funcional How we figured out we had ...
TDC2017 | São Paulo - Trilha Programação Funcional How we figured out we had ...
 
$q and Promises in AngularJS
$q and Promises in AngularJS $q and Promises in AngularJS
$q and Promises in AngularJS
 
Unity and WebSockets
Unity and WebSocketsUnity and WebSockets
Unity and WebSockets
 
JavaScript Promise
JavaScript PromiseJavaScript Promise
JavaScript Promise
 
Boot strap.groovy
Boot strap.groovyBoot strap.groovy
Boot strap.groovy
 
Websockets talk at Rubyconf Uruguay 2010
Websockets talk at Rubyconf Uruguay 2010Websockets talk at Rubyconf Uruguay 2010
Websockets talk at Rubyconf Uruguay 2010
 
Server side scripting smack down - Node.js vs PHP
Server side scripting smack down - Node.js vs PHPServer side scripting smack down - Node.js vs PHP
Server side scripting smack down - Node.js vs PHP
 
What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?
 
ES6 is Nigh
ES6 is NighES6 is Nigh
ES6 is Nigh
 
Why Task Queues - ComoRichWeb
Why Task Queues - ComoRichWebWhy Task Queues - ComoRichWeb
Why Task Queues - ComoRichWeb
 
Javascript Promises
Javascript PromisesJavascript Promises
Javascript Promises
 
Start using vagrant now!
Start using vagrant now!Start using vagrant now!
Start using vagrant now!
 
Будь первым
Будь первымБудь первым
Будь первым
 
Jk rubyslava 25
Jk rubyslava 25Jk rubyslava 25
Jk rubyslava 25
 

Viewers also liked

Grade 8 history slideshow ppt
Grade 8 history slideshow   pptGrade 8 history slideshow   ppt
Grade 8 history slideshow ppt
sepllck
 
Gastroesophageal Reflux Disease,
Gastroesophageal Reflux Disease,Gastroesophageal Reflux Disease,
Gastroesophageal Reflux Disease,
000 07
 
Bacterial & Viral Diseases Of The Skin,Mucosa,Eyes
Bacterial & Viral Diseases Of The Skin,Mucosa,EyesBacterial & Viral Diseases Of The Skin,Mucosa,Eyes
Bacterial & Viral Diseases Of The Skin,Mucosa,Eyes
000 07
 

Viewers also liked (20)

Phoenix Metis Presentation
Phoenix Metis PresentationPhoenix Metis Presentation
Phoenix Metis Presentation
 
Grade 8 history slideshow ppt
Grade 8 history slideshow   pptGrade 8 history slideshow   ppt
Grade 8 history slideshow ppt
 
Stories of Resilience Project: Ways of Revealing Métis Resilience
Stories of Resilience Project: Ways of Revealing Métis ResilienceStories of Resilience Project: Ways of Revealing Métis Resilience
Stories of Resilience Project: Ways of Revealing Métis Resilience
 
Bells Palsy Part 2
Bells Palsy Part 2Bells Palsy Part 2
Bells Palsy Part 2
 
Metisrebellionlouisriel 141012042011-conversion-gate02
Metisrebellionlouisriel 141012042011-conversion-gate02Metisrebellionlouisriel 141012042011-conversion-gate02
Metisrebellionlouisriel 141012042011-conversion-gate02
 
Journal of Aboriginal Health, Communities in Crisis
Journal of Aboriginal Health, Communities in CrisisJournal of Aboriginal Health, Communities in Crisis
Journal of Aboriginal Health, Communities in Crisis
 
Riel file insert
Riel file insertRiel file insert
Riel file insert
 
Ear infection treated by an ent specialist
Ear infection treated by an ent specialistEar infection treated by an ent specialist
Ear infection treated by an ent specialist
 
The Metis
The MetisThe Metis
The Metis
 
Gastroesophageal Reflux Disease,
Gastroesophageal Reflux Disease,Gastroesophageal Reflux Disease,
Gastroesophageal Reflux Disease,
 
Staphylococcal Skin Infections
Staphylococcal Skin InfectionsStaphylococcal Skin Infections
Staphylococcal Skin Infections
 
Gerd management guidelines
Gerd management guidelinesGerd management guidelines
Gerd management guidelines
 
Emergencies in ENT
Emergencies in ENTEmergencies in ENT
Emergencies in ENT
 
ENT emergencies
ENT emergenciesENT emergencies
ENT emergencies
 
Skin and Soft tissue infections
Skin and Soft  tissue  infectionsSkin and Soft  tissue  infections
Skin and Soft tissue infections
 
Skin infections
Skin infectionsSkin infections
Skin infections
 
Bacterial & Viral Diseases Of The Skin,Mucosa,Eyes
Bacterial & Viral Diseases Of The Skin,Mucosa,EyesBacterial & Viral Diseases Of The Skin,Mucosa,Eyes
Bacterial & Viral Diseases Of The Skin,Mucosa,Eyes
 
Vasculitis
VasculitisVasculitis
Vasculitis
 
Vasculitis 2015
Vasculitis 2015Vasculitis 2015
Vasculitis 2015
 
Common ENT emergencies
Common ENT emergenciesCommon ENT emergencies
Common ENT emergencies
 

Similar to Metis - RubyConf 2011 Lightning Talk

Getting Started with Couchbase Ruby
Getting Started with Couchbase RubyGetting Started with Couchbase Ruby
Getting Started with Couchbase Ruby
Sergey Avseyev
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
Wesley Beary
 
Linuxday.at - Lightning Talk
Linuxday.at - Lightning TalkLinuxday.at - Lightning Talk
Linuxday.at - Lightning Talk
Jan Gehring
 

Similar to Metis - RubyConf 2011 Lightning Talk (20)

BDD - Behavior Driven Development Webapps mit Groovy Spock und Geb
BDD - Behavior Driven Development Webapps mit Groovy Spock und GebBDD - Behavior Driven Development Webapps mit Groovy Spock und Geb
BDD - Behavior Driven Development Webapps mit Groovy Spock und Geb
 
Getting Started with Couchbase Ruby
Getting Started with Couchbase RubyGetting Started with Couchbase Ruby
Getting Started with Couchbase Ruby
 
Why ruby
Why rubyWhy ruby
Why ruby
 
Django Celery
Django Celery Django Celery
Django Celery
 
CoffeeScript
CoffeeScriptCoffeeScript
CoffeeScript
 
No Callbacks, No Threads - RailsConf 2010
No Callbacks, No Threads - RailsConf 2010No Callbacks, No Threads - RailsConf 2010
No Callbacks, No Threads - RailsConf 2010
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloud
 
Magic of Ruby
Magic of RubyMagic of Ruby
Magic of Ruby
 
Ruby on Rails testing with Rspec
Ruby on Rails testing with RspecRuby on Rails testing with Rspec
Ruby on Rails testing with Rspec
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
 
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksHow to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
 
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksHow to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
 
Puppet @ Seat
Puppet @ SeatPuppet @ Seat
Puppet @ Seat
 
Python Part 2
Python Part 2Python Part 2
Python Part 2
 
Cutting through the fog of cloud
Cutting through the fog of cloudCutting through the fog of cloud
Cutting through the fog of cloud
 
The Ring programming language version 1.10 book - Part 94 of 212
The Ring programming language version 1.10 book - Part 94 of 212The Ring programming language version 1.10 book - Part 94 of 212
The Ring programming language version 1.10 book - Part 94 of 212
 
Linuxday.at - Lightning Talk
Linuxday.at - Lightning TalkLinuxday.at - Lightning Talk
Linuxday.at - Lightning Talk
 
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
 
Ruby Intro {spection}
Ruby Intro {spection}Ruby Intro {spection}
Ruby Intro {spection}
 
Testing in those hard to reach places
Testing in those hard to reach placesTesting in those hard to reach places
Testing in those hard to reach places
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Metis - RubyConf 2011 Lightning Talk

  • 4.
  • 5.
  • 6.
  • 7. Y U NO LIKE?
  • 9. Metis Implements the Nagios NRPE protocol Ruby daemon Leverage gems Simple framework for common stuff Will add support for test helpers
  • 10. define :eod do execute do if Time.now.hour >= 23 critical("Real close now!") elsif Time.now.hour >= 21 warn("Getting close to the end of the day") else ok("We're all good") end end end
  • 11. define :eod do execute do if Time.now.hour >= 23 critical("Real close now!") elsif Time.now.hour >= 21 warn("Getting close to the end of the day") else ok("We're all good") end end end
  • 12. define :eod do attribute :warning, :default => 21 attribute :critical, :default => 23 execute do if Time.now.hour >= params[:critical] critical("Real close now!") elsif Time.now.hour >= params[:warning] warn("Getting close to the end of the day") else ok("We're all good") end end end
  • 13. define :check_mysql_seconds_behind_master do attribute :host, :kind_of => String, :default => ‘127.0.0.1’ attribute :username, :kind_of => String attribute :password, :kind_of => String attribute :warning, :kind_of => Fixnum, :default => 20 attribute :critical, :kind_of => Fixnum, :default => 60 require_gem 'mysql' execute do connection = Mysql.new(params[:host], params[:username], params[:password]) result = connection.query('show slave status') seconds = result.fetch_hash['Seconds_Behind_Master'].to_i result.free connection.close critical("We're behind a lot!") if seconds >= params[:critical] warn("We're behind some") if seconds >= params[:warning] ok end end
  • 14. define :check_mysql_seconds_behind_master do attribute :host, :kind_of => String, :default => ‘127.0.0.1’ attribute :username, :kind_of => String attribute :password, :kind_of => String attribute :warning, :kind_of => Fixnum, :default => 20 attribute :critical, :kind_of => Fixnum, :default => 60 require_gem 'mysql' execute do connection = Mysql.new(params[:host], params[:username], params[:password]) result = connection.query('show slave status') seconds = result.fetch_hash['Seconds_Behind_Master'].to_i result.free connection.close critical("We're behind a lot!") if seconds >= params[:critical] warn("We're behind some") if seconds >= params[:warning] ok end end
  • 15. describe :check_mysql_seconds_behind_master do include Metis::TestHelpers it 'should return critical when very far behind' do mysql_result = double('result') mysql_result.stub(:fetch_hash).and_return({'Seconds_Behind_Master' => '120'}) Mysql.any_instance.stub(:query).and_return(mysql_result) result = run_monitor(:check_mysql_seconds_behind_master) result.status.should == :critical result.message.should == "We're behind a lot!" end end * This isn’t actually implemented yet, but will soon!
  • 16. Metis http://github.com/krobertson/metis gem install metis photo credit: http://www.flickr.com/photos/mafleen/3295163029/