forked from extern/egroupware
Check_MK check for SAML metadata existence and age
This commit is contained in:
parent
10b98897d2
commit
00204e1070
29
doc/check-metadata.php
Executable file
29
doc/check-metadata.php
Executable file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
|
||||
$error_time = 3600; // only show for that time as an error
|
||||
$warn_time = 86400; // only warn for that time
|
||||
|
||||
$cmd = basename($_SERVER['argv'][0], '.php');
|
||||
$metadata = '/var/lib/egroupware/default/files/saml/metadata/saml20-idp-remote.php';
|
||||
|
||||
if (!file_exists($metadata))
|
||||
{
|
||||
$status = 2;
|
||||
$verbose = "Missing metadata file $metadata";
|
||||
}
|
||||
elseif (time()-filemtime($metadata) > 86400+60)
|
||||
{
|
||||
$status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = 0;
|
||||
}
|
||||
if (!isset($verbose))
|
||||
{
|
||||
$mtime = new DateTime('@'.filemtime($metadata));
|
||||
$mtime->setTimeZone(new DateTimeZone('Europe/Berlin'));
|
||||
$verbose = "Metadata last refreshed ".$mtime->format('Y-m-d H:i:s');
|
||||
}
|
||||
echo "$status $cmd - $verbose\n";
|
Loading…
Reference in New Issue
Block a user