Commit 95f63aaa authored by David Johnson's avatar David Johnson
Browse files

Never committed this -- the update function now looks for an ignorenodes

file with elab node_ids and does not monitor them.
parent ddf94fab
...@@ -118,6 +118,8 @@ else { ...@@ -118,6 +118,8 @@ else {
usage(); usage();
} }
my $IGNORENODES = "@prefix@/etc/plab/plabmonitord.$plcname.ignore";
# #
# Function prototypes # Function prototypes
# #
...@@ -319,6 +321,20 @@ sub updatenodepool($) { ...@@ -319,6 +321,20 @@ sub updatenodepool($) {
print "Updating node membership in pool: $pool->{'NAME'}\n"; print "Updating node membership in pool: $pool->{'NAME'}\n";
# check our ignore file, and do nothing with these nodes:
my %ignore = ();
if ( -e "$IGNORENODES" ) {
open(IFD,"$IGNORENODES")
or die "could not open $IGNORENODES!";
while (my $line = <IFD>) {
chomp($line);
if ($line =~ /^[\d\w\-\.]+$/) {
$ignore{$line} = 1;
}
}
close(IFD);
}
# XXX: checking node type like this is mighty expensive! Can't we just # XXX: checking node type like this is mighty expensive! Can't we just
# check the base type for this plc? # check the base type for this plc?
# XXX: need to change everything to deal with vnodes rather than pnodes. # XXX: need to change everything to deal with vnodes rather than pnodes.
...@@ -340,6 +356,11 @@ sub updatenodepool($) { ...@@ -340,6 +356,11 @@ sub updatenodepool($) {
# Find any new nodes that need to be added and add them. # Find any new nodes that need to be added and add them.
while (my @row = $qres->fetchrow_array()) { while (my @row = $qres->fetchrow_array()) {
my $pnodename = $row[0]; my $pnodename = $row[0];
if (exists($ignore{$pnodename})) {
next;
}
if (!exists $poolpnodes->{$pnodename} ) { if (!exists $poolpnodes->{$pnodename} ) {
print "Adding $pnodename to pool: $pool->{'NAME'}\n"; print "Adding $pnodename to pool: $pool->{'NAME'}\n";
$poolpnodes->{$pnodename} = {'name' => $pnodename, $poolpnodes->{$pnodename} = {'name' => $pnodename,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment