atc0005 / go-nagios

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

Sort performance data metrics for consistent output #164

Closed atc0005 closed 1 year ago

atc0005 commented 1 year ago

I don't know that it is a problem, but the changes applied in #158 results in an occasional pseudo-random ordering of emitted performance data metrics.

I'm seeing odd results in Nagios XI when processing metrics emitted by a new plugin that uses v0.10.1 of this package. The problem could be entirely with the parsing logic applied by XI, or there could be a requirement that the metrics emitted by a plugin use a consistent ordering. Further research is needed.

Example of the odd behavior I'm seeing:

image

image

As far as I know, the actual values associated with the metrics are consistent, it is the order of the metrics that is changing between plugin executions.

atc0005 commented 1 year ago

After deploying a prototype build of the plugin that emits metrics in a fixed order, the flip-flopping behavior seen in earlier graphs turned consistent:

image

Pseudo-random metrics order results on the left, static order on the right.