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
8b6b0cd7
Commit
8b6b0cd7
authored
4 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
update check_apache_requests: more checks for response body
parent
7591e745
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
check_apache_requests
+13
-3
13 additions, 3 deletions
check_apache_requests
with
13 additions
and
3 deletions
check_apache_requests
+
13
−
3
View file @
8b6b0cd7
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
# script checks output of "/server-status" and counts scoreboard chars
# script checks output of "/server-status" and counts scoreboard chars
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# 2020-04-09 v1.0 <axel.hahn@iml.unibe.ch>
# 2020-04-09 v1.0 <axel.hahn@iml.unibe.ch>
# 2021-03-11 v1.1 <axel.hahn@iml.unibe.ch> more error checks for output data
# ======================================================================
# ======================================================================
.
`
dirname
$0
`
/inc_pluginfunctions
.
`
dirname
$0
`
/inc_pluginfunctions
...
@@ -38,11 +39,10 @@ ph.require wget
...
@@ -38,11 +39,10 @@ ph.require wget
# --- get /server-status page
# --- get /server-status page
wget
--no-check-certificate
-O
$tmpfile
$url
2>/dev/null
wget
--no-check-certificate
-O
$tmpfile
$url
2>/dev/null
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
ph.abort
"UNKNOWN: url
$url
did not respond a server status.
`
wget
--no-check-certificate
-O
-
-S
$url
`
"
rm
-f
$tmpfile
exit
1
ph.abort
"UNKNOWN: request to url
$url
failed.
`
wget
--no-check-certificate
-O
-
-S
$url
`
"
fi
fi
# set default / override from command line params
# set default / override from command line params
typeset
-i
iWarnLimit
=
`
ph.getValueWithParam 75 w
"
$@
"
`
typeset
-i
iWarnLimit
=
`
ph.getValueWithParam 75 w
"
$@
"
`
typeset
-i
iCriticalLimit
=
`
ph.getValueWithParam 90 c
"
$@
"
`
typeset
-i
iCriticalLimit
=
`
ph.getValueWithParam 90 c
"
$@
"
`
...
@@ -52,6 +52,11 @@ typeset -i iCriticalLimit=` ph.getValueWithParam 90 c "$@"`
...
@@ -52,6 +52,11 @@ typeset -i iCriticalLimit=` ph.getValueWithParam 90 c "$@"`
iStart
=
`
grep
-n
'<pre>'
$tmpfile
|
cut
-f
1
-d
':'
`
iStart
=
`
grep
-n
'<pre>'
$tmpfile
|
cut
-f
1
-d
':'
`
iEnd
=
`
grep
-n
'</pre>'
$tmpfile
|
cut
-f
1
-d
':'
`
iEnd
=
`
grep
-n
'</pre>'
$tmpfile
|
cut
-f
1
-d
':'
`
if
[
$iStart
-eq
0
-o
$iEnd
-eq
0
]
;
then
rm
-f
$tmpfile
ph.abort
"UNKNOWN: url
$url
has no PRE tag for apache scroreboard. I guess it is not a server-status page."
fi
sed
-n
"
${
iStart
}
,
${
iEnd
}
p"
$tmpfile
|
sed
's#<.*>##g'
|
tr
-d
"
\n
"
>
$tmpfile2
sed
-n
"
${
iStart
}
,
${
iEnd
}
p"
$tmpfile
|
sed
's#<.*>##g'
|
tr
-d
"
\n
"
>
$tmpfile2
# <p>Scoreboard Key:<br />
# <p>Scoreboard Key:<br />
...
@@ -73,6 +78,11 @@ sed -n "${iStart},${iEnd}p" $tmpfile | sed 's#<.*>##g' | tr -d "\n" >$tmpfile2
...
@@ -73,6 +78,11 @@ sed -n "${iStart},${iEnd}p" $tmpfile | sed 's#<.*>##g' | tr -d "\n" >$tmpfile2
# total slots available
# total slots available
iSlots
=
`
cat
$tmpfile2
|
wc
-m
`
iSlots
=
`
cat
$tmpfile2
|
wc
-m
`
if
[
$iSlots
-eq
0
]
;
then
rm
-f
$tmpfile
$tmpfile2
ph.abort
"UNKNOWN: url
$url
has no count of slots. I guess it is not a server-status page or option for Extended status is off."
fi
# running apache processes waiting for a request
# running apache processes waiting for a request
iIdle
=
iCount
=
`
sed
-e
"s/[^_]//g"
$tmpfile2
|
wc
-m
`
iIdle
=
iCount
=
`
sed
-e
"s/[^_]//g"
$tmpfile2
|
wc
-m
`
...
...
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