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
e14e4b61
Commit
e14e4b61
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
update sudo handling
parent
98070025
Branches
Branches containing commit
No related tags found
1 merge request
!193
update sudo handling
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
check_ceph_diskfree
+4
-3
4 additions, 3 deletions
check_ceph_diskfree
check_ceph_io
+1
-5
1 addition, 5 deletions
check_ceph_io
check_proc_mem
+11
-3
11 additions, 3 deletions
check_proc_mem
with
16 additions
and
11 deletions
check_ceph_diskfree
+
4
−
3
View file @
e14e4b61
...
@@ -64,15 +64,16 @@ case "$1" in
...
@@ -64,15 +64,16 @@ case "$1" in
*
)
*
)
esac
esac
# --- check required tools
ph.require ceph
# set default / override from command line params
# set default / override from command line params
typeset
-i
iWarnLimit
=
$(
ph.getValueWithParam 70 w
"
$@
"
)
typeset
-i
iWarnLimit
=
$(
ph.getValueWithParam 70 w
"
$@
"
)
typeset
-i
iCriticalLimit
=
$(
ph.getValueWithParam 90 c
"
$@
"
)
typeset
-i
iCriticalLimit
=
$(
ph.getValueWithParam 90 c
"
$@
"
)
if
!
data
=
$(
sudo
-n
/bin/ceph
df
2>&1
)
if
!
data
=
$(
sudo
-n
/bin/ceph
df
2>&1
)
then
then
echo
"
$data
"
ph.abort
"UNKNOWN: No sudo permissions to execute ceph commands."
ph.abort
"UNKNOWN: ceph is not available or no sudo permissions to execute ceph commands."
fi
fi
isHeader
=
0
isHeader
=
0
...
...
This diff is collapsed.
Click to expand it.
check_ceph_io
+
1
−
5
View file @
e14e4b61
...
@@ -89,11 +89,7 @@ else
...
@@ -89,11 +89,7 @@ else
# --- get output of ceph
# --- get output of ceph
if
!
CEPHOUT
=
$(
sudo
-n
ceph status 2>&1
)
;
then
if
!
CEPHOUT
=
$(
sudo
-n
ceph status 2>&1
)
;
then
ph.setStatus
"unknown"
ph.abort
"UNKNOWN: No sudo permissions to execute ceph commands."
ph.status
"no data"
echo
"There is no output from 'sudo ceph status'."
echo
"No ceph here or no sudo permissions on ceph command?"
echo
"
$CEPHOUT
"
fi
fi
CEPHIO
=
$(
echo
"
$CEPHOUT
"
|
grep
"client:"
)
CEPHIO
=
$(
echo
"
$CEPHOUT
"
|
grep
"client:"
)
fi
fi
...
...
This diff is collapsed.
Click to expand it.
check_proc_mem
+
11
−
3
View file @
e14e4b61
...
@@ -11,10 +11,15 @@
...
@@ -11,10 +11,15 @@
#
#
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# 2020-03-02 v1.0 initial version
# 2020-03-02 v1.0 initial version
# 2020-03-05 v1.1 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions
# 2020-03-05 v1.1 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions
# 2023-02-13 v1.2 <axel.hahn@unibe.ch> some shell fixes
# 2023-02-13 v1.2 <axel.hahn@unibe.ch> some shell fixes
# 2023-08-24 v1.3 <axel.hahn@unibe.ch> add help; do not use tmp file anymore
# ======================================================================
# ======================================================================
.
$(
dirname
$0
)
/inc_pluginfunctions
export
self_APPVERSION
=
1.1
# --- tmp files for internal usage
# --- tmp files for internal usage
tmpfile
=
/tmp/processlist1_
$$
tmpfile
=
/tmp/processlist1_
$$
tmpfile2
=
/tmp/processlist2_
$$
tmpfile2
=
/tmp/processlist2_
$$
...
@@ -31,7 +36,10 @@ typeset -i iCountCritical=0
...
@@ -31,7 +36,10 @@ typeset -i iCountCritical=0
rm
-f
$tmpfile
$tmpfile2
$outCritical
$outWarning
2>/dev/null
rm
-f
$tmpfile
$tmpfile2
$outCritical
$outWarning
2>/dev/null
.
$(
dirname
$0
)
/inc_pluginfunctions
# ----------------------------------------------------------------------
# functions
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# MAIN
# MAIN
...
...
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