]> git.etc.gen.nz Git - spong.git/commitdiff
added type "full" display routines to display_html() (hosts by group)
authorStephen L Johnson <sjohnson@monsters.org>
Wed, 9 Feb 2000 20:13:02 +0000 (20:13 +0000)
committerStephen L Johnson <sjohnson@monsters.org>
Wed, 9 Feb 2000 20:13:02 +0000 (20:13 +0000)
src/lib/Spong/HostGroups.pm

index 9886dd373302abfd4c8a4f0b83d9a089d08c7f41..99c235e946f21b3303fdc27480f625833a2f9d16 100755 (executable)
@@ -255,6 +255,24 @@ sub display_html {
 
    } elsif( $format eq "full" ) {
 
+      # Compute the total list of services running on the various hosts, and
+      # sort them alphabetically (except always put ping first).
+      
+      if( grep( /^ping$/, keys %main::SERVICES ) ) { push( @names, "ping" ); }
+      foreach $service ( sort keys %main::SERVICES ) {
+        push( @names, $service ) unless $service eq "ping"; }
+
+      # Run though reach group and print the hosts for each group
+      foreach $group ( $self->groups() ) { 
+         my $name = $group->name();
+         my $grname = $main::GROUPS{$name}->{'name'};
+
+         # Display the host group table
+         print "<strong>Group - $grname</strong>\n";
+         $group->display_html("standard");
+       
+         print "\n<HR>\n";
+      }
    }
 }