I submitted this patch some time ago, and it doesn't appear in monshow. If
there's a good reason to not include this, please let me know.

This patch adds an option to select groups by watch entries from the
summary page. Using this patch we were able to eliminate almost all view 
files from our configuration.

% diff -c monshow.orig2 monshow
*** monshow.orig2       Thu Aug 23 19:06:44 2001
--- monshow     Thu Aug 23 19:13:35 2001
***************
*** 79,85 ****
  my %opt;
  GetOptions (\%opt, "showall", "auth", "help", "full", "disabled",
        "rcfile=s", "login=s", "server=s", "port=i", "prot=s",
!       "detail=s", "view=s") || usage;

  @ARGV == 0 || usage "No non-switch args expected\n";

--- 79,85 ----
  my %opt;
  GetOptions (\%opt, "showall", "auth", "help", "full", "disabled",
        "rcfile=s", "login=s", "server=s", "port=i", "prot=s",
!       "detail=s", "watch=s", "view=s") || usage;

  @ARGV == 0 || usage "No non-switch args expected\n";

***************
*** 123,128 ****
--- 123,142 ----
      "summary-len"     => 20,
  };

+ #
+ # Interrupt to see if a watch= option was specified
+ #
+ if( $CGI && $QUERY_ARGS{'watch'} )
+ {
+       # make a single entry of a pointer to a single array
+       $what               = [ [ $QUERY_ARGS{"watch"} ] ];
+ }
+ elsif( ! $CGI && $opt{'watch'} )
+ {
+       # make a single entry of a pointer to a single array
+       $what               = [ [ $opt{"watch"} ] ];
+ }
+
  my $GLOBAL = {
      "view-name"               => undef,
  };
***************
*** 181,186 ****
--- 195,207 ----
        compose_table ($rows, $st);

        compose_disabled ($st->{"disabled"}) if ($CF->{"show-disabled"});
+
+       if( $QUERY_ARGS{"watch"} )
+       {
+               $OUT_BUF .= <<EOB;
+       <a href="$ENV{SCRIPT_NAME}">Back to summary table</a><br>
+ EOB
+       }
      }

      elsif ($QUERY_ARGS{"detail"})
***************
*** 1189,1195 ****

  <tr $bgcolor>
     <td> $DEP </td>
!    <td> $GROUP </td>
     <td> <a href="$ENV{SCRIPT_NAME}?detail=$group,$service">$SERVICE</a>
</td>
     <td> <small>$DESC</small> </td>
     <td> $TIME </td>
--- 1210,1216 ----

  <tr $bgcolor>
     <td> $DEP </td>
!    <td> <a href="$ENV{SCRIPT_NAME}?watch=$GROUP">$GROUP</a> </td>
     <td> <a href="$ENV{SCRIPT_NAME}?detail=$group,$service">$SERVICE</a>
</td>
     <td> <small>$DESC</small> </td>
     <td> $TIME </td>
***************
*** 1532,1537 ****
--- 1553,1559 ----

        $OUT_BUF .= <<EOF;
  <p>
+ <a href="$ENV{SCRIPT_NAME}?watch=group">Back to $group table</a>
  <a href="$ENV{SCRIPT_NAME}">Back to summary table</a>
  <p>

-- 
Joe Rhett                                                      Chief Geek
[EMAIL PROTECTED]                                      ISite Services, Inc.

Reply via email to