Re: anyone RSCT savy?

From: Adams Kevin J (kevin.adams_at_PHS.COM)
Date: 01/10/05

  • Next message: Thierry ITTY: "pseries boot from external device"
    Date:         Mon, 10 Jan 2005 10:54:08 -0800
    To: aix-l@Princeton.EDU
    
    

    Shawn,

    You're really asking an RMC question.

    What you need is a condition and then a response.

    Here is a script I use. I use a modified syslogevent and notifyevent based
    on IBM's supplied notifyevent.

    This script monitors paging space and / /var /tmp and /audit filesystems.

    Below 50% utilization I email and syslog, and above 50% I email, syslog and
    page. You can change that.

    There is an RMC redbook too.

    This should get you going:

    # cat mkrmc
    #!/bin/ksh

    . /.profile

    mail='E-mail root anytime'
    page='PBH Page event anytime'
    slog='PBH Syslog event anytime'

    mkresponse -n "Page message" \
    -d 1-7 \
    -t 0000-2400 \
    -s "/usr/local/pacificare/rmc/notifyevent $KEVIN_CELL" \
    -e b \
    -r 0 \
    "$page"

    mkresponse -n "Syslog message" \
    -d 1-7 \
    -t 0000-2400 \
    -s "/usr/local/pacificare/rmc/syslogevent" \
    -e b \
    -r 0 \
    "$slog"

    for pct in 25 50 75 85 90 95 100; do

      mkcondition -r "IBM.Host" \
      -e "PctTotalPgSpUsed > $pct" \
      -E "PctTotalPgSpUsed < $pct" \
      -d "More than $pct percent of total paging space in use." \
      -D "Less than $pct percent of total paging space in use." \
      -S "i" \
      -m "l" "PBH Paging percent space used $pct"

      if (( $pct > 50 ));then
        startcondresp "PBH Paging percent space used $pct" \
        "$mail" \
        "$slog" \
        "$page"
      else
        startcondresp "PBH Paging percent space used $pct" \
        "$mail" \
        "$slog"
      fi

      for fs in root audit tmp var; do

        if [[ $fs = root ]]; then
          fs=""
        fi

        mkcondition -r "IBM.FileSystem" \
        -e "PercentTotUsed > $pct" \
        -E "PercentTotUsed < $pct" \
        -d "More than $pct percent of total space in use." \
        -D "Less than $pct percent of total space in use." \
        -s "Name == \"/$fs\"" \
        -S "i" \
        -m "l" "PBH /$fs percent space used $pct"

        if (( $pct > 50 ));then
          startcondresp "PBH /$fs percent space used $pct" \
          "$mail" \
          "$slog" \
          "$page"
        else
          startcondresp "PBH /$fs percent space used $pct" \
          "$mail" \
          "$slog"
        fi
      done

    done

    Kevin Adams

    -----Original Message-----
    From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU] On Behalf Of
    Shawn Bierman
    Sent: Monday, January 10, 2005 6:09 AM
    To: aix-l@Princeton.EDU
    Subject: [aix-l] anyone RSCT savy?

    I would like to run a custom script when a filesystem gets to 75% full.
    However, I cannot find a response that will fire a script off.

    biermans@sf1n03en4:/home/biermans > lsresponse
    Displaying response information:
    ResponseName
    "Broadcast event on-shift"
    "E-mail root off-shift"
    "E-mail root anytime"
    "Log event anytime"
    "Informational notifications"
    "Warning notifications"
    "Critical notifications"
    "Generate SNMP trap"

    I'm just learing about rsct so its likely I'm just overlooking
    something. Can I create a custom response that will run a script?
    tia,
    -shawn

    This electronic message transmission, including any attachments, contains information from PacifiCare Health Systems Inc. which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited.
    If you have received this electronic transmission in error, please notify the sender immediately by a "reply to sender only" message and destroy all electronic and hard copies of the communication, including attachments.


  • Next message: Thierry ITTY: "pseries boot from external device"

    Relevant Pages