I’m having issues getting a custom Linux script to report correctly as an application monitor. This is the script in question. I’ve got others working fine.
#!/bin/bash
stat=`grep current /var/www/lab-temps.html |awk '{print $4}'|sort -r|head -1|sed -e s/"\."/" "/g|awk '{print $1}'`;
echo "Statistic: $stat"
date >> /tmp/temptest
echo "Statistic: $stat" >> /tmp/temptest
It’s very rudimentary; search a given page for values and output the highest one as $Statistic only *IF* that value exceeds 70. That works fine:
./temp.sh
Statistic: 75
So my script is absolutely working fine and executing fine, as seen here:
[root@host tmp]# tail -f temptest
Fri Jun 19 12:31:37 PDT 2015
Statistic: 74
Fri Jun 19 12:32:11 PDT 2015
Statistic: 74
However, my Application monitor refuses to fail. Here is my Script Output #1 section:
As near as I can tell from all documentation, this -- with the Statistic of "74" returning -- should be in a Critical state here, yet it's not.
What am I doing wrong? Why isn’t this triggering in the Dashboard? The ultimate goal is to simply have it toss us an email and SMS if the temps exceed x value based upon Statistic. This will be ultra helpful for me as I've got a queue of other number-result based custom linux monitors I want to build out along these lines.