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
Merge requests
!13
use params directly - not a variable
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
use params directly - not a variable
add-wget-timeout
into
master
Overview
0
Commits
1
Pipelines
0
Changes
2
Merged
use params directly - not a variable
Hahn Axel (hahn)
requested to merge
add-wget-timeout
into
master
Apr 1, 2022
Overview
0
Commits
1
Pipelines
0
Changes
2
0
0
Merge request reports
Viewing commit
fed00911
Show latest version
2 files
+
5
−
16
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
fed00911
use params directly - not a variable
· fed00911
Hahn Axel (hahn)
authored
Apr 1, 2022
check_haproxy_health
+
3
−
9
View file @ fed00911
Edit in single-file editor
Open in Web IDE
Show full file
@@ -19,12 +19,6 @@
cfgfile
=
/etc/haproxy/haproxy.cfg
tmpfile
=
/tmp/check_haproxy_healthcheck_
$$
paramsWget
=
"-T 5 -t 1 --no-check-certificate"
# ^ ^
# | tries = 1
# timeout in seconds
# ----------------------------------------------------------------------
# pre checks
# ----------------------------------------------------------------------
@@ -52,16 +46,16 @@ fi
safeurl
=
$(
echo
$url
|
sed
"s#
\(
://
\)\(
.*@
\)
#
\1
#g"
)
# --- get status page
wget
$paramsWget
-O
$tmpfile
$url
2>/dev/null
wget
-T
5
-t
1
--no-check-certificate
-O
$tmpfile
$url
2>/dev/null
if
[
$?
-ne
0
]
;
then
rm
-f
$tmpfile
ph.abort
"UNKNOWN: url
$safeurl
did not respond.
$(
wget
$paramsWget
-O
-
-S
$url
)
"
ph.abort
"UNKNOWN: url
$safeurl
did not respond.
$(
wget
-T
5
-t
1
--no-check-certificate
-O
-
-S
$url
)
"
fi
grep
"200 OK"
$tmpfile
>
/dev/null
if
[
$?
-ne
0
]
;
then
ph.setStatus
"error"
ph.status
"url
$safeurl
did not contain 200 OK.
$(
wget
$paramsWget
-O
-
-S
$url
)
"
ph.status
"url
$safeurl
did not contain 200 OK.
$(
wget
-T
5
-t
1
--no-check-certificate
-O
-
-S
$url
)
"
else
ph.status
"HA Proxy
$safeurl
is up and running."
fi
Loading