Why does this Bash NRPE plugin not return a variable to Nagios?
2
votes
1
answer
4314
views
This script I have here works locally just fine:
#! /bin/bash
volts=
sudo vcgencmd measure_volts core|sed 's/volt=\([0-9\.]*\)V/\1/'
echo -n "BCM2835 SoC Voltage is ${volts}V "
echo "| volts=$volts;1.5;1.5;0;1.5"
However if Nagios tries to get the information it only gets "BCM2835 SoC Voltage is V" as if the variable was not defined.
There are also other plugins which pull the information from files and it works. So I managend to write the information in a temp file and write it back into the variable.
#! /bin/bash
sudo vcgencmd measure_volts core|sed 's/volt=\([0-9\.]*\)V/\1/'>/tmp/volts
volts=$(
Asked by syss
(701 rep)
Aug 12, 2013, 08:56 AM
Last activity: Mar 20, 2019, 01:14 PM
Last activity: Mar 20, 2019, 01:14 PM