Skip to content

Commit

Permalink
Fixed setting of warning limit and some minor issues
Browse files Browse the repository at this point in the history
This will solve issue
#482
and should therefore be applied also to master branch.
  • Loading branch information
Gabriele committed May 16, 2015
1 parent 49317c0 commit a203d4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions plugins/node.d/snmp__if_
Expand Up @@ -192,7 +192,7 @@ if ($ARGV[0] and $ARGV[0] eq "config") {
* 1000 * 1000;
}

$warn = $speed/8;
$warn = ($speed/10)*8;

# Warn at 1/8th of actual speed? Or just remove warning?
# Tempted to set warning at 80%. 80% over 5 minutes is pretty
Expand All @@ -205,7 +205,7 @@ if ($ARGV[0] and $ARGV[0] eq "config") {
}

if (defined ($session->get_single($ifEntryIn64Octets))
&& $session->get_single($ifEntryIn64Octets) != '') {
&& !($session->get_single($ifEntryIn64Octets) eq '')) {

# If we get an answer at the 64 bit OID then this switch
# supports the extended MIB
Expand Down Expand Up @@ -233,7 +233,7 @@ if ($ARGV[0] and $ARGV[0] eq "config") {
print "recv.cdef recv,8,*\n";
print "recv.max $speed\n";
print "recv.min 0\n";
print "recv.warning ", (-$warn), "\n" if defined $warn;
print "recv.warning ", ($warn), "\n" if defined $warn;
print "send.label bps\n";
print "send.type DERIVE\n";
print "send.negative recv\n";
Expand Down
2 changes: 1 addition & 1 deletion plugins/node.d/snmp__if_err_
Expand Up @@ -138,7 +138,7 @@ if ($ARGV[0] and $ARGV[0] eq "config") {
print "recv.type DERIVE\n";
print "recv.graph no\n";
print "recv.min 0\n";
print "recv.warning ", (-$warn), "\n" if defined $warn;
print "recv.warning ", ($warn), "\n" if defined $warn;
print "send.label errors\n";
print "send.type DERIVE\n";
print "send.negative recv\n";
Expand Down

0 comments on commit a203d4b

Please sign in to comment.