Page MenuHomeDevCentral

check-prometheus.sh
No OneTemporary

check-prometheus.sh

#!/bin/sh
# -------------------------------------------------------------
# Monitoring :: NRPE check :: Prometheus
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# Source file: roles/prometheus/monitoring/files/check-prometheus.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
set -e
EXIT_UNKNOWN=3
CHECK_COMMAND="{{ dirs.bin }}/promtool"
CONFIG_FILE="{{ dirs.etc }}/prometheus.yml"
if ! command -v "$CHECK_COMMAND" >/dev/null 2>&1; then
echo "promtool isn't available, can't run check" >&2
exit $EXIT_UNKNOWN
fi
# As far as tested, promtool exits with 0 or 1.
# Parsing and success messages are sent to stdout.
# Parsing and validation errors are sent to stderr.
"$CHECK_COMMAND" check config "$CONFIG_FILE" > /dev/null

File Metadata

Mime Type
text/x-shellscript
Expires
Fri, Nov 21, 16:17 (18 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3186262
Default Alt Text
check-prometheus.sh (1 KB)

Event Timeline