ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello Experts,
i am trying to write script to monitor replication, fir this i need to read the replication log file and report if my condition is matched. i have below file
from the above file, i have two replication streams, one stream is going good another stream is aborted.
my requirement is to read stream id and its status (below line) and report only failed portion (3 lines below stream id (status, source, target).
could you please help me to solve this puzzle.
Hello Experts,
i am trying to write script to monitor replication, fir this i need to read the replication log file and report if my condition is matched. i have below file
from the above file, i have two replication streams, one stream is going good another stream is aborted. my requirement is to read stream id and its status (below line) and report only failed portion (3 lines below stream id (status, source, target).
could you please help me to solve this puzzle.
You've asked similar questions in the past. And since you say you're trying to write a script, why don't you POST that script?? We are not going to write it for you, but will be happy to help. Read the "Question Guidelines" link in my posting signature. You've been a member here for NINE YEARS now.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~#
# let check the status #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~#
setup_environment
ChkRepl
STATUS=`grep -iw 'paused' ${LOG}`
if [ $? -eq 0 ]; then
MESSAGE="${HN}:${CB_ENV}: Coubhcase replicaton is had issue "
grep -A2 'paused' ${LOG}|mailx -s "${MESSAGE}" ${CB_EDBA}
fi
exit;
Does the script do what you wished it to do? If so, then it's good that you posted it and then also please mark the thread as solved. If there are problems, then it might be helpful to describe those problems.
I realise you have only shown a snippet of your script, but am curious how the first line shown would execute correctly if the definition is coming after it is called? Unless of course you have
multiple definitions of the same function?? (if so this could cause a headache in the future)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.