Project

General

Profile

Download (1.25 KB) Statistics
| Branch: | Revision:
1
#!/usr/bin/perl
2
# list_watches.cgi
3

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

    
7
$conf = &get_mon_config();
8
@watches = &find("watch", $conf);
9
if (@watches) {
10
	print "<table border width=100%>\n";
11
	print "<tr $tb> <td><b>$text{'watches_group'}</b></td> ",
12
	      "<td><b>$text{'watches_services'}</b></td> </tr>\n";
13
	foreach $w (@watches) {
14
		print "<tr $cb>\n";
15
		print "<td><a href='edit_watch.cgi?idx=$w->{'index'}'>",
16
		      "$w->{'values'}->[0]</a></td> <td>\n";
17
		local @servs = &find("service", $w->{'members'});
18
		foreach $s (@servs) {
19
			local $i = &find_value("interval", $s->{'members'});
20
			print "<a href='edit_service.cgi?idx=$w->{'index'}&",
21
			      "sidx=$s->{'index'}'>$s->{'values'}->[0] ($i)",
22
			      "</a>&nbsp;|&nbsp;\n";
23
			}
24
		print "<a href='edit_service.cgi?idx=$w->{'index'}&new=1'>",
25
		      "$text{'watches_sadd'}</a></td>\n";
26
		print "</tr>\n";
27
		}
28
	print "</table>\n";
29
	}
30
else {
31
	print "<b>$text{'watches_none'}</b><p>\n";
32
	}
33
print "<form action=create_watch.cgi>\n";
34
print "<input type=submit value='$text{'watches_add'}'>\n";
35
print "<select name=group>\n";
36
foreach $s (&find("hostgroup", $conf)) {
37
	print "<option>$s->{'values'}->[0]\n";
38
	}
39
print "</select></form>\n";
40

    
41
&ui_print_footer("", $text{'index_return'});
42

    
(28-28/46)