Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
Check traffic usage of an interface Usage: ./check_snmp_traffic # ./check_snmp_traffic localhost private 1 ">1" ">2" WARNING if iface # 1 trafic > 1 Mbit/s, CRITICAL if trafic > 2 Mbit/s # ./check_snmp_traffic localhost private 10 "<11" "<5" WARNING if iface # 10 has trafic < 11 Mbit/s, CRITICAL if trafic < 5 Mbit/s
Current Version
0.2
Last Release Date
2010-01-18
Owner
Luc Duchosal
Compatible With
%./check_snmp_traffic
Check traffic usage of an interface
Version 0.2, Copyright (c) 2010 by Luc Duchosal <[email protected]> Last Modified: 2010-01-18
-------------------------------------------------- Usage: ./check_snmp_traffic <host> <snmp-community> <if-number> <warn> <crit> --------------------------------------------------
<host> Hostname or IP Address <snmp-community> the snmp community string <if-number> Interface number, use snmpwalk to find yours:
snmpwalk -v2c -c community host 1.3.6.1.2.1.31.1.1.1.1 IF-MIB::ifName.1 = STRING: Fa0 This -^- is the interface-number
<warn> warning if bc expression return 1 <crit> critical if bc expression return 1
Exxamples : # ./check_snmp_traffic localhost private 1 " > 1 " " > 2 " WARNING if iface # 1 trafic > 1 Mbit/s, CRITICAL if trafic > 2 Mbits/
# ./check_snmp_traffic localhost private 10 " < 11 " " < 5 " WARNING if iface # 10 has trafic < 11 Mbit/s, CRITICAL if trafic < 5 Mbits/
[root@support libexec]$ ./check_snmp_traffic 172.16.1.8 public 1 ">200" ">400" Traffic OK - .01 Mb/s in Sum|traffic=.01;>200;>400;0; In=.01;;;0; Out=0;;;0; OUTPUT IS:- IF-MIB::ifName.1 = STRING: Vl1 IF-MIB::ifName.5049 = STRING: Lo0 IF-MIB::ifName.10101 = STRING: Gi0/1 IF-MIB::ifName.10102 = STRING: Gi0/2 IF-MIB::ifName.10103 = STRING: Gi0/3 IF-MIB::ifName.10104 = STRING: Gi0/4 IF-MIB::ifName.10105 = STRING: Gi0/5 IF-MIB::ifName.10106 = STRING: Gi0/6 IF-MIB::ifName.10107 = STRING: Gi0/7 IF-MIB::ifName.10108 = STRING: Gi0/8 IF-MIB::ifName.10109 = STRING: Gi0/9 IF-MIB::ifName.10110 = STRING: Gi0/10 IF-MIB::ifName.10111 = STRING: Gi0/11 IF-MIB::ifName.10112 = STRING: Gi0/12 IF-MIB::ifName.10113 = STRING: Gi0/13 IF-MIB::ifName.10114 = STRING: Gi0/14 IF-MIB::ifName.10115 = STRING: Gi0/15 IF-MIB::ifName.10116 = STRING: Gi0/16 IF-MIB::ifName.10117 = STRING: Gi0/17 IF-MIB::ifName.10118 = STRING: Gi0/18 IF-MIB::ifName.10119 = STRING: Gi0/19 IF-MIB::ifName.10120 = STRING: Gi0/20 IF-MIB::ifName.10121 = STRING: Gi0/21 IF-MIB::ifName.10122 = STRING: Gi0/22 IF-MIB::ifName.10123 = STRING: Gi0/23 IF-MIB::ifName.10124 = STRING: Gi0/24 IF-MIB::ifName.10125 = STRING: Gi0/25 IF-MIB::ifName.10126 = STRING: Gi0/26 IF-MIB::ifName.10127 = STRING: Gi0/27 IF-MIB::ifName.10128 = STRING: Gi0/28 But, monitoring Gi0/24 interface gives below error. [root@support libexec]$ ./check_snmp_traffic 172.16.1.8 public 24 ">200" ">400" ./check_snmp_traffic: line 93: [: Such: integer expression expected ./check_snmp_traffic: line 96: [: Such: integer expression expected ./check_snmp_traffic: line 105: [: Such: integer expression expected ./check_snmp_traffic: line 108: [: Such: integer expression expected (standard_in) 1: illegal character: S (standard_in) 1: syntax error ./check_snmp_traffic: line 151: [: -eq: unary operator expected ./check_snmp_traffic: line 154: [: -eq: unary operator expected ./check_snmp_traffic: line 157: [: too many arguments Traffic UNKNOWN - Mb/s in Sum|traffic=;>200;>400;0; In=;;;0; Out=;;;0; I need a common plugin thru which I can monitor all SNMP enabled network devices graph i.e. CIsoc, Fortigate, Juniper, Windows & Linux OSes.
You are basing your math from the sleep timer. However you're forgetting that the snmpget can take longer than 0 seconds, which means that when the second trafbyteOut check runs, it has not been 0 seconds since the sleep of 1 second. What you'll want to do is get the current times and compare the two.
You must be logged in to submit a review.
To:
From:
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!