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
4ca2c562
Commit
4ca2c562
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
onevm: fix output if no vm is running
parent
0779f05a
No related branches found
No related tags found
1 merge request
!114
onevm: fix output if no vm is running
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
check_onevm
+6
-5
6 additions, 5 deletions
check_onevm
with
6 additions
and
5 deletions
check_onevm
+
6
−
5
View file @
4ca2c562
...
...
@@ -33,13 +33,14 @@
# STAT:done:Done:The VM is done. VMs in this state won’t be shown with onevm list but are kept in the database for accounting purposes. You can still get their information with the onevm show command.
# ----------------------------------------------------------------------
# 2023-06-12 v1.0 <axel.hahn@unibe.ch> initial version
# 2023-06-15 v1.0 <axel.hahn@unibe.ch> fix output if no vm is running
# ======================================================================
.
$(
dirname
$0
)
/inc_pluginfunctions
self_APPNAME
=
$(
basename
$0
|
tr
[
:lower:]
[
:upper:]
)
self_APPVERSION
=
1.
0
self_APPVERSION
=
1.
1
# new line
NL
=
"
...
...
@@ -115,10 +116,10 @@ csvdata=$( echo "$cmdout" | sed -n '2,$p' )
# --- get result
out
=
""
typeset
-i
iTotal
;
iTotal
=
$(
echo
"
$csvdata
"
|
wc
-l
)
typeset
-i
iRunning
;
iRunning
=
$(
echo
"
$csvdata
"
|
grep
-c
",runn,"
)
typeset
-i
iFail
;
iFail
=
$(
echo
"
$csvdata
"
|
grep
-c
",fail,"
)
typeset
-i
iUnknown
;
iUnknown
=
$(
echo
"
$csvdata
"
|
grep
-c
",unkn,"
)
typeset
-i
iTotal
;
iTotal
=
$(
grep
-c
.
<<<
"
$csvdata
"
)
typeset
-i
iRunning
;
iRunning
=
$(
grep
-c
",runn,
"
<<<
"
$csvdata
"
)
typeset
-i
iFail
;
iFail
=
$(
grep
-c
",fail,
"
<<<
"
$csvdata
"
)
typeset
-i
iUnknown
;
iUnknown
=
$(
grep
-c
",unkn,
"
<<<
"
$csvdata
"
)
typeset
-i
iOther
;
iOther
=
$iTotal
-
$iRunning
-
$iFail
-
$iUnknown
ph.perfadd
"total"
"
${
iTotal
}
"
...
...
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