Nelson , as you can see from this snip of perl code:
nsradmin can do:
. type:NSR group;name:<NAME OF GROUP>
show status
print
then see if the group is idle or running
sub test_running ($)
{
my $CLIENT = shift;
my $ret = "UNKNOWN";
# formulate the query
my @a = (
". type:NSR group;name:tmp_$CLIENT",
"show status",
"print",
);
# prepare the query
my $tmpf="/tmp/CLIENT.mk.group.nsr.$$";
open( TMPF, ">" . $tmpf) || die "FATAL:cannot open: '$tmpf',$!";
print TMPF join("\n",@a) , "\n";
close TMPF;
# run the query
my $NSRADMIN="/usr/sbin/nsradmin";
open(IN,"/usr/sbin/nsradmin -i $tmpf |") || die "FATAL: cannot start
NSRADMIN,$!";
while(<IN>) {
chop;
# filter the result
if( /idle/ ) { $ret = "idle"; last; }
if( /running/ ) { $ret = "running"; last; }
}
close IN;
unlink $tmpf if ( -e $tmpf);
return $ret;
}
Nelson Caparroso wrote:
>
> Anyone in the list got a chunk of code that demonstrates how to check if any
> savegroups are running ?
>
> Thanks!
>
> --
> Note: To sign off this list, send a "signoff" command via email
> to listserv AT listmail.temple DOT edu or visit the list's Web site at
> http://listmail.temple.edu/archives/networker.html where you can
> also view and post messages to the list.
> =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
--
Note: To sign off this list, send a "signoff" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
|