Advertisement
fill32

Untitled

Oct 9th, 2015
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. there're 2 fixs needed when using this script:
  2. - in check_mem(): calculate swapused must check for totalswap > 0 because by default on VPS there is no swap so we get the "division by zero"
  3. my $swapused = 0;
  4. if ($mem->{swaptotal} > 0) {
  5. $swapused = sprintf("%.2f", ($mem->{swapused}/$mem->{swaptotal})*100);
  6. }
  7.  
  8. - in check_net(): all the units is B (bytes) not KB (kilobytes), and the error number has no unit:
  9. $return_str .= $device.":".$ttbyt."B ";
  10. $perfdata .= " ".$device."_txbyt=".$txbyt."B ".$device."_txerrs=".$txerrs." ".$device."_rxbyt=".$rxbyt."B ".$device."_rxerrs=".$rxerrs;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement