Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atc0005/go-nagios
Shared Golang package for Nagios plugins
https://github.com/atc0005/go-nagios
go nagios plugin
Last synced: 6 days ago
JSON representation
Shared Golang package for Nagios plugins
- Host: GitHub
- URL: https://github.com/atc0005/go-nagios
- Owner: atc0005
- License: mit
- Created: 2020-01-19T13:33:59.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-25T13:13:48.000Z (11 days ago)
- Last Synced: 2024-10-25T13:34:49.343Z (11 days ago)
- Topics: go, nagios, plugin
- Language: Go
- Homepage:
- Size: 530 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# go-nagios
Shared Golang package for Nagios plugins
[![Latest Release](https://img.shields.io/github/release/atc0005/go-nagios.svg?style=flat-square)](https://github.com/atc0005/go-nagios/releases/latest)
[![Go Reference](https://pkg.go.dev/badge/github.com/atc0005/go-nagios.svg)](https://pkg.go.dev/github.com/atc0005/go-nagios)
[![go.mod Go version](https://img.shields.io/github/go-mod/go-version/atc0005/go-nagios)](https://github.com/atc0005/go-nagios)
[![Lint and Build](https://github.com/atc0005/go-nagios/actions/workflows/lint-and-build.yml/badge.svg)](https://github.com/atc0005/go-nagios/actions/workflows/lint-and-build.yml)
[![Project Analysis](https://github.com/atc0005/go-nagios/actions/workflows/project-analysis.yml/badge.svg)](https://github.com/atc0005/go-nagios/actions/workflows/project-analysis.yml)## Table of contents
- [Status](#status)
- [Overview](#overview)
- [Features](#features)
- [Changelog](#changelog)
- [Examples](#examples)
- [License](#license)
- [Used by](#used-by)
- [References](#references)## Status
Alpha quality.
This codebase is subject to change without notice and may break client code
that depends on it. You are encouraged to [vendor](#references) this package
if you find it useful until such time that the API is considered stable.## Overview
This package contains common types and package-level variables used when
developing Nagios plugins. The intent is to reduce code duplication between
various plugins and help reduce typos associated with literal strings.## Features
- Nagios state constants
- state labels (e.g., `StateOKLabel`)
- state exit codes (e.g., `StateOKExitCode`)
- Nagios `CheckOutputEOL` constant
- provides a consistent newline format for both Nagios Core and Nagios XI
(and presumably other similar monitoring systems)
- Nagios `ServiceState` type
- simple label and exit code "wrapper"
- useful in client code as a way to map internal check results to a Nagios
service state value
- Support for evaluating a given performance data value and setting the final
plugin state exit code
- Support for parsing a given performance data metric string and generating
one or more `PerformanceData` values
- Support for using a "branding" callback function to display application
name, version, or other information as a "trailer" for check results
provided to Nagios
- this could be useful for identifying what version of a plugin determined
the service or host state to be an issue
- Panics from client code are captured and reported
- panics are surfaced as `CRITICAL` state
- service output and error details are overridden to panic prominent
- Optional support for emitting performance data generated by plugins
- if not overridden by client code *and* if using the provided
`nagios.NewPlugin()` constructor, a default `time` performance data metric
is emitted to indicate total plugin runtime
- Support for collecting multiple errors from client code
- Support for explicitly omitting Errors section in `LongServiceOutput`
- this section is automatically omitted if no errors were recorded (by
client code or panic handling code)
- Support for explicitly omitting Thresholds section in `LongServiceOutput`
- this section is automatically omitted if no thresholds were specified by
client code
- Automatically omit `LongServiceOutput` section if not specified by client
code
- Support for overriding text used for section headers/labels## Changelog
See the [`CHANGELOG.md`](CHANGELOG.md) file for the changes associated with
each release of this application. Changes that have been merged to `master`,
but not yet an official release may also be noted in the file under the
`Unreleased` section. A helpful link to the Git commit history since the last
official release is also provided for further review.## Examples
Add this line to your imports like so:
```golang
package mainimport (
"fmt"
"log"
"os""github.com/atc0005/go-nagios"
)
```and pull in a specific version of this library that you'd like to use.
```console
go get github.com/atc0005/[email protected]
```Alternatively, you can use the latest stable tag available to get started:
```console
go get github.com/atc0005/go-nagios@latest
```See for specific examples.
See for
projects that are using this library.## License
From the [LICENSE](LICENSE) file:
```license
MIT LicenseCopyright (c) 2020 Adam Chalkley
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```## Used by
See the Known importers lists below for a dynamically updated list of projects
using either this library or the original project.- [Known importers (pkg.go.dev)](https://pkg.go.dev/github.com/atc0005/go-nagios?tab=importedby)
-## References
- Nagios
-
-
-
-
-
-
- [max plugin output length](https://github.com/NagiosEnterprises/nagioscore/blob/a30a89e0a493da49416e32ed770e294b1fe800f5/include/nagios.h#L274-L280)
- [character restrictions applicable to LongServiceOutput macro](https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/configmain.html#illegal_macro_output_chars)
- Icinga
-
-
- Go Modules
-
-
- Panics, stack traces
-See also the [Used by](#used-by) section for projects known to be using this
package. Please
[report](https://github.com/atc0005/go-nagios/issues/new/choose) any
additional projects that we've missed!