Project

General

Profile

Download (832 Bytes) Statistics
| Branch: | Revision:
1
#!/usr/bin/perl
2
# list_groups.cgi
3
# Display a list of all host groups and their members
4

    
5
require './mon-lib.pl';
6
&ui_print_header(undef, $text{'groups_title'}, "");
7

    
8
$conf = &get_mon_config();
9
@groups = &find("hostgroup", $conf);
10

    
11
print "<form action=save_groups.cgi method=post>\n";
12
print "<table border width=100%>\n";
13
print "<tr $tb> <td><b>$text{'groups_group'}</b></td> ",
14
      "<td><b>$text{'groups_members'}</b></td> </tr>\n";
15
$i = 0;
16
foreach $g (@groups, { }) {
17
	local ($gn, @gm) = @{$g->{'values'}};
18
	print "<tr $cb>\n";
19
	print "<td><input name=group_$i size=20 value='$gn'></td>\n";
20
	print "<td><input name=members_$i size=60 value='",
21
		join(" ", @gm),"'></td>\n";
22
	print "</tr>\n";
23
	$i++;
24
	}
25
print "</table>\n";
26
print "<input type=submit value='$text{'save'}'></form>\n";
27

    
28
&ui_print_footer("", $text{'index_return'});
29

    
(25-25/46)