24 lines
825 B
Perl
24 lines
825 B
Perl
#!/bin/perl
|
|
|
|
use strict;
|
|
use mysql;
|
|
use CGI qw(:standard);
|
|
my $dbh = DBI->connect("DBI:mysql:database=c2;host=localhost",'root','', {RaiseError => 1});
|
|
|
|
print header();
|
|
|
|
print "<html>\n";
|
|
print "<head>\n";
|
|
print "<meta http-equiv='refresh' content='10; alerts_log.pl'>\n";
|
|
print "</head>\n";
|
|
print "<body>\n";
|
|
my $sth = $dbh->prepare("select date,time,msg,host_hostname,service_result from alerts_log order by date desc, time desc");
|
|
$sth->execute;
|
|
print "<table border='1'>\n";
|
|
print "<tr><td>Datum</td><td>Zeit</td><td>Nachricht</td><td>Hostname</td><td>Dienstergebnis</td></tr>\n";
|
|
while (my $ref = $sth->fetchrow_arrayref()) {
|
|
print "<tr><td>$ref->[0]</td><td>$ref->[1]</td><td>$ref->[2]</td><td>$ref->[3]</td><td>$ref->[4]</td></tr>\n";
|
|
}
|
|
print "</table>\n";
|
|
print "</body>\n";
|
|
print "</html>\n"; |