atc0005 / go-nagios

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

Add support for truncating plugin output to specified size #265

Open atc0005 opened 1 month ago

atc0005 commented 1 month ago

Overview

Make this behavior opt-in.

Allow specifying custom cutoff size (e.g., support older monitoring instances).

Allow also truncating to a default value (current Nagios plugin output length restriction is 8192 bytes).

References

atc0005 commented 1 month ago

Maybe add separate support for determining whether the plugin output accumulated thus far is approaching the cutoff?

Maybe useful to provide methods that allow appending to an output buffer vs accumulating locally and setting directly against LongServiceOutput and ServiceOutput fields.

A variation of the methods could return either the space remaining or whether a specific percentage has been reached?