drewkerrigan / nagios-http-json

A generic plugin for Nagios which checks json values from a given HTTP endpoint against argument specified rules and determines the status and performance data for that service.
Other
67 stars 60 forks source link

Add flag to increase verbosity and flag to override unreachable state #86

Closed martialblog closed 4 months ago

martialblog commented 5 months ago

This PR adds the following features:

Add verbose flag and function that can be used to enhance output more precisely

Before we only had a boolean debug flag, good for debugging errors. The verbose flag can be used more precisely (-v -vvv) to specify when something should be printed. This is useful for adding more output whilst avoiding full debug output that contains secrets.

Fixes #83

Add flag to override URL unreachable state

I refactored the Nagios helper a bit to integrate this functionality a bit simpler. Before we had distinct methods on the helper that added warn,crit,unko message, now there's a general method that takes an int as parameter. This way we avoid if-else structures for the new functionality.

Fixes #82

Plus I refactored the main function to be a bit leaner and added tests for the TLS options

martialblog commented 4 months ago

Currently testing this and waiting for some third party feedback