atc0005 / go-nagios

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

Add options for using Go Templates #52

Open atc0005 opened 3 years ago

atc0005 commented 3 years ago

For a few recent projects that use this package I've begun listing out some common service check details in the "Long Service Output" field. While what I'm doing in those projects to build the content for display works, providing an alternative via Go Templates seems like an idea.

Something along the idea of:

type LongServiceOutput struct {
    Topic string
    Details map[string]string
}

I haven't thought it through yet, so maybe a slice field instead of a map or even something else. Either way, having a cleaner way to supply a collection of key/value pairs for more complex service check results would be very handy.