Start a Conversation

Unsolved

This post is more than 5 years old

D

1930

October 13th, 2008 09:00

SRDF monitor script

Looking for a script to monitor the status of a few SRDF groups using SE. Am I pretty much limited to running a job in cron every "X" amount of minutes, or is there a better way to do this. I'm a scripting moron, so if no one has anything already that they can copy/paste for me, would you guys suggest doing a "symrdf -g $GROUP query | egrep "$DEVS" | awk '{print $12}' | sort -u", and if any state besides "Consistent" is returned, to just send an email via mailx? Thanks in advance for any input or advice.

2 Intern

 • 

2.8K Posts

October 13th, 2008 11:00

I think you have also

symrdf -g $GROUP -consistent verify

I'd redirect output to a logfile (or /dev/null) and check for return code ($?).
A return code of "0" (true, in shell) means all devices in DG are consistent :D

9 Legend

 • 

20.4K Posts

October 13th, 2008 15:00

CLI_C_NOT_ALL_CONSISTENT would be return code 70

9 Legend

 • 

20.4K Posts

October 13th, 2008 15:00

i would actually use return codes provided by symcli itself. Command Reference guide has all the return codes.

October 13th, 2008 15:00

I think stefano and i posted at the same time...

October 13th, 2008 15:00

stefano beat me to the punch

Message was edited by:
tonydcdi

2 Intern

 • 

2.8K Posts

October 13th, 2008 22:00

You are right .. in case you want to know if some or all devices aren't consistent you can look at values different from "0" ..

2 Intern

 • 

2.8K Posts

October 13th, 2008 22:00

Next time, don't edit your original post .. even if "duplicated" it's still valuable :-)

59 Posts

October 14th, 2008 07:00

Looking for a script to monitor the status of a few
SRDF groups using SE. Am I pretty much limited to
running a job in cron every "X" amount of minutes, or
is there a better way to do this. I'm a scripting
moron, so if no one has anything already that they
can copy/paste for me, would you guys suggest doing a
"symrdf -g $GROUP query | egrep "$DEVS" | awk '{print
$12}' | sort -u", and if any state besides
"Consistent" is returned, to just send an email via
mailx? Thanks in advance for any input or advice.


Read the symrecover documentation and/or man page, it may provide what you want right out of the box.
No Events found!

Top