Sensu Monitoring
-
Upload
mohanasundaram-ponnusamy -
Category
Data & Analytics
-
view
30 -
download
1
Transcript of Sensu Monitoring
![Page 1: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/1.jpg)
SensuMohanasundaram Ponnusamy
![Page 2: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/2.jpg)
Content• What is Sensu?• Why Sensu?• Why Competitive?• Architecture• Components• Important Keywords• Monitoring Flow• Sensu Server, Sensu Client, Redis/Redis Sentinel, API, Dashboard• Client Info, Checks, Handlers, Slashes, Muators, etc• Reference
![Page 3: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/3.jpg)
What is Sensu?• Client-Server Architecture Monitoring Solution• Monitoring coverage leveraging to any Servers,
Containers, Services, Applications, Network or any Remote resources• Written in Ruby language• Uses simple JSON for Configuration
![Page 4: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/4.jpg)
Why Sensu?• Design for Cloud• Open source well-defined (github.com/sensu)• Message Oriented Architecture• Extensible Plugins, handlers, Check Scripts can written in any language• Sensu Community Support• Single Point of Check metrics collection• Designed to Chef Cookbook, Puppet or Ansible• Backend support to Graphite, Logstash, Elasticsearch, etc.• Powerful Monitoring through Service Checks and Event Processing• Scalable and Extensible with community plugins• Sensu Framework includes Sensu Server, Redis, Redis Sentinel, RabbitMQ, Sensu Client, Sensu
API, Uchiwa Dashboard and etc.
![Page 5: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/5.jpg)
Why Competitive
• Sensu vs Data Dog• https://stackshare.io/stackups/datadog-vs-sensu
• Sensu vs Nagios• https://stackshare.io/stackups/nagios-vs-sensu-vs-kibana
![Page 6: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/6.jpg)
Architecture
![Page 7: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/7.jpg)
Components
• Sensu Client – To Gather all check results• RabbitMQ – Default Transport MQ• Redis – Default Persistent Data Store• Redis Sentinel – Managing HA of Redis• Sensu Server – To manage actions on check results• Sensu API – To query the state• Uchiwa - Dashboard
![Page 8: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/8.jpg)
Monitoring Flow
• Sensu Client • executes checks• publishes checks results to abbitMQ
• Sensu Server receives check results from RabbitMQ• Processes check results if required• Stores into persistent store - Redis
![Page 9: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/9.jpg)
Monitoring Flow
![Page 10: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/10.jpg)
Monitoring Flow
![Page 11: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/11.jpg)
Monitoring Flow
![Page 12: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/12.jpg)
Monitoring Flow
![Page 13: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/13.jpg)
Important Keywords• Checks
• Commands / Script that collect metrics, events, etc. called check results.• Results are disk usage, swap, process, cpu, memory, file systems, etc.
• Event Handlers• Publish event data to destinations. • Example, Email, TCP, UDP, etc.
• Set• Group of Handlers • To pass one event data to multiple handlers
• Severity Filters• To run handlers at certain security level
• Mutators• Mutate event data before passing it to handlers
• Plugins, Extensions, Stashes, etc.
![Page 14: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/14.jpg)
Sensu Client
• Monitoring Agent• Runs on the machine which to be monitored • Executes all checks (command/scripts) and collects all
check results• Sends following to Sensu Server through RabbitMQ
• Client info• Keep alive messages• Check Results• Subscriptions
![Page 15: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/15.jpg)
Sensu Server• Monitoring Router• Sends execution request to Client through RabbitMQ• Uses Redis to hold persistent data• Uses RabbitMQ for heavy in exchange of data with Sensu
Client• Provides• Event Processing; Metric Routing; Event Management
• Two Flavor as below• Sensu Core• Sensu Enterprise
![Page 16: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/16.jpg)
Rabbit MQ
• The default Sensu Transport Message Bus for Sensu• It can be single instance or a clustered• Uses for Sensu server and client to
communicate and to exchange the services, check results, etc.
![Page 17: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/17.jpg)
Redis
• A default persistent data store for Sensu• Key-value data store with advanced cache• Stores • registry, • check results, • check history • and event data
![Page 18: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/18.jpg)
Redis Sentinel• Service for managing Redis servers• Clustering • High Availability of Redis nodes such as slave to
master if the current master is not working as expected• Recommended is TWO systems for Redis Master-
Slave replica and a minimum of THREE Redis Sentinels.
![Page 19: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/19.jpg)
Sensu API
• REST API for accessing various data on Sensu server (Redis)• It usually runs on the same server as
Sensu Server or Redis instance• JSON document results
![Page 20: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/20.jpg)
Sensu-Dashboard
• Built on top of Uchiwa • Real-time Web UI based on Node.js• Dedicated view for each events, checks,
datacenter, etc• Basic operations can be done
![Page 21: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/21.jpg)
![Page 22: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/22.jpg)
Client Info
• Client info is published when monitoring service is started• The monitoring content is based on • Name - Client name• Address - IP address of the client• Subscriptions - Roles list or Role
equivalent
{ "Client": { "Name": “myHost", "Address": "127.0.0.1", "Subscriptions": [ "Production", “Openshift", “Docker" ] } }
![Page 23: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/23.jpg)
What is Checks• Essential commands/scripts• Executed by Sensu Client on the machine to be monitored• Subscription Checks - the execution timing if held by Sensu Server• Standalone Checks – the execution timing if held by Sensu Client• Check Results
• JSON Document • Sends as Event to Handler
• Output to STDOUT / ERR and have an exit status code as follows• 0 : OK• 1 : WARNING• 2 : CRITICAL• 3 : UNKNOWN or CUSTOM
![Page 24: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/24.jpg)
Check Definition• myClient• Unique Check name
• Command• Check script to execute
• Subscribers• Which subscriptions to execute Check
• Interval• interval Check script is executed
(seconds)
{ "Checks": { “myClient": { "Command": “mycheck-rule.rb", "Subscribers": [ "Production" ], "Interval": 60, "Handlers": [ “TCP", "Irc" ] } } }
![Page 25: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/25.jpg)
Event Handlers• Action executed by the Sensu server on events• Each checks have its own handler(s)• Types
• Pipe Handler• Event Data through STDIN and executes commands/scripts• Server executes a script and results event as JSON to Standard Input.
• TCP/UDP handlers• Event data to TCP/UDP socket• Server connects to the host:port and sending event
• Transport handlers publish event data to RabbitMQ• It can be routing through
• Example:• Sending an email alert, creating or resolving an incident (e.g. in PagerDuty,
ServiceNow, etc.), or storing metrics in a time-series database (e.g. Graphite
![Page 26: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/26.jpg)
Event Handler - Example
• Execute a command
• send mail
{ "Handlers": { "File": { "Type": "pipe", "Command": "/etc/sensu/handlers/file.rb" } } }
{ "Handlers": { "Mail": { "Type": "pipe", "Command": "mail - s 'sensu event' [email protected]" } } }
{ "Handlers": { "Tcp_socket": { "Type": "tcp", "Socket": { "Host": "127.0.0.1", "Port": 4242 } } } }
![Page 27: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/27.jpg)
Stashes
• Associated with path• Key Value Store• Store anything• Make your handlers to check
![Page 28: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/28.jpg)
Reference
• Sensu Document• https://sensuapp.org/features
• Sensu Plugins• https://github.com/sensu
![Page 29: Sensu Monitoring](https://reader031.fdocuments.net/reader031/viewer/2022020110/58e4a5a81a28abbb038b4593/html5/thumbnails/29.jpg)
Q & A