|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /usr/libexec/webmin/mon/ |
Upload File : |
#!/usr/bin/perl
# list_watches.cgi
require './mon-lib.pl';
&ui_print_header(undef, $text{'watches_title'}, "");
$conf = &get_mon_config();
@watches = &find("watch", $conf);
if (@watches) {
print "<table border width=100%>\n";
print "<tr $tb> <td><b>$text{'watches_group'}</b></td> ",
"<td><b>$text{'watches_services'}</b></td> </tr>\n";
foreach $w (@watches) {
print "<tr $cb>\n";
print "<td><a href='edit_watch.cgi?idx=$w->{'index'}'>",
"$w->{'values'}->[0]</a></td> <td>\n";
local @servs = &find("service", $w->{'members'});
foreach $s (@servs) {
local $i = &find_value("interval", $s->{'members'});
print "<a href='edit_service.cgi?idx=$w->{'index'}&",
"sidx=$s->{'index'}'>$s->{'values'}->[0] ($i)",
"</a> | \n";
}
print "<a href='edit_service.cgi?idx=$w->{'index'}&new=1'>",
"$text{'watches_sadd'}</a></td>\n";
print "</tr>\n";
}
print "</table>\n";
}
else {
print "<b>$text{'watches_none'}</b><p>\n";
}
print "<form action=create_watch.cgi>\n";
print "<input type=submit value='$text{'watches_add'}'>\n";
print "<select name=group>\n";
foreach $s (&find("hostgroup", $conf)) {
print "<option>$s->{'values'}->[0]\n";
}
print "</select></form>\n";
&ui_print_footer("", $text{'index_return'});