#!/bin/bash ############################################################# #### Nagios to Prometheus Bridge #### #### Run Nagios check plugins and convert output to #### #### Prometheus textfile collector format #### #### #### #### Author: Phil Connor #### #### Contact: contact@mylinux.work #### #### License: MIT #### #### Version: 1.0 #### #### #### #### Usage: ./nagios-to-prometheus-bridge.sh [OPTIONS] #### ############################################################# # # Converts Nagios plugin output (exit codes + performance data) # into Prometheus .prom files for the node_exporter textfile collector. # # Metrics generated: # - nagios_check_status (exit code: 0=OK, 1=WARNING, 2=CRITICAL, 3=UNKNOWN) # - nagios_check_duration_seconds (execution time) # - nagios_check_last_run_timestamp (unix timestamp) # - nagios_check_perfdata_