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

Asynchronous Programming FTW! 2 (with AnyEvent)
Asynchronous Programming FTW! 2 (with AnyEvent)Asynchronous Programming FTW! 2 (with AnyEvent)
Asynchronous Programming FTW! 2 (with AnyEvent)xSawyer
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.euFredrik Wendt
 
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 WetMichael Girouard
 
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 changerSandro Paganotti
 
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 ...tdc-globalcode
 
$q and Promises in AngularJS
$q and Promises in AngularJS $q and Promises in AngularJS
$q and Promises in AngularJS a_sharif
 
Unity and WebSockets
Unity and WebSocketsUnity and WebSockets
Unity and WebSocketsJosh Glover
 
Websockets talk at Rubyconf Uruguay 2010
Websockets talk at Rubyconf Uruguay 2010Websockets talk at Rubyconf Uruguay 2010
Websockets talk at Rubyconf Uruguay 2010Ismael Celis
 
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 PHPMarc Gear
 
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?Christophe Porteneuve
 
Why Task Queues - ComoRichWeb
Why Task Queues - ComoRichWebWhy Task Queues - ComoRichWeb
Why Task Queues - ComoRichWebBryan Helmig
 
Javascript Promises
Javascript PromisesJavascript Promises
Javascript Promisesintive
 
Будь первым
Будь первымБудь первым
Будь первымFDConf
 

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 pptsepllck
 
Bells Palsy Part 2
Bells Palsy Part 2Bells Palsy Part 2
Bells Palsy Part 2lemonandie
 
Metisrebellionlouisriel 141012042011-conversion-gate02
Metisrebellionlouisriel 141012042011-conversion-gate02Metisrebellionlouisriel 141012042011-conversion-gate02
Metisrebellionlouisriel 141012042011-conversion-gate02Carmen Boniferro
 
Riel file insert
Riel file insertRiel file insert
Riel file insertjukgun
 
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 specialistdrsniffles1
 
The Metis
The MetisThe Metis
The Metistara_4
 
Gastroesophageal Reflux Disease,
Gastroesophageal Reflux Disease,Gastroesophageal Reflux Disease,
Gastroesophageal Reflux Disease,000 07
 
Staphylococcal Skin Infections
Staphylococcal Skin InfectionsStaphylococcal Skin Infections
Staphylococcal Skin InfectionsArcha Dave
 
Gerd management guidelines
Gerd management guidelinesGerd management guidelines
Gerd management guidelinesunichi
 
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,Eyes000 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

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 GebChristian Baranowski
 
Getting Started with Couchbase Ruby
Getting Started with Couchbase RubyGetting Started with Couchbase Ruby
Getting Started with Couchbase RubySergey Avseyev
 
No Callbacks, No Threads - RailsConf 2010
No Callbacks, No Threads - RailsConf 2010No Callbacks, No Threads - RailsConf 2010
No Callbacks, No Threads - RailsConf 2010Ilya Grigorik
 
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 CloudWesley Beary
 
Ruby on Rails testing with Rspec
Ruby on Rails testing with RspecRuby on Rails testing with Rspec
Ruby on Rails testing with RspecBunlong Van
 
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
 
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 ClicksPuppet
 
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 ClicksCarlos Sanchez
 
Cutting through the fog of cloud
Cutting through the fog of cloudCutting through the fog of cloud
Cutting through the fog of cloudKyle Rames
 
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 212Mahmoud Samir Fayed
 
Linuxday.at - Lightning Talk
Linuxday.at - Lightning TalkLinuxday.at - Lightning Talk
Linuxday.at - Lightning TalkJan Gehring
 
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)err
 
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 placesdn
 

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

Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

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/