atc0005 / go-nagios

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

Add support for converting PerformanceData.Label field values with spaces to underscores #177

Open atc0005 opened 1 year ago

atc0005 commented 1 year ago

Current doc comments:

https://github.com/atc0005/go-nagios/blob/feba50ddfe7df8d5999ff08c995f7385a97d409e/nagios.go#L115-L126

The Performance Data output is currently hard-coded to preserve any spaces in the Label field and explicitly add single quotes:

https://github.com/atc0005/go-nagios/blob/feba50ddfe7df8d5999ff08c995f7385a97d409e/nagios.go#L204-L212

A useful option would be to allow (via client code toggle) automatic conversion of a label value of percent packet loss to percent_packet_loss.

Not sure if automatic conversion of these values would be useful or just confusing: