mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added TLS/SSL Cert checks based on nagios-plugins
This commit is contained in:
20
includes/services/ssl_cert/check.inc
Normal file
20
includes/services/ssl_cert/check.inc
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
$cmd = $config['nagios_plugins'] . "/check_ssl_cert -H ";
|
||||
if( !empty($service['service_ip']) ) {
|
||||
$cmd .= $service['service_ip'];
|
||||
} else {
|
||||
$cmd .= $service['hostname'];
|
||||
}
|
||||
$cmd .= " ".$service['service_param'];
|
||||
|
||||
$check = shell_exec($cmd);
|
||||
list($check, $time) = split("\|", $check);
|
||||
|
||||
if(strstr($check, "SSL_CERT OK")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user