Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
icinga-checks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
icinga-checks
Commits
2e385463
Commit
2e385463
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
update for newer openssl version; update help
parent
38732040
No related branches found
No related tags found
1 merge request
!257
Update for newer openssl
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
check_ssl_certs
+7
-9
7 additions, 9 deletions
check_ssl_certs
with
7 additions
and
9 deletions
check_ssl_certs
+
7
−
9
View file @
2e385463
...
@@ -13,9 +13,11 @@
...
@@ -13,9 +13,11 @@
# 2021-10-06 v0.1 <axel.hahn@iml.unibe.ch> initial version
# 2021-10-06 v0.1 <axel.hahn@iml.unibe.ch> initial version
# 2022-03-16 v0.2 <axel.hahn@iml.unibe.ch> shell fixes; shorten perfdata label
# 2022-03-16 v0.2 <axel.hahn@iml.unibe.ch> shell fixes; shorten perfdata label
# 2022-10-21 v1.3 <axel.hahn@unibe.ch> remove grep: warning: stray \ before white space
# 2022-10-21 v1.3 <axel.hahn@unibe.ch> remove grep: warning: stray \ before white space
# 2024-04-24 v1.4 <axel.hahn@unibe.ch> update for newer openssl version; update help
# ======================================================================
# ======================================================================
.
$(
dirname
$0
)
/inc_pluginfunctions
.
$(
dirname
$0
)
/inc_pluginfunctions
self_APPVERSION
=
1.4
typeset
-i
iWarn
=
14
typeset
-i
iWarn
=
14
typeset
-i
iCrit
=
5
typeset
-i
iCrit
=
5
...
@@ -36,15 +38,11 @@ myDomain=".iml.unibe.ch"
...
@@ -36,15 +38,11 @@ myDomain=".iml.unibe.ch"
# functions
# functions
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# show help text
function
showHelp
(){
function
showHelp
(){
local
_self
;
_self
=
$(
basename
$0
)
cat
<<
EOF
cat
<<
EOF
______________________________________________________________________
$(
ph.showImlHelpHeader
)
CHECK_SSL_CERTS
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
______________________________________________________________________
Check locally installed SSL client certificates and warn if the
Check locally installed SSL client certificates and warn if the
expiration date comes closer.
expiration date comes closer.
...
@@ -118,7 +116,7 @@ for mycert in $( ls -1 $filelist 2>/dev/null )
...
@@ -118,7 +116,7 @@ for mycert in $( ls -1 $filelist 2>/dev/null )
do
do
iCounter
=
$iCounter
+1
iCounter
=
$iCounter
+1
data
=
$(
openssl x509
-noout
-text
-in
$mycert
2>/dev/null
)
data
=
$(
openssl x509
-noout
-text
-in
$mycert
2>/dev/null
)
mySubject
=
$(
echo
"
$data
"
|
grep
"Subject: CN = "
|
grep
-v
","
|
cut
-f
2-
-d
"="
|
cut
-c
2-
)
mySubject
=
$(
echo
"
$data
"
|
grep
"Subject: CN
*
=
*
"
|
grep
-v
","
|
cut
-f
2-
-d
"="
|
tr
-d
' '
)
mySubject2
=
"
${
mySubject
//
${
myDomain
}}
"
mySubject2
=
"
${
mySubject
//
${
myDomain
}}
"
if
[
-z
"
$mySubject
"
]
;
then
if
[
-z
"
$mySubject
"
]
;
then
...
@@ -149,7 +147,7 @@ do
...
@@ -149,7 +147,7 @@ do
fi
fi
shortstatus
=
"
${
shortstatus
}${
result
}
${
mySubject
}
[
${
iLeft
}
d] ; "
shortstatus
=
"
${
shortstatus
}${
result
}
${
mySubject
}
[
${
iLeft
}
d] ; "
fullstatus
=
"
${
fullstatus
}
fullstatus
=
"
${
fullstatus
}
----- [
$iCounter
of
$iTotal
]
${
mySubject
}
- expires in
$iLeft
days
$mySubject2
----- [
$iCounter
of
$iTotal
]
${
mySubject
}
- expires in
$iLeft
days
$(
echo
"
$data
"
|
grep
-E
"(DNS:|Issuer:|Not |Subject:)"
|
sed
's#^ *##g'
)
$(
echo
"
$data
"
|
grep
-E
"(DNS:|Issuer:|Not |Subject:)"
|
sed
's#^ *##g'
)
File:
$mycert
File:
$mycert
"
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment