Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.87 KB

File metadata and controls

52 lines (38 loc) · 1.87 KB

check_director_startup_warnings

Detects apply rules that suddenly stop matching after an Icinga Director deployment. The plugin compares the two most recent startup.log files and only reports warnings that are new to the latest stage – pre-existing warnings are ignored.

Requires Python 3.6+ and read access to /var/lib/icinga2/api/packages/director/*/startup.log.

Installation

cp check_director_startup_warnings /usr/lib/nagios/plugins/
chmod 755 /usr/lib/nagios/plugins/check_director_startup_warnings

Options

Option Default Description
-p, --pattern /var/lib/icinga2/api/packages/director/*/startup.log Glob pattern for the startup.log files to compare
-m, --max-lines 10 Maximum number of new warnings to show in the output
-C, --critical off Return CRITICAL instead of WARNING when new warnings are found

Examples

$ check_director_startup_warnings
OK - no new warnings (newer=abc123... older=def456...) |new_warnings=0;1;;0 ...

$ check_director_startup_warnings -C
CRITICAL - 2 new warning(s) in abc123... |new_warnings=2;;1;0 ...
Comparing:
  newer: /var/lib/icinga2/api/packages/director/abc123.../startup.log
  older: /var/lib/icinga2/api/packages/director/def456.../startup.log
warning/config: Apply rule 'ping' for type 'Service' does not match ...

Performance Data

Metric Description
new_warnings New warnings in the latest stage (warn or crit threshold at 1, depending on -C)
total_warnings Total warnings in the newer stage

Configuration

The config/ directory contains two ready-to-use CheckCommand definitions:

  • director_basket.json – import via Icinga Director → Configuration → Baskets → Upload
  • director_startup_warnings_command.conf – DSL definition for use without Director