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

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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 Takeoffsammart93
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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.pdfhans926745
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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 FresherRemote DBA Services
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
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 Processorsdebabhi2
 

Recently uploaded (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
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
 

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/