Skip non-checkable domains in DNS/SSL crons
Filter domain lists in cron/check_dns.php and cron/check_ssl.php to only include domains with statuses 'active' or 'expiring_soon', skipping statuses like available/expired/error/redemption_period/pending_delete. Add logging and stats for domains skipped by status. In check_ssl.php, add a hostnameResolves() helper and skip endpoints whose hostnames don't resolve (incrementing skipped_unresolved). Update summary output to report skipped counts. Remove the data-migration SQL that auto-enabled SSL monitoring and propagated last-checked times from migration 028 to avoid changing monitoring flags during schema upgrade.
This commit is contained in:
@@ -35,24 +35,6 @@ ALTER TABLE domains
|
||||
ADD COLUMN ssl_last_checked TIMESTAMP NULL AFTER dns_last_checked,
|
||||
ADD COLUMN ssl_monitoring_enabled TINYINT(1) NOT NULL DEFAULT 0 COMMENT '1=SSL monitoring active, 0=disabled' AFTER dns_monitoring_enabled;
|
||||
|
||||
-- Preserve existing monitored SSL domains when upgrading
|
||||
UPDATE domains d
|
||||
SET d.ssl_monitoring_enabled = 1
|
||||
WHERE EXISTS (
|
||||
SELECT 1
|
||||
FROM ssl_certificates s
|
||||
WHERE s.domain_id = d.id
|
||||
);
|
||||
|
||||
-- Carry forward the latest stored SSL check time
|
||||
UPDATE domains d
|
||||
JOIN (
|
||||
SELECT domain_id, MAX(last_checked) AS max_checked
|
||||
FROM ssl_certificates
|
||||
GROUP BY domain_id
|
||||
) s ON s.domain_id = d.id
|
||||
SET d.ssl_last_checked = s.max_checked;
|
||||
|
||||
-- Add SSL monitoring cron settings
|
||||
INSERT INTO settings (setting_key, setting_value, `type`, `description`) VALUES
|
||||
('ssl_check_interval_hours', '12', 'string', 'SSL certificate check interval in hours'),
|
||||
|
||||
Reference in New Issue
Block a user