SlideShare a Scribd company logo
1 of 29
Monitoring the Physical World 
with Nagios and Arduino 
Trevor McDonald 
tmcdonald@nagios.com 
http://github.com/tmcnag
Who Am I? 
● Support Tech at Nagios Enterprises 
– tmcdonald on Support Forum 
– Docs, Bugs, Testing, PPeerrll 
● Other Things I Do: 
– World Languages 
– Computer Security 
– Electronics
Who Am I Not? 
● Affiliated with Arduino 
– Not being paid to advertise 
– All images copyright their respective owners 
– <Legal disclaimer here> 
● Iron Man
Who Am I Not? 
● Affiliated with Arduino 
– Not being paid to advertise 
– All images copyright their respective owners 
– <Legal disclaimer here> 
● Iron Man (yet)
What's This Talk About? 
● Physical Monitors: 
– Temperature 
– Humidity 
– Light 
– Motion 
– Open/Close of Doors/Windows
How Do We Do That? 
● Existing Solutions: 
– Closed-source 
– Limited scope 
– Expensive* ($1,000+) 
● Arduino: 
– 100% open-source 
– Customizable 
– Cheap ($5 to $50)
What is Arduino? 
● Arduino Uno 
– 8-bit Microprocessor 
– 32K Flash Memory 
– 2K RAM 
– 16 MHz Clock Speed 
– Runs on 5V 
– 14 Digital + 6 Analog I/O Pins
Assumptions 
● You know a bit of C/C++ 
● You understand passive checks (NRDP) 
● You understand the following: 
– Flip switch up, light goes on 
– Flip switch down, light goes off 
– AKA “Digital logic”
How Does It Work? 
● Hardware is attached to pins 
● Each I/O pin either reads or writes data 
– Reading might detect if a button is pressed 
– Writing could turn on a LED or motor 
● Pins can be configured for either task 
● Regular C code is used to control pins 
and handle program logic
A Simple Blink 
● [ Picture of LED breadboard ]
A Simple Blink 
● [ Example Blink sketch ]
A Simple Blink
Button Press
Button Press
Button Press
The Missing Link 
● We're able to... 
– Read the state of a button/switch 
– Take action accordingly (light an LED) 
● We want to... 
– Send passive results to Nagios 
● So we need... 
– Networking capability (HTTP for NRDP)
Arduino Shields 
● Stack on top of and expand an Arduino 
– Relay shield for high-powered device control 
– MP3 shield for adding quality audio output 
– LCD + buttons shield for a basic UI 
– Ethernet shield for network connectivity 
● Relatively cheap ($30 to $60 on average) 
● Save on RAM, CPU, code, and time
Ethernet Shield
Introducing Nagduino 
● C++ “library” I built to facilitate NRDP calls 
– No NSCA (not enough RAM for crypto) 
– No SNMP Traps (not enough patience) 
● Very small, very simple code 
– 6 lines to get you going 
● Bells + whistles not included 
– No checking NRDP result 
– Debug code? What debug code?
Putting It All Together 
● Magnetic sensor attached to input 
● Arduino checks sensor on a loop 
● If open, send NRDP Critical to Nagios 
– “Latch” to avoid repeat messages 
● If closed, do nothing and loop 
– Reset latch, re-check every 100ms 
● Alert based on preferences/settings
The Hardware
The Code
The Code
Live Demo
Tying In With Nagios 
● Graphing 
– View historical information 
– Capacity planning (XI) 
– Use multistacked graphs for correlations (XI) 
● Physical Event Handlers 
– Turn on fan if temp is Warning 
– Turn on AC if temp is Critical
Use Cases 
● Applications in: 
– Farming (soil moisture, temp, light) 
– Security (light, motion, sound, contacts) 
– Home Automation (temp, light, infrared LED) 
– Beekeeping (Talk to Sally Reich)
Moving Forward 
● Support for NSCA + SNMP Traps 
● Web interface (CCM for Arduino checks) 
● Beyond Arduino 
– Raspberry Pi (I'm looking at you, Dave) 
– Smartphone (Mobile environment readings) 
– Intel Edison (Very cool)
Questions? 
Thank You!
The End 
Trevor McDonald 
tmcdonald@nagios.com 
http://github.com/tmcnag

More Related Content

Similar to Monitoring Physical World with Arduino & Nagios

Proactive monitoring tools or services - Open Source
Proactive monitoring tools or services - Open Source Proactive monitoring tools or services - Open Source
Proactive monitoring tools or services - Open Source B.A.
 
Ake hedman why we need to unite and why vscp is a solution to a problem
Ake hedman  why we need to unite and why vscp is a solution to a problemAke hedman  why we need to unite and why vscp is a solution to a problem
Ake hedman why we need to unite and why vscp is a solution to a problemWithTheBest
 
Iot with-the-best & VSCP
Iot with-the-best & VSCPIot with-the-best & VSCP
Iot with-the-best & VSCPAke Hedman
 
IPLOG? A beginner's IDS for the WIN!
IPLOG? A beginner's IDS for the WIN!IPLOG? A beginner's IDS for the WIN!
IPLOG? A beginner's IDS for the WIN!Nathan Gibbs
 
Introduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingIntroduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingEmmanuel Obot
 
Getting started with arduino
Getting started with arduinoGetting started with arduino
Getting started with arduinoGlen
 
OSMC 2014: Naemon 1, 2, 3, N | Andreas Ericsson
OSMC 2014: Naemon 1, 2, 3, N | Andreas EricssonOSMC 2014: Naemon 1, 2, 3, N | Andreas Ericsson
OSMC 2014: Naemon 1, 2, 3, N | Andreas EricssonNETWAYS
 
Ple18 web-security-david-busby
Ple18 web-security-david-busbyPle18 web-security-david-busby
Ple18 web-security-david-busbyDavid Busby, CISSP
 
Intro to the Arduino Entrepreneurial System
Intro to the Arduino Entrepreneurial SystemIntro to the Arduino Entrepreneurial System
Intro to the Arduino Entrepreneurial Systemtodbotdotcom
 
arduino introduction for vocational students
arduino introduction for vocational studentsarduino introduction for vocational students
arduino introduction for vocational studentsanggalima5
 
Porte à puce - Automatic Door based on Arduino UNO R3
Porte à puce - Automatic Door based on Arduino UNO R3Porte à puce - Automatic Door based on Arduino UNO R3
Porte à puce - Automatic Door based on Arduino UNO R3Meifani Sumadijaya
 
Arduino Intro Guide 2
Arduino Intro Guide 2Arduino Intro Guide 2
Arduino Intro Guide 2elketeaches
 
IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...
IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...
IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...David Fowler
 

Similar to Monitoring Physical World with Arduino & Nagios (20)

Proactive monitoring tools or services - Open Source
Proactive monitoring tools or services - Open Source Proactive monitoring tools or services - Open Source
Proactive monitoring tools or services - Open Source
 
Ake hedman why we need to unite and why vscp is a solution to a problem
Ake hedman  why we need to unite and why vscp is a solution to a problemAke hedman  why we need to unite and why vscp is a solution to a problem
Ake hedman why we need to unite and why vscp is a solution to a problem
 
Iot with-the-best & VSCP
Iot with-the-best & VSCPIot with-the-best & VSCP
Iot with-the-best & VSCP
 
IPLOG? A beginner's IDS for the WIN!
IPLOG? A beginner's IDS for the WIN!IPLOG? A beginner's IDS for the WIN!
IPLOG? A beginner's IDS for the WIN!
 
Introduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingIntroduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and Programming
 
Getting started with arduino
Getting started with arduinoGetting started with arduino
Getting started with arduino
 
OSMC 2014: Naemon 1, 2, 3, N | Andreas Ericsson
OSMC 2014: Naemon 1, 2, 3, N | Andreas EricssonOSMC 2014: Naemon 1, 2, 3, N | Andreas Ericsson
OSMC 2014: Naemon 1, 2, 3, N | Andreas Ericsson
 
Ple18 web-security-david-busby
Ple18 web-security-david-busbyPle18 web-security-david-busby
Ple18 web-security-david-busby
 
Audible Objects
Audible ObjectsAudible Objects
Audible Objects
 
Let's begin io t with $10
Let's begin io t with $10Let's begin io t with $10
Let's begin io t with $10
 
Arduino
ArduinoArduino
Arduino
 
Intro to the Arduino Entrepreneurial System
Intro to the Arduino Entrepreneurial SystemIntro to the Arduino Entrepreneurial System
Intro to the Arduino Entrepreneurial System
 
arduino introduction for vocational students
arduino introduction for vocational studentsarduino introduction for vocational students
arduino introduction for vocational students
 
Internet of things
Internet of thingsInternet of things
Internet of things
 
Arduino Hands-on Workshop
Arduino Hands-on WorkshopArduino Hands-on Workshop
Arduino Hands-on Workshop
 
Porte à puce
Porte à pucePorte à puce
Porte à puce
 
Porte à puce - Automatic Door based on Arduino UNO R3
Porte à puce - Automatic Door based on Arduino UNO R3Porte à puce - Automatic Door based on Arduino UNO R3
Porte à puce - Automatic Door based on Arduino UNO R3
 
Porte à puce
Porte à pucePorte à puce
Porte à puce
 
Arduino Intro Guide 2
Arduino Intro Guide 2Arduino Intro Guide 2
Arduino Intro Guide 2
 
IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...
IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...
IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...
 

More from Nagios

Nagios XI Best Practices
Nagios XI Best PracticesNagios XI Best Practices
Nagios XI Best PracticesNagios
 
Jesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture OverviewJesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture OverviewNagios
 
Trevor McDonald - Nagios XI Under The Hood
Trevor McDonald  - Nagios XI Under The HoodTrevor McDonald  - Nagios XI Under The Hood
Trevor McDonald - Nagios XI Under The HoodNagios
 
Sean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient NotificationsSean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient NotificationsNagios
 
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise Edition
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise EditionMarcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise Edition
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise EditionNagios
 
Janice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios PluginsJanice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios PluginsNagios
 
Dave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical ExperienceDave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical ExperienceNagios
 
Mike Weber - Nagios and Group Deployment of Service Checks
Mike Weber - Nagios and Group Deployment of Service ChecksMike Weber - Nagios and Group Deployment of Service Checks
Mike Weber - Nagios and Group Deployment of Service ChecksNagios
 
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios InstallationMike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios InstallationNagios
 
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...Nagios
 
Matt Bruzek - Monitoring Your Public Cloud With Nagios
Matt Bruzek - Monitoring Your Public Cloud With NagiosMatt Bruzek - Monitoring Your Public Cloud With Nagios
Matt Bruzek - Monitoring Your Public Cloud With NagiosNagios
 
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.Nagios
 
Eric Loyd - Fractal Nagios
Eric Loyd - Fractal NagiosEric Loyd - Fractal Nagios
Eric Loyd - Fractal NagiosNagios
 
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...Nagios
 
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...Nagios
 
Nagios World Conference 2015 - Scott Wilkerson Opening
Nagios World Conference 2015 - Scott Wilkerson OpeningNagios World Conference 2015 - Scott Wilkerson Opening
Nagios World Conference 2015 - Scott Wilkerson OpeningNagios
 
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNagios
 
Nagios Log Server - Features
Nagios Log Server - FeaturesNagios Log Server - Features
Nagios Log Server - FeaturesNagios
 
Nagios Network Analyzer - Features
Nagios Network Analyzer - FeaturesNagios Network Analyzer - Features
Nagios Network Analyzer - FeaturesNagios
 
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing NagiosNagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing NagiosNagios
 

More from Nagios (20)

Nagios XI Best Practices
Nagios XI Best PracticesNagios XI Best Practices
Nagios XI Best Practices
 
Jesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture OverviewJesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture Overview
 
Trevor McDonald - Nagios XI Under The Hood
Trevor McDonald  - Nagios XI Under The HoodTrevor McDonald  - Nagios XI Under The Hood
Trevor McDonald - Nagios XI Under The Hood
 
Sean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient NotificationsSean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient Notifications
 
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise Edition
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise EditionMarcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise Edition
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise Edition
 
Janice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios PluginsJanice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios Plugins
 
Dave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical ExperienceDave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical Experience
 
Mike Weber - Nagios and Group Deployment of Service Checks
Mike Weber - Nagios and Group Deployment of Service ChecksMike Weber - Nagios and Group Deployment of Service Checks
Mike Weber - Nagios and Group Deployment of Service Checks
 
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios InstallationMike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
 
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
 
Matt Bruzek - Monitoring Your Public Cloud With Nagios
Matt Bruzek - Monitoring Your Public Cloud With NagiosMatt Bruzek - Monitoring Your Public Cloud With Nagios
Matt Bruzek - Monitoring Your Public Cloud With Nagios
 
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
 
Eric Loyd - Fractal Nagios
Eric Loyd - Fractal NagiosEric Loyd - Fractal Nagios
Eric Loyd - Fractal Nagios
 
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
 
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
 
Nagios World Conference 2015 - Scott Wilkerson Opening
Nagios World Conference 2015 - Scott Wilkerson OpeningNagios World Conference 2015 - Scott Wilkerson Opening
Nagios World Conference 2015 - Scott Wilkerson Opening
 
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
 
Nagios Log Server - Features
Nagios Log Server - FeaturesNagios Log Server - Features
Nagios Log Server - Features
 
Nagios Network Analyzer - Features
Nagios Network Analyzer - FeaturesNagios Network Analyzer - Features
Nagios Network Analyzer - Features
 
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing NagiosNagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
 

Recently uploaded

New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 

Recently uploaded (20)

New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 

Monitoring Physical World with Arduino & Nagios

  • 1. Monitoring the Physical World with Nagios and Arduino Trevor McDonald tmcdonald@nagios.com http://github.com/tmcnag
  • 2. Who Am I? ● Support Tech at Nagios Enterprises – tmcdonald on Support Forum – Docs, Bugs, Testing, PPeerrll ● Other Things I Do: – World Languages – Computer Security – Electronics
  • 3. Who Am I Not? ● Affiliated with Arduino – Not being paid to advertise – All images copyright their respective owners – <Legal disclaimer here> ● Iron Man
  • 4. Who Am I Not? ● Affiliated with Arduino – Not being paid to advertise – All images copyright their respective owners – <Legal disclaimer here> ● Iron Man (yet)
  • 5. What's This Talk About? ● Physical Monitors: – Temperature – Humidity – Light – Motion – Open/Close of Doors/Windows
  • 6. How Do We Do That? ● Existing Solutions: – Closed-source – Limited scope – Expensive* ($1,000+) ● Arduino: – 100% open-source – Customizable – Cheap ($5 to $50)
  • 7. What is Arduino? ● Arduino Uno – 8-bit Microprocessor – 32K Flash Memory – 2K RAM – 16 MHz Clock Speed – Runs on 5V – 14 Digital + 6 Analog I/O Pins
  • 8. Assumptions ● You know a bit of C/C++ ● You understand passive checks (NRDP) ● You understand the following: – Flip switch up, light goes on – Flip switch down, light goes off – AKA “Digital logic”
  • 9. How Does It Work? ● Hardware is attached to pins ● Each I/O pin either reads or writes data – Reading might detect if a button is pressed – Writing could turn on a LED or motor ● Pins can be configured for either task ● Regular C code is used to control pins and handle program logic
  • 10. A Simple Blink ● [ Picture of LED breadboard ]
  • 11. A Simple Blink ● [ Example Blink sketch ]
  • 16. The Missing Link ● We're able to... – Read the state of a button/switch – Take action accordingly (light an LED) ● We want to... – Send passive results to Nagios ● So we need... – Networking capability (HTTP for NRDP)
  • 17. Arduino Shields ● Stack on top of and expand an Arduino – Relay shield for high-powered device control – MP3 shield for adding quality audio output – LCD + buttons shield for a basic UI – Ethernet shield for network connectivity ● Relatively cheap ($30 to $60 on average) ● Save on RAM, CPU, code, and time
  • 19. Introducing Nagduino ● C++ “library” I built to facilitate NRDP calls – No NSCA (not enough RAM for crypto) – No SNMP Traps (not enough patience) ● Very small, very simple code – 6 lines to get you going ● Bells + whistles not included – No checking NRDP result – Debug code? What debug code?
  • 20. Putting It All Together ● Magnetic sensor attached to input ● Arduino checks sensor on a loop ● If open, send NRDP Critical to Nagios – “Latch” to avoid repeat messages ● If closed, do nothing and loop – Reset latch, re-check every 100ms ● Alert based on preferences/settings
  • 25. Tying In With Nagios ● Graphing – View historical information – Capacity planning (XI) – Use multistacked graphs for correlations (XI) ● Physical Event Handlers – Turn on fan if temp is Warning – Turn on AC if temp is Critical
  • 26. Use Cases ● Applications in: – Farming (soil moisture, temp, light) – Security (light, motion, sound, contacts) – Home Automation (temp, light, infrared LED) – Beekeeping (Talk to Sally Reich)
  • 27. Moving Forward ● Support for NSCA + SNMP Traps ● Web interface (CCM for Arduino checks) ● Beyond Arduino – Raspberry Pi (I'm looking at you, Dave) – Smartphone (Mobile environment readings) – Intel Edison (Very cool)
  • 29. The End Trevor McDonald tmcdonald@nagios.com http://github.com/tmcnag

Editor's Notes

  1. - Interested in talking if they speak another lang. - Degree in forensics, work with Spenser on sec. - Electronics hobbyist “which brings me to what this talk is all about”
  2. - Interested in talking if they speak another lang. - Degree in forensics, work with Spenser on sec. - Electronics hobbyist “which brings me to what this talk is all about”
  3. - Interested in talking if they speak another lang. - Degree in forensics, work with Spenser on sec. - Electronics hobbyist “which brings me to what this talk is all about”
  4. - Traditional monitoring targets software - The physical world can be just as critical - What are some things you might want to monitor in the physical world? - Temp without humidity could be problematic - Light + Motion for security system - “But today we are going to focus on detecting the state of a door or window”
  5. - Closed-source prevents modification - Related to closed-source, if they don&amp;apos;t do what you want you either buy another device or make do - Expense is relative, and you get what you pay for, but not everyone can afford it - Hardware and software is open-source - Customizable means no lock-in - Price starts low at $5 for a Micro and goes up for the Mega
  6. - The GPIO is what sets this apart from just a small computer
  7. - Don&amp;apos;t have to be a C guru, but at least be able to read basic code - Experience with other languages could probably fit as well - [ Give brief overview of 1/0, on/off, HIGH/LOW ]
  8. - Hardware can be input: buttons, switches, light sensors, pressure pads; or output: lights, motors, buzzers, speakers
  9. - Explain setup() and loop() sections
  10. - And to do that, we are going to use Shields
  11. - Essentially a piece of hardware of similar shape and size
  12. - Note the pin passthrough and the ethernet jack - Handles all the low-level networking details
  13. - I use the term “library” loosely – it is only a single function right now - More powerful models might be able to handle crypto - Netduino is a library that handles SNMP Get but not Trap - Reiterate: I am not a professional programmer - This was all done in my spare time
  14. - Here&amp;apos;s how the demo will hopefully play out - Nagios takes over at the end and it is just like any other passive check
  15. - Basically a switch just like with the LED example
  16. - Explain the object creation - Explain sendNRDP() call - Explain loop + latching
  17. - Explain the object creation - Explain sendNRDP() call - Explain loop + latching
  18. - Capacity planning could relate to body weight
  19. - Sally&amp;apos;s talk is mostly theory
  20. - Some things I would like to see down the road - Raspberry Pi = Dave Williams
  21. If there is time at the end, talk about personal projects using Arduino?