#!/usr/bin/perl
# nagios: -epn
# ============================================================================
# ============================== INFO ========================================
# ============================================================================
# Version	: 0.7
# Date		: February 21 2011
# Author	: Michiel Timmers ( michiel.timmers AT gmx.net)
# Based on	: "check_snmp_env" plugin (version 1.3) from Patrick Proy
# Licence 	: GPL - summary below
#
# ============================================================================
# ============================== SUMMARY =====================================
# ============================================================================
# This plugin is an enhancement on the "check_snmp_env" plugin (version 1.3) 
# from Patrick Proy. The basic function of this script is to check various 
# hardware based information, like power supply's, fans, cards, modules etc.
# Although some of the checks in this plugin are also in the "check_snmp_env"
# I strongly suggest using this version as some of the checks in 
# "check_snmp_env" aren't efficient or don't give alarms. 
#
# The default SNMP version has been changed from SNMPv1 to SNMPv2c because 
# of the use of SNMP Bulk option which is more efficient. SNMPv3 also 
# uses SNMP Bulk.
#
# This scrip supports IPv6. You can use the "-6" switch for this.
#
# ============================================================================
# ============================== SUPPORTED CHECKS ============================
# ============================================================================
# The following check are supported: 
#
# NOTE(!!): There are several Cisco checks, on many Cisco devices multiple 
# Cisco checks will functions.
#
# cisco __________: Cisco Systems : Fan, power-supply, voltage, temperature
# ciscoSW ________: Cisco Systems : Card and module status check
# ciscoNEW _______: Cisco Systems : Sensor check for devices that have 
#		    the CISCO-ENTITY-SENSOR-MIB
# nokia __________: Nokia IP : Fan, power-supply
# bc _____________: Blue Coat Systems : Fan, power-supply, voltage, disk
# iron ___________: IronPort : Fan, power-supply, temperature
# foundry ________: Foundry Network : power supply, temperature
# linux __________: lm-sensors : Fan, voltage, temperature, misc
# extremeSW ______: Extreme Networks : Slot, power-supply, fan, temperature
# juniper ________: Juniper Networks : Component status check
# procurve _______: HP ProCurve : Fan, power-supply, temperature
# netscreen ______: NetScreen : Slot, fan, power-supply
# citrix _________: Citrix NetScaler : Fan, , voltage, temperture, 
#		    HA state, SSL engine
# transmode ______: Transmode Systems : Check alarm table that is 
#		    not deactivated and not acknowledged
#
# Check the http://exchange.nagios.org website for new versions.
# For comments, questions, problems and patches send me an 
# e-mail (michiel.timmmers AT gmx.net). 
#
# ============================================================================
# ============================== TODO ========================================
# ============================================================================
# - cisco / ciscoSW and ciscoNEW needs to be checked regarding OID's
# - Make use of "set_status" subroutine for all checks
# - "linux" check does nothing (need all possible values of lm-sensors 
#   to implement). Perhaps IPMI support, currently lacks general MIB
# - "cisco","nokia","ironport","foundry","linux" needs clean up, need 
#   snmpwalks for this
# - Make more use of verbose output
# - utils.pm will become deprecated. Replacement with Nagios::Plugin?
#   What are the effects of switching to Nagios::Plugin?
#
# ============================================================================
# ============================== VERSIONS ====================================
# ============================================================================
# version 0.2 : - juniper: Ignores a "Unknown" PCMCIA card
#		- Juniper: Standby(7) wasn't defined correctly  
#		- juniper: Instance id's longer than 7 characters were failing
# version 0.3 : - ciscoSW: Corrected the modules OID for Cisco
#		- ciscoSW: Standby cards don't generate critical status anymore 
# version 0.4 : - extreme: Added support for devices from Extreme Networks
# version 0.5 : - juniper: J series routers now supported
# version 0.6 : - general: Added support for IPv6 communication
# version 0.7 : - ciscoNEW: Support for Cisco with CISCO-ENTITY-SENSOR-MIB
#		- procurve: Support for HP ProCurve
#		- netscreen: Support for Netscreen
#		- citrix: Support for Citrix Netscaler
#		- transmode: Support for Transmode
#		- extreme: Added checks for power-supply, fans and temperature
#		- juniper: 
#		- bc: Blue Coat check wasn't working properly 
#		- general: Default SNMP version is now SNMPv2c
#		- general: Switch default SNMPv3 from md5/des to sha/aes
#		- general: Lots of small fixes
#
# ============================================================================
# ============================== LICENCE =====================================
# ============================================================================
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>
#
# ============================================================================
# ============================== HELP ========================================
# ============================================================================
# Help : ./check_snmp_environment.pl --help
#
# ============================================================================

use warnings;
use strict;
use Net::SNMP;
use Getopt::Long;
#use lib "/usr/local/nagios/libexec";
#use utils qw(%ERRORS $TIMEOUT);


# ============================================================================
# ============================== NAGIOS VARIABLES ============================
# ============================================================================

my $TIMEOUT 				= 15;	# This is the global script timeout, not the SNMP timeout
my %ERRORS				= ('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
my @Nagios_state 			= ("UNKNOWN","OK","WARNING","CRITICAL"); # Nagios states coding


# ============================================================================
# ============================== OID VARIABLES ===============================
# ============================================================================

# System description 
my $sysdescr				= "1.3.6.1.2.1.1.1.0";			# Global system description

# CISCO-ENVMON-MIB
my $ciscoEnvMonMIB			= "1.3.6.1.4.1.9.9.13"; 		# Cisco env base table
my %CiscoEnvMonState 			= (1,"normal",2,"warning",3,"critical",4,"shutdown",5,"notPresent",6,"notFunctioning"); # Cisco states
my %CiscoEnvMonNagios 			= (1,1 ,2,2 ,3,3 ,4,3 ,5,0, 6,3); 	# Nagios states returned for CIsco states (coded see @Nagios_state).
my $ciscoVoltageTable 			= $ciscoEnvMonMIB.".1.2.1"; 		# Cisco voltage table
my $ciscoVoltageTableIndex 		= $ciscoVoltageTable.".1"; 		#Index table
my $ciscoVoltageTableDesc 		= $ciscoVoltageTable.".2"; 		#Description
my $ciscoVoltageTableValue 		= $ciscoVoltageTable.".3"; 		#Value
my $ciscoVoltageTableState 		= $ciscoVoltageTable.".7"; 		#Status

my $ciscoTempTable 			= $ciscoEnvMonMIB.".1.3.1"; 		# Cisco temprature table
my $ciscoTempTableIndex 		= $ciscoTempTable.".1"; 		#Index table
my $ciscoTempTableDesc 			= $ciscoTempTable.".2"; 		#Description
my $ciscoTempTableValue 		= $ciscoTempTable.".3"; 		#Value
my $ciscoTempTableState 		= $ciscoTempTable.".6"; 		#Status

my $ciscoFanTable 			= $ciscoEnvMonMIB.".1.4.1"; 		# Cisco fan table
my $ciscoFanTableIndex 			= $ciscoFanTable.".1"; 			#Index table
my $ciscoFanTableDesc 			= $ciscoFanTable.".2"; 			#Description
my $ciscoFanTableState 			= $ciscoFanTable.".3";			#Status

my $ciscoPSTable 			= $ciscoEnvMonMIB.".1.5.1";	 	# Cisco power supply table
my $ciscoPSTableIndex 			= $ciscoPSTable.".1"; 			#Index table
my $ciscoPSTableDesc			= $ciscoPSTable.".2"; 			#Description
my $ciscoPSTableState 			= $ciscoPSTable.".3"; 			#Status

# Nokia env mib 
my $nokia_temp_tbl			= "1.3.6.1.4.1.94.1.21.1.1.5";
my $nokia_temp				= "1.3.6.1.4.1.94.1.21.1.1.5.0";
my $nokia_fan_table			= "1.3.6.1.4.1.94.1.21.1.2";
my $nokia_fan_status			= "1.3.6.1.4.1.94.1.21.1.2.1.1.2";
my $nokia_ps_table			= "1.3.6.1.4.1.94.1.21.1.3";
my $nokia_ps_temp			= "1.3.6.1.4.1.94.1.21.1.3.1.1.2";
my $nokia_ps_status			= "1.3.6.1.4.1.94.1.21.1.3.1.1.3";

# Bluecoat env mib
my @bc_SensorCode			= ("","ok","unknown","not-installed","voltage-low-warning","voltage-low-critical",
					"no-power","voltage-high-warning","voltage-high-critical","voltage-high-severe",
					"temperature-high-warning","temperature-high-critical","temperature-high-severe",
					"fan-slow-warning","fan-slow-critical","fan-stopped"); # BC element status returned by MIB
my @bc_status_code			= (3,0,3,3,1,2,2,1,2,2,1,2,2,1,2,2); 	# nagios status equivallent to BC status
my @bc_SensorStatus			= ("","ok","unavailable","nonoperational"); # ok(1),unavailable(2),nonoperational(3)
my @bc_status_sensor			= (3,0,1,2); 				# nagios status equivallent to BC status
my @bc_mesure				= ("","","","Enum","volts","celsius","rpm");
my $bc_sensor_table			= "1.3.6.1.4.1.3417.2.1.1.1.1.1"; 	# sensor table
my $bc_sensor_Units 			= "1.3.6.1.4.1.3417.2.1.1.1.1.1.3"; 	# cf bc_mesure
my $bc_sensor_Scale 			= "1.3.6.1.4.1.3417.2.1.1.1.1.1.4"; 	# * 10^value
my $bc_sensor_Value 			= "1.3.6.1.4.1.3417.2.1.1.1.1.1.5"; 	# value
my $bc_sensor_Code 			= "1.3.6.1.4.1.3417.2.1.1.1.1.1.6"; 	# bc_SensorCode
my $bc_sensor_Status 			= "1.3.6.1.4.1.3417.2.1.1.1.1.1.7"; 	# bc_SensorStatus
my $bc_sensor_Name 			= "1.3.6.1.4.1.3417.2.1.1.1.1.1.9"; 	# name
my $bc_dsk_table 			= "1.3.6.1.4.1.3417.2.2.1.1.1.1";	# disk table
my $bc_dsk_status 			= "1.3.6.1.4.1.3417.2.2.1.1.1.1.3"; 	# bc_DiskStatus - present(1), initializing(2), inserted(3), offline(4), removed(5), not-present(6), empty(7), bad(8), unknown(9
my $bc_dsk_vendor 			= "1.3.6.1.4.1.3417.2.2.1.1.1.1.5"; 	# bc_DiskStatus
my $bc_dsk_product 			= "1.3.6.1.4.1.3417.2.2.1.1.1.1.6"; 	# bc_DiskStatus
my $bc_dsk_serial 			= "1.3.6.1.4.1.3417.2.2.1.1.1.1.8"; 	# bc_DiskStatus
my @bc_DiskStatus			= ("","present","initializing","inserted","offline","removed","not-present","empty","bad","unknown");
my @bc_dsk_status_nagios		= (3,0,1,1,1,1,0,0,2,3);
		
# Iron Port env mib
my $iron_ps_table 			= "1.3.6.1.4.1.15497.1.1.1.8"; 		# power-supply table
my $iron_ps_status 			= "1.3.6.1.4.1.15497.1.1.1.8.1.2"; 	#powerSupplyNotInstalled(1), powerSupplyHealthy(2), powerSupplyNoAC(3), powerSupplyFaulty(4)
my @iron_ps_status_name			= ("","powerSupplyNotInstalled","powerSupplyHealthy","powerSupplyNoAC","powerSupplyFaulty");
my @iron_ps_status_nagios		= (3,3,0,2,2);
my $iron_ps_ha 				= "1.3.6.1.4.1.15497.1.1.1.8.1.3"; 	# ps redundancy status- powerSupplyRedundancyOK(1), powerSupplyRedundancyLost(2)
my @iron_ps_ha_name			= ("","powerSupplyRedundancyOK","powerSupplyRedundancyLost");
my @iron_ps_ha_nagios			= (3,0,1);
my $iron_ps_name 			= "1.3.6.1.4.1.15497.1.1.1.8.1.4"; 	# ps name
my $iron_tmp_table			= "1.3.6.1.4.1.15497.1.1.1.9"; 		# temp table
my $iron_tmp_celcius			= "1.3.6.1.4.1.15497.1.1.1.9.1.2"; 	# temp in celcius
my $iron_tmp_name			= "1.3.6.1.4.1.15497.1.1.1.9.1.3"; 	# name
my $iron_fan_table			= "1.3.6.1.4.1.15497.1.1.1.10"; 	# fan table
my $iron_fan_rpm			= "1.3.6.1.4.1.15497.1.1.1.10.1.2"; 	# fan speed in RPM
my $iron_fan_name			= "1.3.6.1.4.1.15497.1.1.1.10.1.3"; 	# fan name

# Foundry BigIron Router Switch (FOUNDRY-SN-AGENT-MIB)
my $foundry_temp 			= "1.3.6.1.4.1.1991.1.1.1.1.18.0"; 	# Chassis temperature in Deg C *2
my $foundry_temp_warn 			= "1.3.6.1.4.1.1991.1.1.1.1.19.0"; 	# Chassis warn temperature in Deg C *2
my $foundry_temp_crit 			= "1.3.6.1.4.1.1991.1.1.1.1.20.0"; 	# Chassis warn temperature in Deg C *2
my $foundry_ps_table			= "1.3.6.1.4.1.1991.1.1.1.2.1"; 	# PS table
my $foundry_ps_desc			= "1.3.6.1.4.1.1991.1.1.1.2.1.1.2"; 	# PS desc
my $foundry_ps_status			= "1.3.6.1.4.1.1991.1.1.1.2.1.1.3"; 	# PS status
my $foundry_fan_table			= "1.3.6.1.4.1.1991.1.1.1.3.1"; 	# FAN table
my $foundry_fan_desc			= "1.3.6.1.4.1.1991.1.1.1.3.1.1.2"; 	# FAN desc
my $foundry_fan_status			= "1.3.6.1.4.1.1991.1.1.1.3.1.1.3"; 	# FAN status
my @foundry_status 			= (3,0,2); 				# oper status : 1:other, 2: Normal, 3: Failure 

# lm-sensors
my $linux_env_table 			= "1.3.6.1.4.1.2021.13.16"; 		# Global env table
my $linux_temp				= "1.3.6.1.4.1.2021.13.16.2.1"; 	# temperature table
my $linux_temp_descr			= "1.3.6.1.4.1.2021.13.16.2.1.2"; 	# temperature entry description
my $linux_temp_value			= "1.3.6.1.4.1.2021.13.16.2.1.3"; 	# temperature entry value (mC)
my $linux_fan				= "1.3.6.1.4.1.2021.13.16.3.1"; 	# fan table
my $linux_fan_descr			= "1.3.6.1.4.1.2021.13.16.3.1.2"; 	# fan entry description
my $linux_fan_value			= "1.3.6.1.4.1.2021.13.16.3.1.3"; 	# fan entry value (RPM)
my $linux_volt				= "1.3.6.1.4.1.2021.13.16.4.1"; 	# voltage table
my $linux_volt_descr			= "1.3.6.1.4.1.2021.13.16.4.1.2"; 	# voltage entry description
my $linux_volt_value			= "1.3.6.1.4.1.2021.13.16.4.1.3"; 	# voltage entry value (mV)
my $linux_misc				= "1.3.6.1.4.1.2021.13.16.5.1"; 	# misc table
my $linux_misc_descr			= "1.3.6.1.4.1.2021.13.16.5.1.2"; 	# misc entry description
my $linux_misc_value			= "1.3.6.1.4.1.2021.13.16.5.1.3"; 	# misc entry value

# Cisco switches (catalys & IOS)
my $cisco_chassis_card_descr		= "1.3.6.1.4.1.9.3.6.11.1.3"; 		# Chassis card description
my $cisco_chassis_card_slot		= "1.3.6.1.4.1.9.3.6.11.1.7"; 		# Chassis card slot number
my $cisco_chassis_card_state		= "1.3.6.1.4.1.9.3.6.11.1.9"; 		# operating status of card - 1 : Not specified, 2 : Up, 3: Down, 4 : standby
my @cisco_chassis_card_status_text 	= ("Unknown","Not specified","Up","Down","Standby");
my @cisco_chassis_card_status 		= (2,2,0,2,0);
my $cisco_module_descr			= "1.3.6.1.2.1.47.1.1.1.1.13"; 		# Chassis card description
my $cisco_module_slot			= "1.3.6.1.4.1.9.5.1.3.1.1.25"; 	# Chassis card slot number
my $cisco_module_state			= "1.3.6.1.4.1.9.9.117.1.2.1.1.2"; 	# operating status of card - 	1:unknown, 2:ok, 3:disabled, 4:okButDiagFailed, 5:boot, 6:selfTest, 7:failed, 8:missing, 9:mismatchWithParent, 	
										#				10:mismatchConfig, 11:diagFailed, 12:dormant, 13:outOfServiceAdmin, 14:outOfServiceEnvTemp, 15:poweredDown, 16:poweredUp, 
										#				17:powerDenied, 18:powerCycled, 19:okButPowerOverWarning, 20:okButPowerOverCritical, 21:syncInProgress
my @cisco_module_status_text 		=("Unknown", "unknown", "OK", "Disabled", "OkButDiagFailed", "Boot", 
					"SelfTest", "Failed", "Missing", "MismatchWithParent", "MismatchConfig", 
					"DiagFailed", "Dormant", "OutOfServiceAdmin", "OutOfServiceEnvTemp", "PoweredDown", 
					"PoweredUp", "PowerDenied", "PowerCycled", "OkButPowerOverWarning", 
					"OkButPowerOverCritical", "SyncInProgress");
my @cisco_module_status 		= (3,3,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2);

# Juniper routers (JUNOS)
my $juniper_operating_descr		= "1.3.6.1.4.1.2636.3.1.13.1.5"; 	# Component description
my $juniper_operating_state		= "1.3.6.1.4.1.2636.3.1.13.1.6"; 	# Operating status of component-  Unknown(1), Running(2), Ready(3), Reset(4), RunningAtFullSpeed(5), Down(6), Standby(7)
my @juniper_operating_status_text 	= ("--Invalid--","Unknown","Running","Ready","Reset","RunningAtFullSpeed","Down","Standby");
my @juniper_operating_status	 	= (3,3,0,0,1,0,2,0);

# Extreme switches
my $extreme_slot_table			= "1.3.6.1.4.1.1916.1.1.2.2.1"; 
my $extreme_slot_name			= "1.3.6.1.4.1.1916.1.1.2.2.1.2"; 	# Component description
my $extreme_slot_state			= "1.3.6.1.4.1.1916.1.1.2.2.1.5"; 	# Operating status of component - NotPresent(1), testing(2), mismatch(3), failed(4), operational(5), powerdown(6), unknown(7)
my $extreme_slot_serialnumber		= "1.3.6.1.4.1.1916.1.1.2.2.1.6";
my @extreme_slot_state_text		= ("--Invalid--","NotPresent","Testing","Mismatch","Failed","Operational","Powerdown","Unknown");
my @extreme_slot_nagios 		= (3,0,2,2,2,0,2,3);
my $extreme_ps_table			= "1.3.6.1.4.1.1916.1.1.1.27.1";
my $extreme_ps_status			= "1.3.6.1.4.1.1916.1.1.1.27.1.2";
my @extreme_ps_status_text		= ("--Invalid--","notPresent","presentOK","presentNotOK");
my @extreme_ps_nagios		 	= (3,1,0,2);
my $extreme_fan_table			= "1.3.6.1.4.1.1916.1.1.1.9.1";
my $extreme_fan_number			= "1.3.6.1.4.1.1916.1.1.1.9.1.1";
my $extreme_fan_operational		= "1.3.6.1.4.1.1916.1.1.1.9.1.2";
my @extreme_fan_operational_text	= ("--Invalid--","Operational","Not operational");
my @extreme_fan_nagios		 	= (3,0,2);
my $extreme_temperature_alarm		= "1.3.6.1.4.1.1916.1.1.1.7.0";
my @extreme_temperature_alarm_text	= ("--Invalid--","OverTemperature","OK");
my @extreme_temperature_nagios		= (3,2,0);
my $extreme_temperature_current		= "1.3.6.1.4.1.1916.1.1.1.8.0";


# HP ProCurve switches
my $procurve_operating_descr    	= "1.3.6.1.4.1.11.2.14.11.1.2.6.1.7"; 	# Component description
my $procurve_operating_state    	= "1.3.6.1.4.1.11.2.14.11.1.2.6.1.4"; 	# Operating status of component - Unknown(1), Bad(2), Warning(3), Good(4), NotPresent(5)
my @procurve_operating_status_text 	= ("--Invalid--","Unknown","Bad","Warning","Good","NotPresent");
my @procurve_operating_status 		= (3,3,2,1,0,4);

# Netscreen
my $netscreen_slot_operating_descr     = "1.3.6.1.4.1.3224.21.5.1.2"; 		# Component description
my $netscreen_slot_operating_state     = "1.3.6.1.4.1.3224.21.5.1.3"; 		# Operating status of component - Fail?(0), Good(1)
my @netscreen_slot_operating_status_text = ("Fail","Good");
my @netscreen_slot_operating_status 	= (2,0);
my $netscreen_power_operating_descr     = "1.3.6.1.4.1.3224.21.1.1.3"; 		# Component description
my $netscreen_power_operating_state     = "1.3.6.1.4.1.3224.21.1.1.2"; 		# Operating status of component - Fail(0), Good(1)
my @netscreen_power_operating_status_text = ("Fail","Good");
my @netscreen_power_operating_status	= (2,0);
my $netscreen_fan_operating_descr     	= "1.3.6.1.4.1.3224.21.2.1.3";		# Component description
my $netscreen_fan_operating_state     	= "1.3.6.1.4.1.3224.21.2.1.2"; 		# Operating status of component - Fail(0), Good(1), Not Installed(2)
my @netscreen_fan_operating_status_text = ("Fail","Good","Not Installed");
my @netscreen_fan_operating_status 	= (2,0,4);

# Cisco CISCO-ENTITY-SENSOR-MIB
my $cisco_ios_xe_physicaldescr	    	= "1.3.6.1.2.1.47.1.1.1.1.7";
my $cisco_ios_xe_type     	    	= "1.3.6.1.4.1.9.9.91.1.1.1.1.1"; 
my @cisco_ios_xe_type_text	    	= ("not_specified","other","unknown","voltsAC","voltsDC","amperes","watts","hertz","celsius","percent","rpm","cmm","truthvalue","specialEnum","dBm");
my $cisco_ios_xe_scale     	    	= "1.3.6.1.4.1.9.9.91.1.1.1.1.2"; 
my @cisco_ios_xe_scale_power        	= ("0","-24","-21","-18","-15","12","e-9","e-6","e-3","e0","e3","e6","9","12","15","18","21","24"); 
my $cisco_ios_xe_precision	  	= "1.3.6.1.4.1.9.9.91.1.1.1.1.3"; 
my $cisco_ios_xe_value     	    	= "1.3.6.1.4.1.9.9.91.1.1.1.1.4"; 
my $cisco_ios_xe_status     	 	= "1.3.6.1.4.1.9.9.91.1.1.1.1.5"; 
my @cisco_ios_xe_operating_text		= ("--Invalid--","ok","unavailable","nonoperational");
my @cisco_ios_xe_operating_status   	= (0,1,2,3);
my $cisco_ios_xe_threshold_severity	= "1.3.6.1.4.1.9.9.91.1.2.1.1.2";
my $cisco_ios_xe_threshold_value    	= "1.3.6.1.4.1.9.9.91.1.2.1.1.4";

# Citrix NetScaler
my $citrix_desc     			= "1.3.6.1.4.1.5951.4.1.1.41.7.1.1"; 
my $citrix_value     			= "1.3.6.1.4.1.5951.4.1.1.41.7.1.2"; 
my $citrix_high_availability_state     	= "1.3.6.1.4.1.5951.4.1.1.23.24.0"; 
my @citrix_high_availability_state_text	= ("unknown","init","down","up","partialFail","monitorFail","monitorOk","completeFail","dumb","disabled","partialFailSsl","routemonitorFail");
my $citrix_ssl_engine_state     	= "1.3.6.1.4.1.5951.4.1.1.47.2.0"; 
my @citrix_ssl_engine_state_text	= ("down","up");

# Transmode WDM MIB/OID
my $transmode_table			= "1.3.6.1.4.1.11857.1.1.3.2.1"; 	# Alarm Active Entry table
my $transmode_alarm_rack                = "1.3.6.1.4.1.11857.1.1.3.2.1.2"; 	# Non Acked Alarm rack
my $transmode_alarm_slot                = "1.3.6.1.4.1.11857.1.1.3.2.1.3"; 	# Non Acked Alarm slot
my $transmode_alarm_descr               = "1.3.6.1.4.1.11857.1.1.3.2.1.4"; 	# Non Acked Alarm description
my $transmode_alarm_sev                 = "1.3.6.1.4.1.11857.1.1.3.2.1.5"; 	# Non Acked Alarm severity
my $transmode_alarm_unit                = "1.3.6.1.4.1.11857.1.1.3.2.1.6"; 	# Non Acked Alarm unit
my $transmode_alarm_serial              = "1.3.6.1.4.1.11857.1.1.3.2.1.7"; 	# Non Acked Alarm serial
my $transmode_alarm_time_start          = "1.3.6.1.4.1.11857.1.1.3.2.1.8"; 	# Time of Alarm Start
my $transmode_alarm_time_end            = "1.3.6.1.4.1.11857.1.1.3.2.1.9"; 	# Time of Alarm End
my @transmode_alarm_status_text         = ("Indeterminate","Critical","Major","Minor","Warning");
my @transmode_alarm_statuste","Critd
  				|| / in Slot \d/
  	@lajor","Min @tr():te" 	# Time o				|| )ot \p-.ble a
  			("itd
  				|| / in
  				||  	@lawy @ioon2ps_te):
my $c%ad }, logical => { d
  				|| / in
  				||  	@  	}
  
ios_xe_scale_power   
  sub
BBgcal =Ms_xe_sca		||  Report;

sugimk				|-ing_state    	= "tuste".6.1.4.1.194.1.1.2',
  2'ray' => '1.3.6.1.4.1.2435.2.3.9.4.2.1.4.1.3',
  'manual' => '1.3.6.1.4y Network 3.9.4_text	= ("--Invalid-6.1.4.1.2435.2.3.9.4.2.1.4.1.3',.194.1.ual' => '1.3.6.1.4y Network 3.etwarm_slot       			|-i,9  
                )number		6.1.4ythreshold
 etwarm$/;
  		#t6.1.4.1.2435.2, UN_____: l.1.3',
  'manual' => '1.3.6.1.4y Netwoek 3.9*;"S
sub table_ascii {
  my ($self__: l.1.3",
  'many' 8[====ethod},
    sco_condex =_cone_ascii9.4.2.1.4.self)cii {
 cisco_io'many' 8GLPlugin:      o_ => '1,4.1.34 =.8.14.1.1916.1.1.2.2.3.6ates'};
  		 takes longer thail_ldev_segs} = $cs->{'Failed logical device segments'} if exists $cs->{'Failed logical device segments'};
  
  				 allolf)ci         = (-!:  
 ""2>{'Fai.1.4.1.2021.13.16.2.1.2"; 	# temperature 4.1.3'1     =""2>2ritical"ription
my $procuialFailSsl","rout$smtp ) {
			$smtp-my @ 'v2',e_sloi-Utat>			= "1lf->set_statuscode("CRITICAL");
            }
	    $aname = $self->out_name($avar);
            $self->addto_statusinfo_output($avar, "$aname data is missing");
        }
	foreach $dvar (@{$datavars->{$avar}}) {
	    $aname = $self->out_name($dvar);
	    if (defined($datar open f.6 : -  {
        ded supporbose;
			exit $status{CRITICAL};			
	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           