init III
This commit is contained in:
24
Perl CGI C2/admin/alerts_log.pl
Normal file
24
Perl CGI C2/admin/alerts_log.pl
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/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";
|
||||
Reference in New Issue
Block a user