Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
andyspiegl
byandyspiegl, October 30, 2017
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
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