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
c642b068
Commit
c642b068
authored
2 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
some shellfixes; remove grep warnings
parent
5e053ea0
No related branches found
No related tags found
1 merge request
!21
some shellfixes; remove grep warnings
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inc_functions.sh
+20
-20
20 additions, 20 deletions
inc_functions.sh
with
20 additions
and
20 deletions
inc_functions.sh
+
20
−
20
View file @
c642b068
...
...
@@ -38,7 +38,7 @@
# params string(s) message to log
#
function
_log
(){
echo
"
`
date
`
|
$*
"
>>
${
logfile
}
echo
"
$(
date
)
|
$*
"
>>
"
${
logfile
}
"
}
# echo and logging output
...
...
@@ -84,14 +84,14 @@
exit
1
fi
if
[
!
-d
${
dir_checks
}
]
;
then
if
[
!
-d
"
${
dir_checks
}
"
]
;
then
echo
"ERROR: config dir for checks dir_checks does not exist:
$dir_checks
"
exit
1
fi
for
myconfig
in
`
ls
-1
${
dir_checks
}
/
*
`
for
myconfig
in
$(
ls
-1
${
dir_checks
}
/
*
)
do
echo
${
myconfig
}
echo
"
${
myconfig
}
"
done
}
...
...
@@ -101,7 +101,7 @@
# checkInterval
# param string full path of a config file
function
_parseCheckConfig
(){
local
_myconfig
=
$1
local
_myconfig
=
"
$1
"
# EXAMPLE a config contains ...
# checkname=check_cronstatus
...
...
@@ -110,11 +110,11 @@
# icon=/images/icon.png
# max_check_attempts=3
checkName
=
`
cat
$_myconfig
|
grep
^checkname
=
|
cut
-f
2
-d
"="
|
sed
's# #_#g'
`
checkCommand
=
`
cat
$_myconfig
|
grep
^command
=
|
cut
-f
2
-d
"="
`
checkInterval
=
`
cat
$_myconfig
|
grep
^interval
=
|
cut
-f
2
-d
"="
`
checkIcon
=
`
cat
$_myconfig
|
grep
^icon
=
|
cut
-f
2
-d
"="
`
checkMaxAttempts
=
`
cat
$_myconfig
|
grep
^max_check_attempts
=
|
cut
-f
2
-d
"="
`
checkName
=
$(
cat
"
$_myconfig
"
|
grep
^checkname
=
|
cut
-f
2
-d
"="
|
sed
's# #_#g'
)
checkCommand
=
$(
cat
"
$_myconfig
"
|
grep
^command
=
|
cut
-f
2
-d
"="
)
checkInterval
=
$(
cat
"
$_myconfig
"
|
grep
^interval
=
|
cut
-f
2
-d
"="
)
checkIcon
=
$(
cat
"
$_myconfig
"
|
grep
^icon
=
|
cut
-f
2
-d
"="
)
checkMaxAttempts
=
$(
cat
"
$_myconfig
"
|
grep
^max_check_attempts
=
|
cut
-f
2
-d
"="
)
}
# ======================================================================
...
...
@@ -162,28 +162,28 @@ function _ipf(){
# --- types
'loopback'
)
_regexInclude
=
'
\
scope
\
host
\
'
_regexInclude
=
' scope host '
;;
'physical'
)
_regexExclude
=
"(
\
scope
\
host
\
|
\
peer
\
|
\
:
vip)"
_regexExclude
=
"( scope host | peer |:vip)"
;;
'virtual'
)
_regexInclude
=
"
\
:
vip"
_regexInclude
=
":vip"
;;
'net'
)
_regexInclude
=
'
\
scope
\
global
\
'
_regexInclude
=
' scope global '
;;
'peer'
)
_regexInclude
=
'
\
peer
\
.*
\
scope
\
global
\
'
_regexInclude
=
' peer .* scope global '
;;
# --- private/ public ips
'private'
)
_regexInclude
=
"
\
${
_privateranges
}
.*"
_regexInclude
=
"
${
_privateranges
}
.*"
;;
'public'
)
_regexInclude
=
"
\
scope
\
global
\
"
_regexExclude
=
"
\
${
_privateranges
}
\.
*"
_regexInclude
=
" scope global "
_regexExclude
=
"
${
_privateranges
}
\.
*"
;;
# --- output filter
...
...
@@ -253,7 +253,7 @@ function _getIpPrivate(){
fi
_echo
"
$(
http.getResponseHeader
)
"
_echo
$(
http.getResponse
)
_echo
"
$(
http.getResponse
)
"
}
...
...
@@ -278,7 +278,7 @@ function _getIpPrivate(){
http.makeRequest GET
"
${
_url
}
"
""
if
[
!
-z
"
`
http.isok
`
"
]
;
then
if
[
!
-z
"
$(
http.isok
)
"
]
;
then
_wd
"OK, Object
$_url
exists - updating cache file
$_outfile
"
http.responseExport
"
${
_outfile
}
"
else
...
...
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