[Mon-commit] mon/clients monshow,1.1.1.1.2.1,1.1.1.1.2.2
Brought to you by:
trockij
From: Jim T. <tr...@us...> - 2004-12-14 22:22:04
|
Update of /cvsroot/mon/mon/clients In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24689 Modified Files: Tag: mon-1-0-0pre1 monshow Log Message: added excludewatch Index: monshow =================================================================== RCS file: /cvsroot/mon/mon/clients/monshow,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** monshow 3 Aug 2004 15:55:53 -0000 1.1.1.1.2.1 --- monshow 14 Dec 2004 22:21:55 -0000 1.1.1.1.2.2 *************** *** 135,139 **** # read config file # ! my ($e, $what) = read_cf ($CF); if ($e ne "") --- 135,139 ---- # read config file # ! my ($e, $what, $excludewatch) = read_cf ($CF); if ($e ne "") *************** *** 186,190 **** expand_watch ($what, $st); ! my $rows = select_table ($what, $st); compose_header ($st->{"state"}); --- 186,190 ---- expand_watch ($what, $st); ! my $rows = select_table ($what, $st, $excludewatch); compose_header ($st->{"state"}); *************** *** 382,385 **** --- 382,386 ---- my ($group, $service); my @RC; + my %excludewatch; my $view = 0; *************** *** 490,493 **** --- 491,497 ---- } + # + # set commands + # if (/^set \s+ (\S+) \s* (\S+)?/ix) { *************** *** 524,527 **** --- 528,535 ---- } + # + # non-set commands + # + elsif (/^watch \s+ (\S+)/x) { *************** *** 547,555 **** } else { my $lnum = $.; close (IN); ! err_die ("error in config file, line $."); } } --- 555,572 ---- } + elsif (/^excludewatch \s+ (.*)$/x) + { + foreach my $w (split (/\s+/, $1)) + { + $excludewatch{$w} = 1; + } + next; + } + else { my $lnum = $.; close (IN); ! err_die ("error in config file, line $lnum"); } } *************** *** 562,566 **** } ! return ("", \@RC); } --- 579,583 ---- } ! return ("", \@RC, \%excludewatch); } *************** *** 955,959 **** sub select_table { ! my ($what, $st) = @_; my @rows; --- 972,976 ---- sub select_table { ! my ($what, $st, $excludewatch) = @_; my @rows; *************** *** 968,972 **** foreach my $service (keys %{$st->{"opstatus"}->{$group}}) { ! push (@rows, [$group, $service]); } } --- 985,989 ---- foreach my $service (keys %{$st->{"opstatus"}->{$group}}) { ! push (@rows, [$group, $service]) unless (exists $excludewatch->{$group}); } } *************** *** 975,979 **** else { ! @rows = @{$what}; } --- 992,999 ---- else { ! foreach my $r (@{$what}) ! { ! push (@rows, $r) unless (exists $excludewatch->{$r->[0]}); ! } } *************** *** 1725,1726 **** --- 1745,1747 ---- $l; } + |