Write your own Monitoring Plugins
summary
Workshop builds a MySQL Query monitoring plugin from the example check using Linuxfabrik Python libs, adding db_mysql for DB access, the base/text libs for states and output, and a get_state_and_value function that implements Nagios ranges, single-value vs. result-set handling, perfdata and ASCII tables with shortening. Code evolves across eight iterations, produces a 500-line director basket for Icinga Director and successfully queries a real DB (returns 4 hosts returned) and exits with correct states.
AI-written summary · about
chapters (25)
- 0:00Introduction and speakers
- 1:50Why write monitoring plugins
- 4:47Linux Fabric Python libraries overview
- 6:53Setting up the development environment
- 7:37Creating the first plugin version
- 11:15Enhancing plugin description and parameters
- 14:34Testing plugin help function
- 14:58Connecting to MySQL database
- 18:12Configuring MySQL credentials
- 20:21Fetching data and basic output
- 21:06Implementing single value checks
- 24:46Handling multiple row results
- 27:59Adding Nagios range support
- 28:20Improving plugin output formatting
- 34:24Displaying result sets in tables
- 39:07Validating user input and adding perf data
- 41:35Summary of plugin features
- 43:23Making plugin production ready
- 44:06Code quality checks with Pylint
- 44:49Adding icons for web interface
- 45:12Writing plugin documentation
- 49:02Configuring Icinga Director basket
- 51:38Deploying plugin in Icinga Director
- 55:07Project resources and next steps
- 56:12Q&A and closing remarks
