Random Project

ownership of tmpfile is important

Thanks for the check script.
The only thing I fell for was that the nagios user needs write permissions for the tmpfile. Initially I tried the check script manually which created the tmpfile with owner “root”. All following calls of the script failed to write the interface state to the tmpfile (silently!) which led to strange speed values and a very flat PNP curve. 🙂

I suggest to add the following lines:
if ( open( TMP, “>$tmpfile-$iface” ) ) {
print( TMP “$data{time}:$data{rxbytes}:$data{txbytes}
” );
close( TMP );
}
+ else
+ {
+ print “ERROR: Unable to write $tmpfile-$iface
“;
+ exit $status{UNKNOWN};
+ }

Andy