����JFIF��x�x����'
| Server IP : 78.140.185.180 / Your IP : 216.73.216.170 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/proc/self/root/proc/1630575/root/usr/lib64/nagios/plugins/extra/ |
Upload File : |
#!/usr/bin/perl
use DBI;
use English;
# connect to MySQL database
my $dbh = DBI->connect(
"DBI:mysql:dbname="
. ";mysql_read_default_file=/etc/icinga2/plinc/.my.renewal_equal_plugin.cnf"
. ';mysql_read_default_group=client',
undef, undef,
{
RaiseError => 1,
PrintError=>0,
}
);
# query data from the links table
my @domains = query_links($dbh);
# disconnect from the MySQL database
$dbh->disconnect();
sub query_links{
# query from the links table
my ($dbh) = @_;
my $sql = "SELECT rd.name FROM servers_api_system.domain rd LEFT JOIN servers_registrar.domains cd ON cd.name = rd.name WHERE DATEDIFF(rd.exp_date, cd.exp_date) <> 0 AND cd.name = rd.name AND cd.deleted_status <> 1";
my $sth = $dbh->prepare($sql);
# execute the query
$sth->execute();
my @domains = ();
while(my @row = $sth->fetchrow_array()){
push @domains, $row[0];
}
$sth->finish();
return @domains;
}
if ( @domains != 0 ) {
print "Error: found " . scalar @domains ." domains with unequal renewal dates\n";
print join "\n", @domains;
exit 2;
}
else {
print "OK: found 0 domains with unequal renewal dates\n";
exit 0;
}