#!/usr/bin/ruby ################################################### # Written by Florian Seidel # v 0.2 ################################################### # Get Error Level, 255 is good #First Command-Line Argument should be the IP of the IMM IMM_IP = ARGV[0] SNMPv1_community = ARGV[1] # Getting Error Level # 255 = Normal, 0 = Critical, 2 = Non-critical Error, 4 = System-level Error error_level=`snmpget -v 1 -c #{SNMPv1_community} #{IMM_IP} .1.3.6.1.4.1.2.3.51.3.1.4.1.0 -O q -O v` #What is the Problem?! case error_level.chomp.to_i when 255 puts "WLC Hardware Status: OK" puts `snmpwalk -v1 -c #{SNMPv1_community} #{IMM_IP} .1.3.6.1.4.1.2.3.51.3.1.4.2.1.3 -O q -O v` exit 0 when 0 puts "WLC Hardware Status: Critical" puts `snmpwalk -v1 -c #{SNMPv1_community} #{IMM_IP} .1.3.6.1.4.1.2.3.51.3.1.4.2.1.3 -O q -O v` exit 2 when 2 puts "WLC Hardware Status: Warning" puts `snmpwalk -v1 -c #{SNMPv1_community} #{IMM_IP} .1.3.6.1.4.1.2.3.51.3.1.4.2.1.3 -O q -O v` exit 1 when 4 puts "WLC Hardware Status: " puts `snmpwalk -v1 -c #{SNMPv1_community} #{IMM_IP} .1.3.6.1.4.1.2.3.51.3.1.4.2.1.3 -O q -O v` exit 2 else puts "Unknown" puts `snmpwalk -v1 -c #{SNMPv1_community} #{IMM_IP} .1.3.6.1.4.1.2.3.51.3.1.4.2.1.3 -O q -O v` exit 3 end