Topic
  • 3 replies
  • Latest Post - ‏2011-12-15T16:14:50Z by SystemAdmin
SteveIves
SteveIves
27 Posts

Pinned topic Monitoring harvested resources (IBM.FileSystem)

‏2011-12-15T12:31:22Z |
Hello,

How do I use SA MP and/or RSCT to (for example) take a specific action when a resource in IBM.FileSystem goes read-only?

I know I don't need to define the resources, but I don't know how to make use of them.

Apologies if this is a simple question.

Steve
Updated on 2011-12-15T16:14:50Z at 2011-12-15T16:14:50Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    120 Posts

    Re: Monitoring harvested resources (IBM.FileSystem)

    ‏2011-12-15T14:41:52Z  
    Hi Steve,

    I guess you are looking for a RSCT notify action.
    http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.cmds%2Fdoc%2Faixcmds3%2Fmkcondition.htm

    mkcondition -r IBM.FileSystem -e "Permissions!=rw" -s "Name='<FILE_SYSTEM_NAME>'" -m p COND_FILE

    mkresponse -n message_to_syslog -s "/usr/sbin/rsct/bin/elogevent /var/log/messages" SYSLOG
    (mkresponse -n message_to_operator -s "/usr/sbin/rsct/bin/msgevent root" OPERATOR)
    (mkresponse -n email_to_operator -s "/usr/sbin/rsct/bin/notifyevent '<your_email>'" EMAIL)

    mkcondresp COND_FILE SYSLOG
    startcondresp COND_FILE

    Regards
    Andreas Schauberer
  • SteveIves
    SteveIves
    27 Posts

    Re: Monitoring harvested resources (IBM.FileSystem)

    ‏2011-12-15T15:17:01Z  
    Hi Steve,

    I guess you are looking for a RSCT notify action.
    http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.cmds%2Fdoc%2Faixcmds3%2Fmkcondition.htm

    mkcondition -r IBM.FileSystem -e "Permissions!=rw" -s "Name='<FILE_SYSTEM_NAME>'" -m p COND_FILE

    mkresponse -n message_to_syslog -s "/usr/sbin/rsct/bin/elogevent /var/log/messages" SYSLOG
    (mkresponse -n message_to_operator -s "/usr/sbin/rsct/bin/msgevent root" OPERATOR)
    (mkresponse -n email_to_operator -s "/usr/sbin/rsct/bin/notifyevent '<your_email>'" EMAIL)

    mkcondresp COND_FILE SYSLOG
    startcondresp COND_FILE

    Regards
    Andreas Schauberer
    Andreas,

    Thanks very much. Does this work for Linux on zSeries as well as Aix?

    Also, is there some way to make an SA MP resource dependant upon a harvested resource? We'd liek to stop a resource should a specific FS go RO.

    Thanks,

    Steve
  • SystemAdmin
    SystemAdmin
    120 Posts

    Re: Monitoring harvested resources (IBM.FileSystem)

    ‏2011-12-15T16:14:50Z  
    • SteveIves
    • ‏2011-12-15T15:17:01Z
    Andreas,

    Thanks very much. Does this work for Linux on zSeries as well as Aix?

    Also, is there some way to make an SA MP resource dependant upon a harvested resource? We'd liek to stop a resource should a specific FS go RO.

    Thanks,

    Steve
    Steve,

    the RSCT notifications work on all platforms, but I think its not what you are looking for.

    If you want to depend another resource on this FS going RO then you need to define a IBM.Application "proxy resource" with a new custom start/stop/monitor script.

    Sample script:

    #!/bin/ksh
    UNKNOWN=0
    ONLINE=1
    OFFLINE=2
    Action=${1:-status}
    FileSystem=${2}
    NodeName=${3}
    case ${Action} in
    start)
    # logger -i -t "resource-name" "start order issued"
    RC=0
    ;;
    stop)
    # logger -i -t "resource-name" "stop order issued"
    RC=0
    ;;
    status)
    RW_ATTR=`lsrsrc -s "Name like '$FileSystem' && NodeNameList={'$NodeName'}" -x -t IBM.FileSystem Permissions|tr -d "\""`
    if
    then
    RC=${ONLINE}
    else
    RC=${OFFLINE}
    fi
    #logger -i -t "resource-name" "monitored: $RC"
    ;;
    *)
    echo "Usage: script <start|stop|status>"
    RC=${UNKNOWN}
    ;;
    esac
    exit ${RC}

    Next you need to define an new IBM.Equivalency with NoControl option and this resource as member.
    Then you can depend your other resource with a new relationship to this Equivalency.

    Regards
    Andreas Schauberer