New answers tagged


I am not familiar with Nagios and it s operation but if it takes only one exit code at a time, you will need to modify your script a little and run it multiple times. output=$(head -1 file) # read first line sed -i -e '1,1d' file # delete the first line STATE=$(echo $output) if [ $STATE == "OFFLINE" ]; then echo "CRITICAL: STATE is $STATE" ...

Top 50 recent answers are included