Small Nagios plugin to return "debug" environment details
- Project home
- Overview
- Features
- Changelog
- Requirements
- Installation
- Configuration options
- Examples
- License
- References
See our GitHub repo for the latest code, to file an issue or submit improvements for review and potential inclusion into the project.
Nagios plugin used to "echo" back detected environment variables and provided CLI flags/values as part of service check output to help troubleshoot other "real" service checks.
- single binary
- no configuration settings for the binary are required
- echoes back detected environment variables and provided CLI flags/values to help troubleshoot other service checks
See the 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.
The following is a loose guideline. Other combinations of Go and operating systems for building and running tools from this repo may work, but have not been tested.
- Go
- see this project's
go.mod
file for preferred version - this project tests against officially supported Go
releases
- the most recent stable release (aka, "stable")
- the prior, but still supported release (aka, "oldstable")
- see this project's
- GCC
- if building with custom options (as the provided
Makefile
does)
- if building with custom options (as the provided
make
- if using the provided
Makefile
- if using the provided
- Windows 10
- Ubuntu Linux 18.04+
- Download Go
- Install Go
- NOTE: Pay special attention to the remarks about
$HOME/.profile
- NOTE: Pay special attention to the remarks about
- Clone the repo
cd /tmp
git clone https://github.com/atc0005/nagios-debug
cd nagios-debug
- Install dependencies (optional)
- for Ubuntu Linux
sudo apt-get install make gcc
- for CentOS Linux
sudo yum install make gcc
- for Windows
- Emulated environments (easier)
- Skip all of this and build using the default
go build
command in Windows (see below for use of the-mod=vendor
flag) - build using Windows Subsystem for Linux Ubuntu environment and just copy out the Windows binaries from that environment
- If already running a Docker environment, use a container with the Go tool-chain already installed
- If already familiar with LXD, create a container and follow the installation steps given previously to install required dependencies
- Skip all of this and build using the default
- Native tooling (harder)
- see the StackOverflow Question
32127524
link in the References section for potential options for installingmake
on Windows - see the mingw-w64 project homepage link in the
References section for options for installing
gcc
and related packages on Windows
- see the StackOverflow Question
- Emulated environments (easier)
- for Ubuntu Linux
- Build binaries
- for the current operating system, explicitly using bundled dependencies
in top-level
vendor
foldergo build -mod=vendor ./cmd/check_debug/
- for all supported platforms (where
make
is installed)make all
- for use on Windows
make windows
- for use on Linux
make linux
- for the current operating system, explicitly using bundled dependencies
in top-level
- Copy the newly compiled binary from the applicable
/tmp
subdirectory path (based on the clone instructions in this section) below and deploy where needed.- if using
Makefile
- look in
/tmp/nagios-debug/check_debug/
- look in
- if using
go build
- look in
/tmp/nagios-debug/
- look in
- if using
NOTE: Depending on which Makefile
recipe you use the generated binary
may be compressed and have an xz
extension. If so, you should decompress the
binary first before deploying it (e.g., xz -d check_debug-linux-amd64.xz
).
- Download the latest release binaries
- Decompress binaries
- e.g.,
xz -d check_debug-linux-amd64.xz
- e.g.,
- Deploy
- Place
check_debug
in the same location where your distro's package manager places other Nagios plugins- as
/usr/lib/nagios/plugins/check_whois
on Debian-based systems - as
/usr/lib64/nagios/plugins/check_whois
on RedHat-based systems
- as
- Place
NOTE:
DEB and RPM packages are provided as an alternative to manually deploying binaries.
None. Reference the generated binary from within your Nagios configuration as you would another service check. The available environment variables and provided CLI flags/values will be returned as part of the check output.
TODO:
- example of creating a Nagios service check command
- example of referencing the newly created service check command in place of a
real check
- e.g., disk usage with custom thresholds
- e.g., cert check with WARNING and CRITICAL expiration values
From the LICENSE file:
MIT License
Copyright (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.