Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
icinga-passive-client
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
Open Source
icinga-passive-client
Commits
03d3fde7
Commit
03d3fde7
authored
5 months ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
reduce one log line per check
parent
2f687668
Branches
Branches containing commit
No related tags found
1 merge request
!47
reduce one log line per check
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
icinga-cli.sh
+5
-4
5 additions, 4 deletions
icinga-cli.sh
with
5 additions
and
4 deletions
icinga-cli.sh
+
5
−
4
View file @
03d3fde7
...
@@ -295,6 +295,7 @@ function processCheck(){
...
@@ -295,6 +295,7 @@ function processCheck(){
local
iTsEnd
;
typeset
-i
iTsEnd
local
iTsEnd
;
typeset
-i
iTsEnd
local
iTsStart
;
typeset
-i
iTsStart
local
iTsStart
;
typeset
-i
iTsStart
local
httpcode
;
iCheckStart
=
$(
_getUnixTs
)
iCheckStart
=
$(
_getUnixTs
)
...
@@ -392,7 +393,7 @@ function processCheck(){
...
@@ -392,7 +393,7 @@ function processCheck(){
slot
=
"
$(
_getName4Svcathost
${
checkName
}
|
sed
's# #%20#g'
)
"
slot
=
"
$(
_getName4Svcathost
${
checkName
}
|
sed
's# #%20#g'
)
"
_log
"
${
_logPrefix
}
starting POST of data to monitoring server"
#
_log "${_logPrefix} starting POST of data to monitoring server"
_echo POST actions/process-check-result?service
=
${
MY_NAME
}
!
${
slot
}
"
$data
"
_echo POST actions/process-check-result?service
=
${
MY_NAME
}
!
${
slot
}
"
$data
"
_APIcall POST actions/process-check-result?service
=
${
MY_NAME
}
!
${
slot
}
"
$data
"
_APIcall POST actions/process-check-result?service
=
${
MY_NAME
}
!
${
slot
}
"
$data
"
http.responseExport
"
$_response
"
http.responseExport
"
$_response
"
...
@@ -403,13 +404,13 @@ function processCheck(){
...
@@ -403,13 +404,13 @@ function processCheck(){
fi
fi
# --- check if data were sent successfully
# --- check if data were sent successfully
httpcode
=
$(
http.getStatuscode
)
if
http.isOk
>
/dev/null
;
then
if
http.isOk
>
/dev/null
;
then
_log
"
${
_logPrefix
}
rc=
$rc
- OK, response was sent to Icinga
"
_log
"
${
_logPrefix
}
Icinga:
$httpcode
- POST of data was OK
"
else
else
local
httpcode
;
httpcode
=
$(
http.getStatuscode
)
_rc
=
$_rc
+1
_rc
=
$_rc
+1
case
$httpcode
in
case
$httpcode
in
404
)
_FoundErrors+
=
"Icinga
response
$httpcode
: host or service check was not created in Icinga yet ... "
;;
404
)
_FoundErrors+
=
"Icinga
:
$httpcode
: host or service check was not created in Icinga yet ... "
;;
*
)
_FoundErrors+
=
"Icinga response was not sent to Icinga:
$httpcode
... "
;;
*
)
_FoundErrors+
=
"Icinga response was not sent to Icinga:
$httpcode
... "
;;
esac
esac
_echo
_echo
...
...
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