Monitoring Open Source Databases with Icinga
Click here to load reader
Transcript of Monitoring Open Source Databases with Icinga
![Page 1: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/1.jpg)
Percona Live | Amsterdam | 04.10.2016
Monitoring Open Source Databases with Icinga
04.10.2016
![Page 2: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/2.jpg)
• Bernd Erk
• Icinga Co-founder
• Working @netways
• @gethash
![Page 3: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/3.jpg)
Introduction to Icinga
![Page 4: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/4.jpg)
Quick Poll
![Page 5: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/5.jpg)
Icinga is a scalable and extensible monitoring system which checks the availability of your resources, notifies users of outages and provides extensive metrics.
availability notifiesmetrics
![Page 6: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/6.jpg)
Icinga Web 2
Icinga 2Icinga
Icinga Quality, Testing and Community Support
Icinga.org, dev.icinga.org, social media channels
Icinga Reports Icinga Doc
3rd Party Tools
Icinga Web
Icinga Classic (CGI)
![Page 7: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/7.jpg)
Icinga2 - Architecture
Introduction to Icinga2
![Page 8: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/8.jpg)
Checker
Notify
Gelf
Perfdata Graphite
IDO
Compat
Livestatus
• Multithreaded
• Modular Features
• Zone support
• Secure Agent
• No Nagios®
![Page 9: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/9.jpg)
• Availability and scaling zones
• Automatic redistribution of checks
• Zones for multitenancy environments
zones
redistribution
multitenancy
![Page 10: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/10.jpg)
Open Source Databases
![Page 11: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/11.jpg)
• MySQL | MariaDB | Percona Server
• PostgreSQL
• MongoDB
• Firebird
• SQLite
MongoDB
PostgreSQL
MySQLish
![Page 12: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/12.jpg)
• Availability
• Troubleshooting
• Replication-Status
• Capacity
• Metrics and performance data
![Page 13: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/13.jpg)
• check_mongodb_py
• connect• connections• replicaton_lag• memory• memory_mapped• lock• flushing
https://github.com/mzupan/nagios-plugin-mongodb
• last_flush_time• replset_state• index_miss_ratio• collections • database_size • database_indexes • replica_primary
![Page 14: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/14.jpg)
• check_postgres.pl
• archive_ready• autovac_freeze• backends• bloat• checkpoint• cluster_id• commitratio• connection• custom_query
https://bucardo.org/check_postgres/check_postgres.pl.html
• disabled_triggers• disk_space• fsm_pages• prepared_txns• query_runtime• query_time• replicate_row• same_schema• sequence• settings_checksum
![Page 15: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/15.jpg)
• check_mysql_health
• connection-time• uptime• threads-connected• threadcache-hitrate• qcache-hitrate• qcache-lowmem-prunes• bufferpool-hitrate
https://labs.consol.de/de/nagios/check_mysql_health/
• bufferpool-wait-free• log-waits • tablecache-hitrate • table-lock-contention • index-usage • tmp-disk-tables • slow-queries
![Page 16: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/16.jpg)
const MySQLIcingaUsername = "root“
const MySQLIcingaPassword = “root“
template Host "base-host-mysql" {
vars.mysql_health_username = MySQLIcingaUsername
vars.mysql_health_password = MySQLIcingaPassword
vars.os = "Linux“
}
object Host "live-mysql-1" {
import "base-host-mysql"
check_command = "hostalive"
address = "127.0.0.1"
vars.dbtype = "mysql“
}
mysql
Linux
![Page 17: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/17.jpg)
• /*
• * Apply for MySQLish basic connection
• */
• apply Service "mysql_connection" {
• import "generic-service"
• check_interval = 10s
• retry_interval = 30s
• check_command = "mysql_health"
• vars.mysql_health_username = host.vars.mysql_health_username
vars.mysql_health_password = host.vars.mysql_health_password
• vars.mysql_health_mode = "connection-time"
• assign where (host.address || host.address6) && host.vars.dbtype == "mysql“
• }
mysql
![Page 18: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/18.jpg)
Demo
![Page 19: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/19.jpg)
Is this all?
![Page 20: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/20.jpg)
Old Fart
![Page 21: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/21.jpg)
object CheckCommand "mysql_health" {
import "ipv4-or-ipv6"
command = [ PluginContribDir + "/check_mysql_health" ]
arguments = {
"--hostname" = {
value = "$mysql_health_hostname$"
description = "the database server's hostname"
}
"--port" = {
value = "$mysql_health_port$"
description = "the database's port“
...
mysql_health
![Page 22: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/22.jpg)
• ITL (Icinga Template Library)• mysql_health• postgres• mongodb• mssql_health• db2_health• oracle_health• elasticsearch• redis
/usr/share/icinga2/include/plugins-contrib.d/databases.conf
![Page 23: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/23.jpg)
object Host "live-mysql-1" {
import "base-host-mysql"
check_command = "hostalive"
address = "127.0.0.1"
vars.dbtype = "mysql"
/* database checks */
vars.databases["icinga"] = {
mysql_health_warning = 2048//MB
mysql_health_critical = 4096//MB
}
vars.databases["icingaweb2"] = {
mysql_health_warning = 4096 //MB
mysql_health_critical = 8192 //MB
}
}
vars.databases
![Page 24: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/24.jpg)
/*
* Apply for MySQLish database size
*/
apply Service "mysql_size_" for (db_name => config in host.vars.databases) {
import "generic-service"
check_interval = 10s
retry_interval = 30s
check_command = "mysql_health"
vars.mysql_health_username = host.vars.mysql_health_username
vars.mysql_health_password = host.vars.mysql_health_password
vars.mysql_health_mode = "sql"
vars.mysql_health_name = "select sum(data_length + index_length) / 1024 / 1024 from
information_schema.tables where table_schema = '" + db_name + "';"
vars.mysql_health_name2 = "db_size"
vars.mysql_health_units = "MB"
assign where (host.address || host.address6) && host.vars.dbtype == "mysql”
}
vars.databases
![Page 25: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/25.jpg)
Icinga2 - Metrics
![Page 26: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/26.jpg)
New Graphite Schema
icinga2.$host.name$.host.$host.check_command$icinga2.$host.name$.services.$service.name$.$service.check_command$
Threshold metricsenable_send_thresholds
Metadata metricsenable_send_metadata
![Page 27: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/27.jpg)
Demo
![Page 28: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/28.jpg)
Icinga2 - API
![Page 29: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/29.jpg)
![Page 30: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/30.jpg)
• HTTP with RESTful Url Schema
• X.509 and/or Basic Auth
• Create, Modify and Delete objects
• Event Stream based on Types and Filters
RESTful
![Page 31: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/31.jpg)
Demo
![Page 32: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/32.jpg)
Conclusion
![Page 33: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/33.jpg)
• Download Icinga 2 and Icinga Web 2
• Play with the Vagrant boxes
• Rethink your configuration
• Give us feedback
Vagrant boxes
![Page 34: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/34.jpg)
Enjoy your day
![Page 35: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/35.jpg)
www.icinga.org
dev.icinga.org
git.icinga.org
Thank You!@icinga
/icinga
+icinga
![Page 36: Monitoring Open Source Databases with Icinga](https://reader037.fdocuments.net/reader037/viewer/2022100403/58a3035e1a28ab24348bb724/html5/thumbnails/36.jpg)
36
Rate My Session!