VSP G1000 - Bash Script to report on Hardware Status using SNMP

Document created by Vinod Subramaniam Employee on Sep 24, 2018Last modified by Vinod Subramaniam Employee on Sep 24, 2018
Version 2Show Document
  • View in full screen mode
  1. Using Storage Navigator make the changes as shown below to add the SNMP monitoring station.

 

SNMP.png

2. Obtain the MIB file VSPG1000MIB.txt file from the Customer Tools CDROM and place in the home directory.

    Then run the commands below

 

# yum install net-snmp
# yum install net-snmp-utils
# cd /usr/share/snmp/mibs
# cp ~/VSPG1000MIB.txt
# mkdir -p /root/.snmp/mibs
# cp ~/VSPG1000MIB.txt /root/.snmp/mibs

 

3. Copy the below listing and save it as gethwstatus.sh and chmod +x gethwstatus.sh.

 

#!/bin/bash

export MP_OID=$(snmptranslate -m +USPMIB -IR -On dkcHWProcessor);
export CSW_OID=$(snmptranslate -m +USPMIB -IR -On dkcHWCSW);
export CACHE_OID=$(snmptranslate -m +USPMIB -IR -On dkcHWCache);
export SM_OID=$(snmptranslate -m +USPMIB -IR -On dkcHWSM);
export PS_OID=$(snmptranslate -m +USPMIB -IR -On dkcHWPS);
export BAT_OID=$(snmptranslate -m +USPMIB -IR -On dkcHWBattery);
export FAN_OID=$(snmptranslate -m +USPMIB -IR -On dkcHWFan);
export ENV_OID=$(snmptranslate -m +USPMIB -IR -On dkcHWEnvironment);
export DKU_PS_OID=$(snmptranslate -m +USPMIB -IR -On dkuHWPS);
export DKU_FAN_OID=$(snmptranslate -m +USPMIB -IR -On dkuHWFan);
export DKU_ENV_OID=$(snmptranslate -m +USPMIB -IR -On dkuHWEnvironment);
export DKU_DRIVE_OID=$(snmptranslate -m +USPMIB -IR -On dkuHWDrive);
export SIMRC=$(snmptranslate -m +USPMIB -IR -On eventListREFCODE);
export SIMDATE=$(snmptranslate -m +USPMIB -IR -On eventListDate);
export SIMTIME=$(snmptranslate -m +USPMIB -IR -On eventListTime);

export DC1_VSP_IP="172.17.47.75";
export DC1_VSP_SERIAL="10038";

echo "=======================================================";
echo "Hitachi Pre-Migration Hardware Health Check Script v1.0";
echo "=======================================================";
echo;
echo "=======================================================";
echo "Checking VSP $DC1_VSP_SERIAL for errors ...............";
echo "=======================================================";
echo;
snmpget -v 1 -m USPMIB -c public $DC1_VSP_IP $MP_OID"."$DC1_VSP_SERIAL;
snmpget -v 1 -m USPMIB -c public $DC1_VSP_IP $CSW_OID"."$DC1_VSP_SERIAL;
snmpget -v 1 -m USPMIB -c public $DC1_VSP_IP $CACHE_OID"."$DC1_VSP_SERIAL;
snmpget -v 1 -m USPMIB -c public $DC1_VSP_IP $SM_OID"."$DC1_VSP_SERIAL;
snmpget -v 1 -m USPMIB -c public $DC1_VSP_IP $PS_OID"."$DC1_VSP_SERIAL;
snmpget -v 1 -m USPMIB -c public $DC1_VSP_IP $BAT_OID"."$DC1_VSP_SERIAL;
snmpget -v 1 -m USPMIB -c public $DC1_VSP_IP $FAN_OID"."$DC1_VSP_SERIAL;
snmpget -v 1 -m USPMIB -c public $DC1_VSP_IP $ENV_OID"."$DC1_VSP_SERIAL;
snmpget -v 1 -m USPMIB -c public $DC1_VSP_IP $DKU_PS_OID"."$DC1_VSP_SERIAL;
snmpget -v 1 -m USPMIB -c public $DC1_VSP_IP $DKU_FAN_OID"."$DC1_VSP_SERIAL;
snmpget -v 1 -m USPMIB -c public $DC1_VSP_IP $DKU_ENV_OID"."$DC1_VSP_SERIAL;
snmpget -v 1 -m USPMIB -c public $DC1_VSP_IP $DKU_DRIVE_OID"."$DC1_VSP_SERIAL;
echo;

 

4. Run the script as shown below

 

# ./gethwstatus.sh
=======================================================
Hitachi Pre-Migration Hardware Health Check Script v1.0
=======================================================

=======================================================
Checking VSP 10038 for errors ...............
=======================================================

USPMIB::dkcHWProcessor.10038 = INTEGER: noError(1)
USPMIB::dkcHWCSW.10038 = INTEGER: noError(1)
USPMIB::dkcHWCache.10038 = INTEGER: noError(1)
USPMIB::dkcHWSM.10038 = INTEGER: noError(1)
USPMIB::dkcHWPS.10038 = INTEGER: noError(1)
USPMIB::dkcHWBattery.10038 = INTEGER: noError(1)
USPMIB::dkcHWFan.10038 = INTEGER: noError(1)
USPMIB::dkcHWEnvironment.10038 = INTEGER: serious(3)
USPMIB::dkuHWPS.10038 = INTEGER: noError(1)
USPMIB::dkuHWFan.10038 = INTEGER: noError(1)
USPMIB::dkuHWEnvironment.10038 = INTEGER: noError(1)
USPMIB::dkuHWDrive.10038 = INTEGER: noError(1)


Attachments

    Outcomes