Hi, a slightly improved version of the script: http://dl.dropbox.com/u/6403467/rac11gr2_mon.pl The script should be run as the GI owner or root, sample usage: ./rac11gr2_mon.pl -h /u01/app/11.2.0/grid -d rac11gr2Where -h requires a grid home directory as an argument and -d the database name.
I shut down one of the two nodes (rac001) on my test RAC where two services are defined:
dss - preferred instances rac11gr21 and rac11gr22 oltp - preferred instance rac11gr21 This is a sample output:[grid@rac002 stagearea]$ ./rac11gr2_mon.pl -h /u01/app/11.2.0/grid -d rac11gr2
Instance rac11gr21 is not running on node rac001 Warning: preferred instance status for dss: current: rac11gr22 defined: rac11gr21,rac11gr22 Service dss target mismatch on at least one instance: target: ONLINE state: OFFLINE Warning: prefered instance status for OLTP: current: rac11gr22 defined: rac11gr21 I'm sure there will be situations that are not handled correctly yet. Regards Dimitre
On 15/06/2011 18:20, Radoulov, Dimitre wrote:Hi, I don't think there is a straightforward way for retrieving this info.I wrote a small Perl script using a test rac 11.2 with 2 nodes running on my pc.The script is definitely not production ready yet :)When you have time you could try it and let me know if it's working for you.Regards Dimitre On 14/06/2011 16:10, D'Hooge Freek wrote:Hi,I'm currently bussy writing a perl check to verify the status of a rac database service. When the service is down, while the target status is "online" a critical alert has to be given and when the service is running on an "available" instance instead of the preferred instance a warning has to be given.I have written such a check in the past for 10gR2, but now I need one for 11gR2. As the output formats have changed a lot between 10.2 and 11.2, a large part of the script has to be rewritten (also instances seems to be not as tightly coupled to nodes in 11.2). So I was wondering if there is a (supported) way to query the cluster registry without depending on the output formats of srvctl / crsctl. Which does not seem to be build for easy use in scripts.Information I need to retrieve is which instances and services exists for a database, what the available / preferred instances are of a service, the current state and target of a service and on which instance a service is currently running.
-- //www.freelists.org/webpage/oracle-l