Skip to content
Snippets Groups Projects
Commit 6152ef1c authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

add check_ssl_certs

parent e07de733
No related branches found
No related tags found
No related merge requests found
...@@ -45,11 +45,12 @@ Check locally installed SSL client certificates and warn if the ...@@ -45,11 +45,12 @@ Check locally installed SSL client certificates and warn if the
expiration date comes closer. expiration date comes closer.
SYNTAX: SYNTAX:
`basename $0` [-w WARN_LIMIT] [-c CRITICAL_LIMIT] [-f FILELIST] `basename $0` [-w WARN_LIMIT] [-c CRITICAL_LIMIT] [-f "FILELIST"]
OPTIONS: OPTIONS:
-f FILELIST file filter to find certificates using globbing (default: $filelist) -f FILELIST file filter to find certificates using globbing
(default: $filelist)
To use multiple sources seperate them with a space char. To use multiple sources seperate them with a space char.
Quote your parameter value if you use multiple sources or * char. Quote your parameter value if you use multiple sources or * char.
-w VALUE warning level in days before expiration (default: $iWarn) -w VALUE warning level in days before expiration (default: $iWarn)
...@@ -63,7 +64,7 @@ PARAMETERS: ...@@ -63,7 +64,7 @@ PARAMETERS:
EXAMPLE: EXAMPLE:
`basename $0` -f "/etc/ssl/certs/*example.com.*.cer /etc/somewhere/else/*.cer" `basename $0` -f "/etc/ssl/certs/*example.com.*.cer /somewhere/else/*.cer"
Set 2 folders where to find the client certificates. Set 2 folders where to find the client certificates.
They are seperated by space and both use * for globbing They are seperated by space and both use * for globbing
...@@ -106,7 +107,7 @@ typeset -i iTotal=$( ls -1 $filelist 2>/dev/null | wc -l ) ...@@ -106,7 +107,7 @@ typeset -i iTotal=$( ls -1 $filelist 2>/dev/null | wc -l )
if [ $iTotal -eq 0 ]; then if [ $iTotal -eq 0 ]; then
bHasWarning=true bHasWarning=true
shortstatus="No cert was found." shortstatus="No cert was found."
fullstatus="!!! Warning: no file matches the file filter. HINT: a $filelist." fullstatus="!!! Warning: no file matches the file filter. HINT: adjust your file filter in -f FILEFILTER"
fi fi
for mycert in $( ls -1 $filelist 2>/dev/null ) for mycert in $( ls -1 $filelist 2>/dev/null )
do do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment