atc0005 / go-nagios

Shared Golang package for Nagios plugins
MIT License
8 stars 3 forks source link

Add support for error annotations #209

Closed atc0005 closed 1 year ago

atc0005 commented 1 year ago

Content below ported from scratch notes. Needs further thought/refinement.


Use existing functionality from the atc0005/check-cert and atc0005/check-vmware projects as inspiration.

Accept an optional map of error to string values which map a collection of advice items to specific errors.

Provide a default map collection that can be returned by a package function, modified by the user and then provided to the AnnotateErrors function.

A standalone function should accept a pointer to nagios.Plugin so that the errors collection can be modified in place like the annotateErrors function from those projects currently does.

A method can make use of this standalone function to provide in place updates to the error collection associated with the nagios.Plugin value.