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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
icinga-checks
Commits
02f41b36
Commit
02f41b36
authored
4 months ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
check_conn: no text on STDERR if portcheck fails
parent
39038e1a
Branches
Branches containing commit
No related tags found
1 merge request
!291
Simple task/7546 icinga check für ablaufende gitlab tokens
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
check_conn
+11
-17
11 additions, 17 deletions
check_conn
with
11 additions
and
17 deletions
check_conn
+
11
−
17
View file @
02f41b36
...
...
@@ -9,16 +9,13 @@
# ----------------------------------------------------------------------
# 2021-11-05 v0.0 <axel.hahn@iml.unibe.ch>
# 2023-07-27 v1.1 <axel.hahn@unibe.ch> update help page
# 2025-02-10 v1.2 <axel.hahn@unibe.ch> no text on STDERR if portcheck fails
# ======================================================================
.
$(
dirname
$0
)
/inc_pluginfunctions
export
self_APPVERSION
=
1.1
.
$(
dirname
$0
)
/inc_pluginfunctions
||
exit
1
export
self_APPVERSION
=
1.2
cfgfile
=
$(
dirname
$0
)
/
$(
basename
$0
)
.cfg
out
=
""
# ----------------------------------------------------------------------
...
...
@@ -87,12 +84,9 @@ case "$1" in
*
)
esac
configline
=
$(
ph.getValueWithParam
""
t
"
$@
"
)
configline
=
$(
ph.getValueWithParam
""
t
"
$@
"
test
-z
"
$configline
"
||
cfgfile
=
""
typeset
-i
iWarnings
=
0
typeset
-i
iErrors
=
0
typeset
-i
iOK
=
0
...
...
@@ -107,18 +101,18 @@ do
$myline
"
# --- syntax check of config entry
echo
"
$myline
"
|
grep
-E
"^(tcp|udp)/[a-z][a-z0-9
\.\-
]*/[0-9]*$"
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
if
!
echo
"
$myline
"
|
grep
-E
q
"^(tcp|udp)/[a-z][a-z0-9
\.\-
]*/[0-9]*$"
then
out
=
"
$out
SKIP: INVALID ENTRY"
iWarnings
=
$iWarnings
+1
else
>
/dev/
$myline
if
[
$?
-ne
0
]
;
then
out
=
"
$out
FAILED"
iErrors
=
$iErrors
+1
else
if
timeout
1 bash
-c
"> /dev/
$myline
"
2>/dev/null
then
out
=
"
$out
OK"
iOK
=
$iOK
+1
else
out
=
"
$out
FAILED"
iErrors
=
$iErrors
+1
fi
fi
done
...
...
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