Diff -- /var/www/vhosts/3dshawn.com/site1/db_fails.cgi

O Operator
Diff

/var/www/vhosts/3dshawn.com/site1/db_fails.cgi

added on local at 2026-07-10 18:57:29

Added
+20
lines
Removed
-0
lines
Context
0
unchanged
Blobs
from
to 917c9ce13fef
Restore this content →
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.
1#!/usr/bin/perl
2use strict; use warnings; use CGI ();
3use MODS::Config; use MODS::DBConnect; use MODS::Template; use MODS::PageWrapper;
4my $db = MODS::DBConnect->new; my $tpl = MODS::Template->new;
5$|=1; print "Content-Type: text/html; charset=utf-8\nCache-Control: no-cache\n\n";
6my $dbh = $db->db_connect or die "DB connect failed\n";
7my @rows = $db->db_readwrite_multiple($dbh, q~
8 SELECT f.failed_scan_logs_id AS id, f.db_name, f.date_time, s.server_name
9 FROM FAILED_SCAN_LOGS f LEFT JOIN SERVERS s ON s.server_id = f.server_id
10 ORDER BY f.date_time DESC LIMIT 200
11~, __FILE__, __LINE__);
12my $total = scalar @rows;
13$db->db_disconnect($dbh);
14
15my @body = $tpl->template('db_fails.html',
16 { rows => \@rows, has_rows => $total ? 1 : 0, total => $total });
17MODS::PageWrapper->new->wrapper(
18 page_title => 'DB scan failures', page_key => '',
19 body_html => join('', @body), userinfo => { display_name => 'Operator' },
20);