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
5db78f94
Commit
5db78f94
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
check writable response file; output with _log instead of echo
parent
48141cfb
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
icinga-cli.sh
+12
-7
12 additions, 7 deletions
icinga-cli.sh
with
12 additions
and
7 deletions
icinga-cli.sh
+
12
−
7
View file @
5db78f94
...
...
@@ -314,19 +314,19 @@ function processCheck(){
eval
$myFullscript
$myparams
>
$_outfile
rc
=
$?
if
[
!
-w
$_outfile
]
;
then
echo
"ERROR: file
$_outfile
is not writable. Maybe the setup is inclomplete or someone created a file as root... just guessing
."
ls
-ld
${
dir_data
}
$_outfile
exit
1
_log
"
${
_logPrefix
}
ERROR: output file
$_outfile
is not writable
."
_log
"
${
_logPrefix
}
$(
ls
-ld
${
dir_data
}
$_outfile
)
"
exit
1
fi
typeset
-i
local
iTsEnd
=
`
date
+%s
`
outPerfdata
=
`
grep
'|'
$_outfile
|
cut
-f
2
-d
'|'
`
#
outPerfdata=`grep '|' $_outfile | cut -f 2 -d '|'`
echo
echo
--------
check output:
cat
$_outfile
echo
echo
--------
extracted performance data:
echo
$outPerfdata
echo
#
echo -------- extracted performance data:
#
echo $outPerfdata
#
echo
_log
"
${
_logPrefix
}
check command finished with returncode
$rc
"
_rc
=
$_rc
+
$rc
...
...
@@ -359,6 +359,11 @@ function processCheck(){
echo
POST actions/process-check-result?service
=
${
myHost
}
!
${
slot
}
"
$data
"
_APIcall POST actions/process-check-result?service
=
${
myHost
}
!
${
slot
}
"
$data
"
http.responseExport
"
$_response
"
if
[
!
-w
"
$_response
"
]
;
then
_log
"
${
_logPrefix
}
ERROR: responsefile
$_response
is not writable."
_log
"
${
_logPrefix
}
$(
ls
-ld
${
dir_data
}
$_response
)
"
exit
1
fi
# --- check if data were sent successfully
# fgrep "HTTP/1.1 200" ${_response} >/dev/null
...
...
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