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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source
icinga-passive-client
Commits
98356696
Commit
98356696
authored
4 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
icingacli - detect unreadable config or non writable output file
parent
538460fc
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
icinga-cli.sh
+11
-1
11 additions, 1 deletion
icinga-cli.sh
with
11 additions
and
1 deletion
icinga-cli.sh
+
11
−
1
View file @
98356696
...
...
@@ -14,7 +14,7 @@
_product
=
"ICINGA PASSIVE CLIENT"
_version
=
"0.
3
"
_version
=
"0.
4
"
_license
=
"GNU GPL 3.0"
_copyright
=
'(c) 2020 Institute for Medical Education * University of Bern'
...
...
@@ -178,6 +178,11 @@ function processAllChecks(){
function
_parseCheckConfig
(){
local
_myconfig
=
$1
if
[
!
-r
$_myconfig
]
;
then
echo
"ERROR: config file is not readable [
$_myconfig
]"
exit
1
fi
# EXAMPLE a config contains ...
# checkname=check_cronstatus
# command=check_cronstatus -param1 -param2
...
...
@@ -308,6 +313,11 @@ function processCheck(){
# $myFullscript $myparams | tee $_outfile
eval
$myFullscript
$myparams
>
$_outfile
rc
=
$?
if
[
$rc
-ne
0
]
;
then
echo
"ERROR: unable to write file
$_outfile
. Maybe the setup is inclomplete or someone created a file as root."
ls
-ld
${
dir_data
}
$_outfile
exit
1
fi
typeset
-i
local
iTsEnd
=
`
date
+%s
`
outPerfdata
=
`
grep
'|'
$_outfile
|
cut
-f
2
-d
'|'
`
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