Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
oracle_gg_monitoring_scripts [2019/07/01 13:21] – created andonovj | oracle_gg_monitoring_scripts [2019/10/18 20:04] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====Overview==== | + | Monitoring with scripts |
- | The script | + | Because |
- | * Get data from the GGSCI console | ||
- | * Send mail using mailx(mail), | ||
- | + | | |
- | ===Script=== | + | - [[oracle_golden_gate_table_crosscheck |
- | <sxh bash> | + | |
- | # | + | |
- | EMAIL_LIST=" | + | |
- | + | ||
- | + | ||
- | OIFS=$IFS | + | |
- | IFS=" | + | |
- | " | + | |
- | NIFS=$IFS | + | |
- | + | ||
- | function status { | + | |
- | OUTPUT=`$GG_HOME/ | + | |
- | info all | + | |
- | exit | + | |
- | EOF` | + | |
- | } | + | |
- | + | ||
- | function alert { | + | |
- | for line in $OUTPUT | + | |
- | do | + | |
- | GNAME=$(echo " | + | |
- | GSTAT=$(echo " | + | |
- | GTYPE=$(echo " | + | |
- | if [[ $(echo " | + | |
- | then | + | |
- | case $GTYPE in | + | |
- | " | + | |
- | echo "" | + | |
- | ;; | + | |
- | " | + | |
- | echo "" | + | |
- | ;; | + | |
- | esac | + | |
- | fi | + | |
- | done | + | |
- | } | + | |
- | + | ||
- | export GG_HOME=GG_HOME_PATH; | + | |
- | export ORACLE_HOME=/ | + | |
- | export LD_LIBRARY_PATH=$ORACLE_HOME/ | + | |
- | export ORACLE_SID=SID_NAME | + | |
- | status | + | |
- | alert | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | ===Crontab=== | + | |
- | We can schedule this script to run every 1 hour to see how it goes :) | + | |
- | + | ||
- | <sxh bash> | + | |
- | 0 * * * * /bin/sh / | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | **P.S.** This script will produce a message ONLY when something is STOPPED or ABENDED. NOT IF IT IS WORKING FINE. | + |