Is there a better way to extract dependency info from resources?

Kashif Shaikh <[email protected]> 20 Jun 2002 17:54:10 -0400
Newsgroups gmane.linux.failsafe
Message-ID <1024610051.3355.31.camel@k2x>
Hello everyone,

I'm trying to write some custom plug-in scripts for custom resources
types I have created.  For many of the resource scripts, I need to
extract dependency information(i.e. list of resources I depend on like
IP_address).  

Yes, I could put the dependent info into the resource I'm creating, and
make my task easier(I would just need to use s2_get_resource_attribute),
but that means I gotta add more options to my custom resource, which I
don't want to do.

Anyways, the current method I am extracting info is through the cluster
manager cli, "cmgr".  To grab dependent data, I do this: "./cmgr -c
"show resource my_resource of resource_types my_resource_type | awk
"\$1==IP_address {print \$2}".  Then I do this again to grab the
specific field within IP_address resource.

The problem with this method, is that any "transaction" with the cdbd
through cmgr takes literally 2-3 seconds(this is on a dev. box...so no
high loads).  Now if I want to extract a couple of fields...this could
easily take 10 seconds or so.  Which is an eternity in Computer Standard
Time(tm) and dear I use this for monitor scripts.

Is there a better and more efficient method than my kludge work?

-- Kashif