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
40fa3e3b
Commit
40fa3e3b
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
onehost: update help; help without requirements
parent
f9efe804
No related branches found
No related tags found
1 merge request
!137
6468 docs and harmonize
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
check_onehost
+10
-16
10 additions, 16 deletions
check_onehost
with
10 additions
and
16 deletions
check_onehost
+
10
−
16
View file @
40fa3e3b
...
@@ -9,33 +9,27 @@
...
@@ -9,33 +9,27 @@
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# 2023-06-09 v1.0 <axel.hahn@unibe.ch> initial version
# 2023-06-09 v1.0 <axel.hahn@unibe.ch> initial version
# 2023-06-12 v1.1 <axel.hahn@unibe.ch> show message if no sudo permissions on onehost command exist
# 2023-06-12 v1.1 <axel.hahn@unibe.ch> show message if no sudo permissions on onehost command exist
# 2023-08-23 v1.2 <axel.hahn@unibe.ch> update help; show help without requirements
# ======================================================================
# ======================================================================
.
$(
dirname
$0
)
/inc_pluginfunctions
.
$(
dirname
$0
)
/inc_pluginfunctions
self_APPNAME
=
$(
basename
$0
|
tr
[
:lower:]
[
:upper:]
)
self_APPVERSION
=
1.2
self_APPVERSION
=
1.1
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# functions
# functions
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
function
showHelp
(){
function
showHelp
(){
local
_self
;
_self
=
$(
basename
$0
)
cat
<<
EOF
cat
<<
EOF
______________________________________________________________________
$(
ph.showImlHelpHeader
)
$self_APPNAME
Show count of hosts in OpenNebula and warn if a host is down.
v
$self_APPVERSION
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
______________________________________________________________________
show count of hosts in OpenNebula and warn if a host is down.
SYNTAX:
SYNTAX:
$
(
basename
$0
)
[ -w value -c value -h ]
$
_self
[ -w value -c value -h ]
-w VALUE cpu usage warning level (default: 1)
-w VALUE cpu usage warning level (default: 1)
-c VALUE cpu usage critical level (default: 2)
-c VALUE cpu usage critical level (default: 2)
...
@@ -46,7 +40,7 @@ PARAMETERS:
...
@@ -46,7 +40,7 @@ PARAMETERS:
None.
None.
EXAMPLE:
EXAMPLE:
$
(
basename
$0
)
-c 1 set to critical if the 1st host is off.
$
_self
-c 1 set to critical if the 1st host is off.
EOF
EOF
}
}
...
@@ -54,9 +48,6 @@ EOF
...
@@ -54,9 +48,6 @@ EOF
# MAIN
# MAIN
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# --- check required tools
ph.require onehost
# --- check param -h
# --- check param -h
case
"
$1
"
in
case
"
$1
"
in
"--help"
|
"-h"
)
"--help"
|
"-h"
)
...
@@ -66,6 +57,9 @@ case "$1" in
...
@@ -66,6 +57,9 @@ case "$1" in
*
)
*
)
esac
esac
# --- check required tools
ph.require onehost
# --- set optional limits
# --- set optional limits
typeset
-i
iWarnLimit
=
$(
ph.getValueWithParam 1 w
"
$@
"
)
typeset
-i
iWarnLimit
=
$(
ph.getValueWithParam 1 w
"
$@
"
)
typeset
-i
iCriticalLimit
=
$(
ph.getValueWithParam 2 c
"
$@
"
)
typeset
-i
iCriticalLimit
=
$(
ph.getValueWithParam 2 c
"
$@
"
)
...
...
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