Simple Nagios Plugin of remote HTTP Executor
define command {
command_name check_my_something
command_line $USER1$/check_via_http -H localhost -p 5000 -u /check/something -q 'id=42' -q 'criteria=high'
}
Simple Nagios Plugin of remote HTTP Executor
USAGE:
check_via_http [OPTIONS]
OPTIONS:
-h, --help Print help information
-H, --hostname <HOSTNAME> HTTP hostname [default: localhost]
-p, --port <PORT> HTTP port [default: 80 on http, 443 on https]
-q, --query <QUERY> Queries (multiple times)
-s, --ssl use HTTPS (https://)
-t, --timeout <TIMEOUT> Timeout [default: 15]
-u, --uri <URI> HTTP uri [default: /]
-V, --version Print version information
Rust toolchain is required to build.
cargo build --release
install -c -m 0755 -o root -g root ./target/release/check_via_http /usr/local/nagios/libexec/
Your web server should return JSON as below:
{
"code": 0,
"description": "everyhing is ok"
}
JSON schema
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"required": ["code", "description"],
"additionalProperties": false,
"properties": {
"code": {
"type": "integer",
"minimum": 0,
"maximum": 3
},
"description": {
"type": "string"
}
}
}
The MIT License