Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add capability for check_ceph_health to look a specific checks
This enables the check_ceph_health to select certain monitor health checks (https://docs.ceph.com/en/latest/rados/operations/health-checks/) by providing a regexp. This can be used in conjunction with a/the whitelist. Use-Cases for this might be to have separate checks for certain checks or not check something specific in one check like flags. This can also be converted into a blacklist with the right regexp and I provided an example below how it can be done. I also add the nagios check command check_ceph_health_filtered with `--check` and `--whitelist` as arguments as I can imagine it being useful and they play nicely together. Leaving either argument empty should result in the same result as omitting the corresponding argument. Some dummy examples: $ ./check_ceph_health WARNING: MON_CLOCK_SKEW( clock skew detected on mon.a ) OBJECT_MISPLACED( 1937172/695961284 objects misplaced (0.278%) ) PG_DEGRADED( Degraded data redundancy: 98/695961284 objects degraded (0.000%), 1 pg degraded ) $ ./check_ceph_health --check 'PG_DEGRADED|OBJECT_MISPLACED' WARNING: OBJECT_MISPLACED( 1937172/695961284 objects misplaced (0.278%) ) PG_DEGRADED( Degraded data redundancy: 98/695961284 objects degraded (0.000%), 1 pg degraded ) $ ./check_ceph_health --check '^((?!PG_DEGRADED|OBJECT_MISPLACED).)*$' WARNING: MON_CLOCK_SKEW( clock skew detected on mon.a ) PS: I am not quite happy with the argument name and open to suggestions and candidates for a short version of the `--check` argument. (`-hc`?)
- Loading branch information