bclz wrote:
> Use SNMP. You need to find out the SNMP Mib OID for the device, and create 
> template in zenoss.
> 
> On Sun, May 4, 2008 at 9:58 AM, AlexYaung <[EMAIL PROTECTED] ([EMAIL 
> PROTECTED])> wrote:
> 
> > how to monitor EMC or other storage manufacturers's device with zenoss??
> > 
> > For EMC/Clariion Devices like CX3-80 etc. the best method I think is using 
> > navicli oder naviseccli (part of the software delivered with 
> > Storagesystems) in combination with snmp-traps (btw: if you have a look at 
> > BMC/Patrol and HP Openview I think, then you will see that they are exactly 
> > using this method - calling navicli ... ). Monitoring Clariion Devices with 
> > SNMP Only will not work because most information is not provided via snmp.
> > 
> > Currently I am using a zencommand (written as nagios plugin) calling 
> > navisecli:
> > 
> > --- SNIP ----
> > #!/usr/bin/env bash
> > ####################################################################################
> > #
> > # 1. D E S C R I P T I O N
> > #
> > # This Script is a template. Further Information can be found in
> > # the document "xyz".
> > #
> > # EXIT STATUS
> > #
> > #       0  ... successfull script execution
> > #       1 .... error during execution
> > # 
> > ####################################################################################
> > #
> > # 3. V E R S I O N  H I S T O R Y      Current Version  0.1
> > #
> > # Based on Template-Version   $Revision: 38 $
> > # $Date: 2007-12-28 23:00:47 +0100 (Fre, 28 Dez 2007) $
> > #                                       
> > # Date?         Who?          What?
> > #
> > # 2007/04/05    John Doe    Initial Version
> > #
> > ####################################################################################
> > #
> > # 4. D E P E N D E N C I E S
> > # 
> > 
> > ####################################################################################
> > #
> > # 5.  I M P O R T S
> > #
> > 
> > # IMPORTS FROM TEMPLATE
> > 
> > # SCRIPT SPECIFIC IMPORTS
> > 
> > ####################################################################################
> > #
> > # 6. V A R I A B L E S
> > #
> > 
> > # VARIABLES FROM TEMPLATE
> > 
> > QUIET=0                # set to 1 to suppress output to LOGFILE
> > DEBUG=0                # set to 1 to write debug output to LOGFILE
> > 
> > LOGLOCATION="/home/zenoss/var/log"      # path of logfile
> > 
> > DATE=`date "+%Y-%m-%d"`
> > SCRIPT=`basename $0`
> > LOGFILE="$LOGLOCATION/$SCRIPT.log"
> > 
> > # SCRIPT SPECIFIC VARIABLES
> > 
> > # adjust path to commands
> > WGET="/usr/bin/wget"
> > GREP="/bin/grep"
> > NAVICLI="/opt/Navisphere/bin/navicli"
> > NAVISECCLI="/opt/Navisphere/bin/naviseccli"
> > 
> > ################ NORMALY NOTHING TO CHANGE BELOW THIS LINE 
> > ##########################
> > 
> > # global variables
> > 
> > NAGIOSSTATUS="";             # variable holding current status
> > NAGIOSMESSAGE="";            # variable holding addtional message for 
> > nagios error
> > NAGIOSCODE=0;                # variable holding current nagios returncode
> > NAGIOSOUTPUT="";             # string holding output in nagios style
> > 
> > NAGIOSOK_STR="OK";
> > NAGIOSOK_CODE=0;
> > NAGIOSWARNING_STR="WARNING"
> > NAGIOSWARNING_CODE=1;
> > NAGIOSCRITICAL_STR="CRITICAL"
> > NAGIOSCRITICAL_CODE=2;
> > NAGIOSUNKNOWN_STR="UNKNOWN"
> > NAGIOSUNKNOWN_CODE=3;
> > NAGIOSDEPENDENT_STR="DEPENDENT"
> > NAGIOSDEPENDENT_CODE=4;
> > 
> > #####################################################################################
> > #
> > # 7. F U N C T I O N S
> > #
> > 
> > # FUNCTIONS FROM TEMPLATE
> > 
> > ### Function Name               usage
> > ### Description        
> > ###                             
> > ### Prints possible options and/or short description of script
> > 
> > usage()
> > {
> >         echo "The \"do something\" script"
> >         echo "usage: $SCRIPT [-h|-?]" 
> >         echo "  -h,-?   Help, show usage"
> > }
> > 
> > ### Function Name       log_message
> > ### Description
> > ###
> > ### Write message with datetime in the logfile,
> > ### $* is a special variable which will print the rest of the options
> > ### (like message bla ($* then is bla))
> > ### 
> > ### Output will go to file defined with variable LOGFILE
> > ### Output will be suppressed if variable QUIET is not equal 0
> > 
> > log_message() {
> >     if [ $QUIET -eq 0 ]; then
> >         echo `date [EMAIL PROTECTED]:%M:%S` $* >>$LOGFILE
> >     fi
> > }
> > 
> > ### Function Name       error_message
> > ### Description
> > ###
> > ### Write message with datetime to logfile and print message to stderr,
> > ### $* is a special variable which will print the rest of the options
> > ### (like message bla ($* then is bla))
> > ### 
> > 
> > error_message() {
> >     log_message $*
> >     echo "ERROR: $*" >&2
> > }
> > 
> > ### Function Name       debug_message
> > ### Description
> > ###
> > ### Write debug message with script name and time in the logfile,
> > ### $* is a special variable which will print the rest of the options
> > ### (like message bla ($* then is bla))
> > ### 
> > ### Output will go to file defined with variable LOGFILE
> > ### Output will be suppressed if variable DEBUG is not equal 0
> > 
> > debug_message() {
> >         if [ $DEBUG -eq 1 ]; then
> >                 log_message "DEBUG: $*"
> >         fi
> > }
> > 
> > # SCRIPT SPECIFIC FUNCTIONS
> > 
> > ### Function Name       set_nagiosstatus
> > ### Description
> > ###
> > 
> > set_nagiosstatus() {
> >   debug_message "set_nagiosstatus called with $1 $2"
> >   if [ "$NAGIOSSTATUS" != "$NAGIOSCRITICAL_STR" ]; then        # the first 
> > occured critical determines state of device
> >      debug_message "Current nagiosstatus $NAGIOSSTATUS"
> >      if [ "$1" = "$NAGIOSCRITICAL_STR" ]; then
> >           NAGIOSSTATUS="$1"
> >           NAGIOSMESSAGE="$2"
> >           NAGIOSCODE=$NAGIOSCRITICAL_CODE
> >      elif [ "$1" = "$NAGIOSUNKNOWN_STR" ]; then
> >           NAGIOSSTATUS="$1"
> >           NAGIOSMESSAGE="$2"
> >           NAGIOSCODE=$NAGIOSUNKNOWN_CODE
> >      elif [ "$1" = "$NAGIOSWARNING_STR" ]; then
> >           NAGIOSSTATUS="$1"
> >           NAGIOSMESSAGE="$2"
> >           NAGIOSCODE=$NAGIOSWARNING_CODE
> >      elif [ "$1" = "$NAGIOSOK_STR" ]; then
> >           NAGIOSSTATUS="$1"
> >           NAGIOSMESSAGE="$2"
> >           NAGIOSCODE=$NAGIOSOK_CODE
> >      fi
> >   fi 
> >   debug_message "nagiosstatus set to $NAGIOSSTATUS and nagiosmessage to 
> > $NAGIOSMESSAGE"
> > }
> > 
> > ### Function Name       check_nagiosstatus
> > ### Description
> > ###
> > ### Function checks thresholds and state of passed
> > ### Attribute/Value pair
> > ### Existing state will not be overwritte if it
> > ### is already critical
> > ### Critical overwrites Error. Error overwrites Warning
> > 
> > check_nagiosstatus() {
> >    debug_message "check_nagiosstatus called with $1 $2"
> > 
> >    if [ "$COMMAND" = "getcontrol" ]; then
> >       debug_message "checking for parameters of command $COMMAND"
> > 
> >       if [[ "$1" = "SystemFaultLED" && "$2" != "OFF" ]]; then
> >            set_nagiosstatus "$NAGIOSCRITICAL_STR" "State of SystemFaultLED 
> > is $2"
> >       elif [[ "$1" = "StatisticsLogging" && "$2" != "ON" ]]; then
> >            set_nagiosstatus "$NAGIOSCRITICAL_STR" "State of 
> > StatisticsLogging is $2"
> >       elif [[ "$1" = "SPReadCacheState" &&  "$2" != "Enabled" ]]; then
> >            set_nagiosstatus "$NAGIOSWARNING_STR" "State of Read Cache is $2"
> >       elif [[ "$1" = "SPWriteCacheState" && "$2" != "Enabled" ]]; then
> >            set_nagiosstatus "$NAGIOSWARNING_STR" "State of Write Cache is 
> > $2"
> >       fi
> >    fi
> > 
> >    if [ "$COMMAND" = "getcache" ]; then
> >       debug_message "checking for paramaters of command $COMMAND"
> >    fi
> > 
> > }
> > 
> > ### Function Name       create_nagiosoutput
> > ### Description
> > ###
> > 
> > create_nagiosoutput() {
> >     debug_message "create_nagiosoutput called with $1"
> >     ATTRIBUTENAME=`echo "$1" | cut -d":" -f1`
> >     ATTRIBUTEVALUE=`echo "$1" | cut -d":" -f2`
> >     NAGIOSOUTPUT="$NAGIOSOUTPUT $ATTRIBUTENAME=$ATTRIBUTEVALUE"
> >     check_nagiosstatus "$ATTRIBUTENAME" "$ATTRIBUTEVALUE"
> > }
> > 
> > #################################################################
> > # 7. M A I N  ###################################################
> > #################################################################
> > 
> > while getopts "ehqds:c:" option
> > do
> >         case "$option" in
> >                 h)      usage;exit 1;;
> >                 \?)     usage;exit 1;;
> >                 q)      QUIET=1;;
> >                 d)      DEBUG=1;;
> >                 s)      DEVICE=$OPTARG;;
> >                 c)      COMMAND=$OPTARG;;
> >                 e)      NAVICLI=$NAVISECCLI;;
> >                 *)      usage;exit 1;;
> >         esac
> > done
> > 
> > shift   `expr "$OPTIND" - 1`
> > 
> > log_message BEGIN MAIN -----------------------------------------------
> > 
> > if [ -e "$NAVICLI" ]; then
> >    log_message "Reading from storage processor $DEVICE"
> > 
> >    NAGIOSOUTPUT=""
> > 
> >    debug_message "Called with command $COMMAND"
> >    set_nagiosstatus "$NAGIOSOK_STR" "no abnormal conditions detected"   # 
> > be optimistic
> > 
> >    if [ "$COMMAND" = "getcontrol" ]; then
> > 
> >       debug_message "Executing $NAVICLI -h $DEVICE $COMMAND | sed 's/ //g' 
> > | sed 's/CacheState/CacheState:/g'"
> > 
> >       for PARAMETER in `$NAVICLI -h $DEVICE $COMMAND | sed 's/ //g' | sed 
> > 's/CacheState/CacheState:/g'`; do
> >           create_nagiosoutput "$PARAMETER"
> >       done
> >    fi
> > 
> >    if [ "$COMMAND" = "getcache" ]; then
> > 
> >       debug_message "Executing $NAVICLI -h $DEVICE $COMMAND | sed 's/ //g' 
> > | sed s'/=/:/g' | sed 's/CacheState/CacheState:/g'"
> > 
> >       for PARAMETER in `$NAVICLI -h $DEVICE $COMMAND | sed 's/ //g' | sed 
> > s'/=/:/g' | sed 's/CacheState/CacheState:/g'`; do
> >           create_nagiosoutput "$PARAMETER"
> >       done
> >    fi
> > 
> >    debug_message "got: $NAGIOSOUTPUT"
> > else
> >    set_nagiosstatus $NAGIOSCRITICAL_STR "cannot execute $NAVICLI"
> > fi
> > 
> > debug_message "returning exit code: $NAGIOSCODE"
> > 
> > log_message END MAIN -------------------------------------------------
> > 
> > echo "$NAGIOSSTATUS - $DEVICE: $NAGIOSMESSAGE |$NAGIOSOUTPUT"
> > exit $NAGIOSCODE
> > --- SNIP ----
> > 
> > Call this script from an template using 2 Datasources:
> > 
> > ds1:   navicli_check_getcontrol     zen_check_emc.sh -e -q -s 
> > ${dev/manageIp} -c getcontrol
> > ds2:   navicli_check_getcache       zen_check_emc.sh -e -q -s 
> > ${dev/manageIp} -c getcache
> > 
> > and drawing:
> > 
> > Idle time
> > Average Total Queue Length on Request Arrival        
> > IO Requests         check_getcontrol_TotalReads, 
> > check_getcontrol_TotalWrites       TREND_Total_Reads
> > TREND_Total_Writes
> > Blocks      check_getcontrol_Blocks_read, check_getcontrol_Blocks_written   
> > Percent Dirty Pages in Write Cache  check_getcache_HighWatermark, 
> > check_getcache_LowWatermark, check_getcache_PrctDirtyCachePages           
> > Flush on highwatermark
> > Flush on idle-time
> > Write Cache Blocks flushed
> > Write Cache flush Requests
> > 
> > But you are not limited to those. Anything you can get from navicli you can 
> >    monitor this way.
> > 
> > _______________________________________________
> > zenoss-users mailing list
> > [email protected] ([email protected])
> > http://lists.zenoss.org/mailman/listinfo/zenoss-users 
> > (http://lists.zenoss.org/mailman/listinfo/zenoss-users)
> > 
> 
[img][/img]




-------------------- m2f --------------------

Read this topic online here:
http://community.zenoss.com/forums/viewtopic.php?p=19311#19311

-------------------- m2f --------------------



_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to