SlideShare a Scribd company logo
1 of 29
Download to read offline
R.I.Pienaar
Malta DevOps December 2016
Monitoring using Sensu
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Who am I?
• Malta since December 2015
• Consultant for 20+ years
• Government, Finance, Health, Social Media,
Fortune 50, Startups
• DevOps, Automation, Architect,
Development
• Open Source @ github.com/ripienaar
• Linux since Kernel 99 alpha p11
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Tool
vs
Framework
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Checks
API
MetricsDynamic
External InputsSecure
Events
Plugins
JSON
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Architecture - Overview
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Architecture - Schedule
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Architecture - Event
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Architecture - Integrate
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
{
"checks": {
"procs_rhel7": {
"command": "/usr/lib64/nagios/plugins/check_procs -w 50 -c 70 -k",
"interval": 300,
"subscribers": [
"RedHat-7"
]
}
}
}
Config - Checks
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
{
"checks": {
"procs_rhel7": {
"command": "/usr/lib64/nagios/plugins/check_procs -w 50 -c 70 -k",
"interval": 300,
"subscribers": [
"RedHat-7"
]
}
}
}
Config - Checks
Name
Command to run
How often
Where
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
{
"client": {
"name": "dev3.devco.net",
"address": "139.162.163.118",
"subscriptions": [
"all",
"linode_fra",
"de",
"RedHat-7"
],
"redact": [
],
"socket": {
"bind": "127.0.0.1",
"port": 3030
},
"procs": {
"total": {
"warn": 80,
"crit": 90
}
}
}
}
Config - Clients
Local event sync
What am I?
Node Parameters
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
{
"client": {
…,
"procs": {
"total": {
"warn": 80,
"crit": 90
}
}
}
}
Config - Clients
Node Parameters
{
"checks": {
"procs_rhel7": {
"command": "/usr/lib64/nagios/plugins/check_procs -w 50 -c 70 -k",
"interval": 300,
"subscribers": [
"RedHat-7"
]
}
}
}
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
{
"client": {
…,
"procs": {
"total": {
"warn": 80,
"crit": 90
}
}
}
}
Config - Clients
Node Parameters
{
"checks": {
"procs_rhel7": {
"command": “…/check_procs -w :::procs.total.warn|50::: -c :::procs.total.crit|70::: -k",
"interval": 300,
"subscribers": [
"RedHat-7"
]
}
}
}
Check Tokens
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
require ‘sensu-plugin/check/cli'
class CheckFile < Sensu::Plugin::Check::CLI
option :file,
long: “—file FILE”,
description: “The file to check”,
default: nil
def run
unknown(“no file specified, please use —file”) unless config[:file]
if File.exist?(config[:file])
ok(“file %s exist” % [config[:file]])
else
critical(“file %s does not exist” % [config[:file]])
end
end
end
Checks - Writing in Ruby
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
require ‘sensu-plugin/check/cli'
class CheckFile < Sensu::Plugin::Check::CLI
option :file,
long: “—file FILE”,
description: “The file to check”,
default: nil
def run
unknown(“no file specified, please use —file”) unless config[:file]
if File.exist?(config[:file])
ok(“file %s exist” % [config[:file]])
else
critical(“file %s does not exist” % [config[:file]])
end
end
end
Checks - Writing in Ruby
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
require “sensu-plugin/check/cli”
class CheckFile < Sensu::Plugin::Check::CLI
option :file,
long: “—file FILE”,
description: “The file to check”,
default: nil
def run
unknown(“no file specified, please use —file”) unless config[:file]
if File.exist?(config[:file])
ok(“file %s exist” % [config[:file]])
else
critical(“file %s does not exist” % [config[:file]])
end
end
end
Checks - Writing in Ruby
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
# yum install nagios-plugins-all
# /usr/lib64/nagios/plugin/check_file_age —help
…
Usage:
check_file_age [-w <secs>] [-c <secs>] [-W <size>] [-C <size>] [-i] -f <file>
check_file_age [-h | --help]
check_file_age [-V | --version]
# /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $?
FILE_AGE UNKNOWN: No file specified
3
# /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $?
FILE_AGE CRITICAL: File not found - /keepalive
2
# /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $?
FILE_AGE WARNING: /keepalive is 353 seconds old and 0 bytes
1
# /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $?
FILE_AGE OK: keepalive is 4 seconds old and 0 bytes
0
Checks - Reuse
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
# yum install nagios-plugins-all
# /usr/lib64/nagios/plugin/check_file_age —help
…
Usage:
check_file_age [-w <secs>] [-c <secs>] [-W <size>] [-C <size>] [-i] -f <file>
check_file_age [-h | --help]
check_file_age [-V | --version]
# /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $?
FILE_AGE UNKNOWN: No file specified
3
# /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $?
FILE_AGE CRITICAL: File not found - /keepalive
2
# /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $?
FILE_AGE WARNING: /keepalive is 353 seconds old and 0 bytes
1
# /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $?
FILE_AGE OK: keepalive is 4 seconds old and 0 bytes
0
Checks - Reuse
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Checks - Reuse
http://sensu-plugins.io/
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
$ cat <<EOF > /dev/tcp/localhost/3030
{
"name":"my_awesome_check",
"output":"everything is fine",
"ttl":600,
“status”:0
}
EOF
Checks -Your own App
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
{
"mailer": {
"mail_from": "sensu@example.com",
"mail_to": "monitor@example.com",
"smtp_address": "smtp.example.org",
"smtp_port": "25",
"smtp_domain": "example.org",
"template": “/etc/sensu/templates/mail.erb”,
"subscriptions": {
"subscription_name": {
"mail_to": "teamemail@example.com"
}
}
}
}
Handlers - Email
https://github.com/sensu-plugins/sensu-plugins-mailer
/etc/sensu/handlers/mailer.json
Custom mail body
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
<%= output %>
Admin GUI: <%= admin_gui %>
Host: <%= @event['client']['name'] %>
Timestamp: <%= Time.at(@event['check']['issued']) %>
Address: <%= @event['client']['address'] %>
Check Name: <%= @event['check']['name'] %>
Command: <%= command %>
Status: <%= status_to_string %>
Occurrences: <%= @event['occurrences'] %>
Handlers - Email
https://github.com/sensu-plugins/sensu-plugins-mailer
/etc/sensu/templates/mail.erb
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Handlers - Thirdparties
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
events = JSON.parse(
RestClient.get(“http://example:4567/events").body
)
statusmap = {0 => "OK", 1 => "WARNING", 2 => "CRITICAL", 3 => "UNKNOWN"}
puts "Found %d events" % [events.size]
events.each do |event|
puts "%30s: %-10s %s" % [
event["client"]["name"],
statusmap[event["check"]["status"]],
event[“check"]["output"]
]
end
API - JSON
Found 2 events
puppet1.example.net: CRITICAL DISK CRITICAL - /run/docker/netns/default is not accessible:
Permission denied
dev1.example.net: WARNING PROCS WARNING: 183 processes
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
API - Uchiwa
https://uchiwa.io/
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
API - Uchiwa
https://uchiwa.io/
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Links
https://sensuapp.org/
https://uchiwa.io/
https://graphiteapp.org/
http://grafana.org/
http://sensu-plugins.io/
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Questions?
twitter: @ripienaar
email: rip@devco.net
blog: www.devco.net
github: ripienaar
freenode: Volcane
slack.puppet.com: ripienaar
https://www.devco.net/

More Related Content

What's hot

An introduction to the MicroProfile
An introduction to the MicroProfileAn introduction to the MicroProfile
An introduction to the MicroProfileAlex Soto
 
LetSwift 2017 - 토스 iOS 앱의 개발/배포 환경
LetSwift 2017 - 토스 iOS 앱의 개발/배포 환경LetSwift 2017 - 토스 iOS 앱의 개발/배포 환경
LetSwift 2017 - 토스 iOS 앱의 개발/배포 환경Mintak Son
 
Laravel Code Generators and Packages
Laravel Code Generators and PackagesLaravel Code Generators and Packages
Laravel Code Generators and PackagesPovilas Korop
 
Open Canary - novahackers
Open Canary - novahackersOpen Canary - novahackers
Open Canary - novahackersChris Gates
 
Jakob Holderbaum - Managing Shared secrets using basic Unix tools
Jakob Holderbaum - Managing Shared secrets using basic Unix toolsJakob Holderbaum - Managing Shared secrets using basic Unix tools
Jakob Holderbaum - Managing Shared secrets using basic Unix toolsDevSecCon
 
Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)chenghlee
 

What's hot (6)

An introduction to the MicroProfile
An introduction to the MicroProfileAn introduction to the MicroProfile
An introduction to the MicroProfile
 
LetSwift 2017 - 토스 iOS 앱의 개발/배포 환경
LetSwift 2017 - 토스 iOS 앱의 개발/배포 환경LetSwift 2017 - 토스 iOS 앱의 개발/배포 환경
LetSwift 2017 - 토스 iOS 앱의 개발/배포 환경
 
Laravel Code Generators and Packages
Laravel Code Generators and PackagesLaravel Code Generators and Packages
Laravel Code Generators and Packages
 
Open Canary - novahackers
Open Canary - novahackersOpen Canary - novahackers
Open Canary - novahackers
 
Jakob Holderbaum - Managing Shared secrets using basic Unix tools
Jakob Holderbaum - Managing Shared secrets using basic Unix toolsJakob Holderbaum - Managing Shared secrets using basic Unix tools
Jakob Holderbaum - Managing Shared secrets using basic Unix tools
 
Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)
 

Similar to Monitoring using Sensu

Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Codemotion
 
Introduction to Configuration Management
Introduction to Configuration ManagementIntroduction to Configuration Management
Introduction to Configuration Managementripienaar
 
External Data in Puppet 4
External Data in Puppet 4External Data in Puppet 4
External Data in Puppet 4ripienaar
 
PuppetConf. 2016: External Data in Puppet 4 – R.I. Pienaar
PuppetConf. 2016: External Data in Puppet 4 – R.I. PienaarPuppetConf. 2016: External Data in Puppet 4 – R.I. Pienaar
PuppetConf. 2016: External Data in Puppet 4 – R.I. PienaarPuppet
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with BackstageOpsta
 
Puppet Performance Profiling - CM Camp 2015
Puppet Performance Profiling - CM Camp 2015Puppet Performance Profiling - CM Camp 2015
Puppet Performance Profiling - CM Camp 2015ripienaar
 
Large Scale Continuous Delivery
Large Scale Continuous DeliveryLarge Scale Continuous Delivery
Large Scale Continuous Deliveryripienaar
 
Whirlwind Tour of Puppet 4
Whirlwind Tour of Puppet 4Whirlwind Tour of Puppet 4
Whirlwind Tour of Puppet 4ripienaar
 
Introduction to InSpec and 1.0 release update
Introduction to InSpec and 1.0 release updateIntroduction to InSpec and 1.0 release update
Introduction to InSpec and 1.0 release updateAlex Pop
 
Reproducible, Automated and Portable Computational and Data Science Experimen...
Reproducible, Automated and Portable Computational and Data Science Experimen...Reproducible, Automated and Portable Computational and Data Science Experimen...
Reproducible, Automated and Portable Computational and Data Science Experimen...Ivo Jimenez
 
Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Patrick Muehlbauer
 
DevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
DevOps on AWS: Accelerating Software Delivery with the AWS Developer ToolsDevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
DevOps on AWS: Accelerating Software Delivery with the AWS Developer ToolsAmazon Web Services
 
Puppet Performance Profiling
Puppet Performance ProfilingPuppet Performance Profiling
Puppet Performance Profilingripienaar
 
Advanced malware analysis training session5 reversing automation
Advanced malware analysis training session5 reversing automationAdvanced malware analysis training session5 reversing automation
Advanced malware analysis training session5 reversing automationCysinfo Cyber Security Community
 
Reversing Engineering a Web Application - For fun, behavior and detection
Reversing Engineering a Web Application - For fun, behavior and detectionReversing Engineering a Web Application - For fun, behavior and detection
Reversing Engineering a Web Application - For fun, behavior and detectionRodrigo Montoro
 
release_python_day1_slides_201606.pdf
release_python_day1_slides_201606.pdfrelease_python_day1_slides_201606.pdf
release_python_day1_slides_201606.pdfPaul Yang
 
The Scientific Filesystem
The Scientific FilesystemThe Scientific Filesystem
The Scientific FilesystemVanessa S
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Dockerripienaar
 

Similar to Monitoring using Sensu (20)

Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
 
Introduction to Configuration Management
Introduction to Configuration ManagementIntroduction to Configuration Management
Introduction to Configuration Management
 
External Data in Puppet 4
External Data in Puppet 4External Data in Puppet 4
External Data in Puppet 4
 
PuppetConf. 2016: External Data in Puppet 4 – R.I. Pienaar
PuppetConf. 2016: External Data in Puppet 4 – R.I. PienaarPuppetConf. 2016: External Data in Puppet 4 – R.I. Pienaar
PuppetConf. 2016: External Data in Puppet 4 – R.I. Pienaar
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with Backstage
 
Puppet Performance Profiling - CM Camp 2015
Puppet Performance Profiling - CM Camp 2015Puppet Performance Profiling - CM Camp 2015
Puppet Performance Profiling - CM Camp 2015
 
Large Scale Continuous Delivery
Large Scale Continuous DeliveryLarge Scale Continuous Delivery
Large Scale Continuous Delivery
 
Whirlwind Tour of Puppet 4
Whirlwind Tour of Puppet 4Whirlwind Tour of Puppet 4
Whirlwind Tour of Puppet 4
 
Introduction to InSpec and 1.0 release update
Introduction to InSpec and 1.0 release updateIntroduction to InSpec and 1.0 release update
Introduction to InSpec and 1.0 release update
 
Reproducible, Automated and Portable Computational and Data Science Experimen...
Reproducible, Automated and Portable Computational and Data Science Experimen...Reproducible, Automated and Portable Computational and Data Science Experimen...
Reproducible, Automated and Portable Computational and Data Science Experimen...
 
Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018
 
DevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
DevOps on AWS: Accelerating Software Delivery with the AWS Developer ToolsDevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
DevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
 
Puppet Performance Profiling
Puppet Performance ProfilingPuppet Performance Profiling
Puppet Performance Profiling
 
Advanced malware analysis training session5 reversing automation
Advanced malware analysis training session5 reversing automationAdvanced malware analysis training session5 reversing automation
Advanced malware analysis training session5 reversing automation
 
Reversing Engineering a Web Application - For fun, behavior and detection
Reversing Engineering a Web Application - For fun, behavior and detectionReversing Engineering a Web Application - For fun, behavior and detection
Reversing Engineering a Web Application - For fun, behavior and detection
 
release_python_day1_slides_201606.pdf
release_python_day1_slides_201606.pdfrelease_python_day1_slides_201606.pdf
release_python_day1_slides_201606.pdf
 
The Scientific Filesystem
The Scientific FilesystemThe Scientific Filesystem
The Scientific Filesystem
 
Puppi. Puppet strings to the shell
Puppi. Puppet strings to the shellPuppi. Puppet strings to the shell
Puppi. Puppet strings to the shell
 
Git::Hooks
Git::HooksGit::Hooks
Git::Hooks
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 

Recently uploaded

Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Roomdivyansh0kumar0
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Lucknow
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Roomdivyansh0kumar0
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...
Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...
Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...akbard9823
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
The Intriguing World of CDR Analysis by Police: What You Need to Know.pdf
The Intriguing World of CDR Analysis by Police: What You Need to Know.pdfThe Intriguing World of CDR Analysis by Police: What You Need to Know.pdf
The Intriguing World of CDR Analysis by Police: What You Need to Know.pdfMilind Agarwal
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Roomdivyansh0kumar0
 

Recently uploaded (20)

Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...
Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...
Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
The Intriguing World of CDR Analysis by Police: What You Need to Know.pdf
The Intriguing World of CDR Analysis by Police: What You Need to Know.pdfThe Intriguing World of CDR Analysis by Police: What You Need to Know.pdf
The Intriguing World of CDR Analysis by Police: What You Need to Know.pdf
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
 

Monitoring using Sensu

  • 1. R.I.Pienaar Malta DevOps December 2016 Monitoring using Sensu
  • 2. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Who am I? • Malta since December 2015 • Consultant for 20+ years • Government, Finance, Health, Social Media, Fortune 50, Startups • DevOps, Automation, Architect, Development • Open Source @ github.com/ripienaar • Linux since Kernel 99 alpha p11
  • 3. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
  • 4. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Tool vs Framework
  • 5. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Checks API MetricsDynamic External InputsSecure Events Plugins JSON
  • 6. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Architecture - Overview
  • 7. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Architecture - Schedule
  • 8. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Architecture - Event
  • 9. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Architecture - Integrate
  • 10. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar { "checks": { "procs_rhel7": { "command": "/usr/lib64/nagios/plugins/check_procs -w 50 -c 70 -k", "interval": 300, "subscribers": [ "RedHat-7" ] } } } Config - Checks
  • 11. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar { "checks": { "procs_rhel7": { "command": "/usr/lib64/nagios/plugins/check_procs -w 50 -c 70 -k", "interval": 300, "subscribers": [ "RedHat-7" ] } } } Config - Checks Name Command to run How often Where
  • 12. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar { "client": { "name": "dev3.devco.net", "address": "139.162.163.118", "subscriptions": [ "all", "linode_fra", "de", "RedHat-7" ], "redact": [ ], "socket": { "bind": "127.0.0.1", "port": 3030 }, "procs": { "total": { "warn": 80, "crit": 90 } } } } Config - Clients Local event sync What am I? Node Parameters
  • 13. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar { "client": { …, "procs": { "total": { "warn": 80, "crit": 90 } } } } Config - Clients Node Parameters { "checks": { "procs_rhel7": { "command": "/usr/lib64/nagios/plugins/check_procs -w 50 -c 70 -k", "interval": 300, "subscribers": [ "RedHat-7" ] } } }
  • 14. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar { "client": { …, "procs": { "total": { "warn": 80, "crit": 90 } } } } Config - Clients Node Parameters { "checks": { "procs_rhel7": { "command": “…/check_procs -w :::procs.total.warn|50::: -c :::procs.total.crit|70::: -k", "interval": 300, "subscribers": [ "RedHat-7" ] } } } Check Tokens
  • 15. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar require ‘sensu-plugin/check/cli' class CheckFile < Sensu::Plugin::Check::CLI option :file, long: “—file FILE”, description: “The file to check”, default: nil def run unknown(“no file specified, please use —file”) unless config[:file] if File.exist?(config[:file]) ok(“file %s exist” % [config[:file]]) else critical(“file %s does not exist” % [config[:file]]) end end end Checks - Writing in Ruby
  • 16. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar require ‘sensu-plugin/check/cli' class CheckFile < Sensu::Plugin::Check::CLI option :file, long: “—file FILE”, description: “The file to check”, default: nil def run unknown(“no file specified, please use —file”) unless config[:file] if File.exist?(config[:file]) ok(“file %s exist” % [config[:file]]) else critical(“file %s does not exist” % [config[:file]]) end end end Checks - Writing in Ruby
  • 17. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar require “sensu-plugin/check/cli” class CheckFile < Sensu::Plugin::Check::CLI option :file, long: “—file FILE”, description: “The file to check”, default: nil def run unknown(“no file specified, please use —file”) unless config[:file] if File.exist?(config[:file]) ok(“file %s exist” % [config[:file]]) else critical(“file %s does not exist” % [config[:file]]) end end end Checks - Writing in Ruby
  • 18. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar # yum install nagios-plugins-all # /usr/lib64/nagios/plugin/check_file_age —help … Usage: check_file_age [-w <secs>] [-c <secs>] [-W <size>] [-C <size>] [-i] -f <file> check_file_age [-h | --help] check_file_age [-V | --version] # /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $? FILE_AGE UNKNOWN: No file specified 3 # /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $? FILE_AGE CRITICAL: File not found - /keepalive 2 # /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $? FILE_AGE WARNING: /keepalive is 353 seconds old and 0 bytes 1 # /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $? FILE_AGE OK: keepalive is 4 seconds old and 0 bytes 0 Checks - Reuse
  • 19. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar # yum install nagios-plugins-all # /usr/lib64/nagios/plugin/check_file_age —help … Usage: check_file_age [-w <secs>] [-c <secs>] [-W <size>] [-C <size>] [-i] -f <file> check_file_age [-h | --help] check_file_age [-V | --version] # /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $? FILE_AGE UNKNOWN: No file specified 3 # /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $? FILE_AGE CRITICAL: File not found - /keepalive 2 # /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $? FILE_AGE WARNING: /keepalive is 353 seconds old and 0 bytes 1 # /usr/lib64/nagios/plugins/check_file_age -f /keepalive; echo $? FILE_AGE OK: keepalive is 4 seconds old and 0 bytes 0 Checks - Reuse
  • 20. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Checks - Reuse http://sensu-plugins.io/
  • 21. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar $ cat <<EOF > /dev/tcp/localhost/3030 { "name":"my_awesome_check", "output":"everything is fine", "ttl":600, “status”:0 } EOF Checks -Your own App
  • 22. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar { "mailer": { "mail_from": "sensu@example.com", "mail_to": "monitor@example.com", "smtp_address": "smtp.example.org", "smtp_port": "25", "smtp_domain": "example.org", "template": “/etc/sensu/templates/mail.erb”, "subscriptions": { "subscription_name": { "mail_to": "teamemail@example.com" } } } } Handlers - Email https://github.com/sensu-plugins/sensu-plugins-mailer /etc/sensu/handlers/mailer.json Custom mail body
  • 23. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar <%= output %> Admin GUI: <%= admin_gui %> Host: <%= @event['client']['name'] %> Timestamp: <%= Time.at(@event['check']['issued']) %> Address: <%= @event['client']['address'] %> Check Name: <%= @event['check']['name'] %> Command: <%= command %> Status: <%= status_to_string %> Occurrences: <%= @event['occurrences'] %> Handlers - Email https://github.com/sensu-plugins/sensu-plugins-mailer /etc/sensu/templates/mail.erb
  • 24. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Handlers - Thirdparties
  • 25. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar events = JSON.parse( RestClient.get(“http://example:4567/events").body ) statusmap = {0 => "OK", 1 => "WARNING", 2 => "CRITICAL", 3 => "UNKNOWN"} puts "Found %d events" % [events.size] events.each do |event| puts "%30s: %-10s %s" % [ event["client"]["name"], statusmap[event["check"]["status"]], event[“check"]["output"] ] end API - JSON Found 2 events puppet1.example.net: CRITICAL DISK CRITICAL - /run/docker/netns/default is not accessible: Permission denied dev1.example.net: WARNING PROCS WARNING: 183 processes
  • 26. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar API - Uchiwa https://uchiwa.io/
  • 27. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar API - Uchiwa https://uchiwa.io/
  • 28. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Links https://sensuapp.org/ https://uchiwa.io/ https://graphiteapp.org/ http://grafana.org/ http://sensu-plugins.io/
  • 29. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Questions? twitter: @ripienaar email: rip@devco.net blog: www.devco.net github: ripienaar freenode: Volcane slack.puppet.com: ripienaar https://www.devco.net/