Db2 On Premise and Cloud

 View Only
Expand all | Collapse all

The job feature won't execute bash shell scripts

  • 1.  The job feature won't execute bash shell scripts

    InnerCircle
    Posted Mon April 04, 2022 04:45 PM
    I followed DMC snippet examples listed at url Custom alerts code snippets. From those examples I wrote and have been trying to get the code below to run as a custom alert script job in Data management Console V3.1.7. This alerts purpose is to warn the instance home file system is running out of space. 

    However, no matter what I attempt DMC does not recognize "$" as well as other issues. Can anyone suggest modifications that would allow this bash code to run as a custom alert? Thanks for anyone's help working with DMC.

    My Code attempted (AIX host system)
    typedef homspc=$(df -F %z ${HOME} | tail -n 1 | awk '{print $3}' | tr -d '%')
    df ${HOME}
    echo "${HOME} space Used is ${homspc} percent"
    if [ ${homspc} -gt 90 ]; then
    echo "${Home} space used critical"
    returnValue=-2
    elif [ ${homspc} -gt 80 ]; then
    echo "${Home} space used warning"
    returnValue=-1
    else
    echo "OK"
    returnValue=0
    fi
    exit $returnValue


    Sample from DMC web pages
    freemem=$(cat /proc/meminfo | grep SwapFree  | cut -d ":" -f 2 | awk '{print $1}')
    echo freemem is $freemem
    if [ $freemem -le 1000000 ];
    then  
       echo "critical"  
       returnValue=-2
    elif [ $freemem -le 2000000 ];
        then  
        echo "warning"  
       returnValue=-1
    else  
        echo "OK"  
        returnValue=0 fi
    exit $returnValue


    ------------------------------
    Bill Ferguson
    ------------------------------


  • 2.  RE: The job feature won't execute bash shell scripts

    InnerCircle
    Posted Mon April 04, 2022 05:09 PM
    Disregard this question. The issue has been discoverd, The selection button for choosing between sql scripts and shell scripts is missing from the GUI. I am opening a ticket with IBM support.

    ------------------------------
    Bill Ferguson
    ------------------------------