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
3819f1cc
Commit
3819f1cc
authored
2 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
fix units; add doc
parent
952b7a01
No related branches found
No related tags found
1 merge request
!63
6303 update ceph checks
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inc_pluginfunctions
+13
-2
13 additions, 2 deletions
inc_pluginfunctions
with
13 additions
and
2 deletions
inc_pluginfunctions
+
13
−
2
View file @
3819f1cc
...
...
@@ -33,6 +33,7 @@
# 2022-10-25 v1.5 <axel.hahn@iml.unibe.ch> handle empty value in ph.perfadd
# 2023-01-30 v1.6 <axel.hahn@unibe.ch> check performance params 5+6 and show a warning if missing
# 2023-02-16 v1.7 <axel.hahn@unibe.ch> adding a generic min and max value did not really help
# 2024-04-24 v1.8 <axel.hahn@unibe.ch> fix unit conversion
# ======================================================================
...
...
@@ -268,7 +269,8 @@ function ph._getExp(){
test
"
$_unit
"
=
"K"
&&
echo
2^10
test
"
$_unit
"
=
"M"
&&
echo
2^20
test
"
$_unit
"
=
"G"
&&
echo
2^30
test
"
$_unit
"
=
"P"
&&
echo
2^40
test
"
$_unit
"
=
"T"
&&
echo
2^40
test
"
$_unit
"
=
"P"
&&
echo
2^50
# phyiscal
# test "$_unit" = "m" && echo 10^-3
...
...
@@ -296,7 +298,7 @@ function ph.toUnit(){
local
_divisor
=
`
ph._getExp
$_unit
`
# echo "DEBUG ... $_divisor .. $_multiply"
echo
"
`
echo
$_value
|
tr
-d
"[:alpha:]"
`
*
${
_multiply
}
/
$_divisor
"
| bc
echo
"
$(
echo
$_value
|
tr
-d
"[:alpha:]"
)
*
${
_multiply
}
/
$_divisor
"
| bc
}
...
...
@@ -318,6 +320,7 @@ function ph.getFileAge(){
# get file for storage of last value
# global string dir_data custom path; default is /tmp/icinga_counter/
# param string varName variable name of a value to store
function
ph._getStorefile
(){
local
varName
=
$1
...
...
@@ -332,6 +335,8 @@ function ph._getStorefile(){
}
# save a value - needed for gdAddDeltaData
# param string varName variable name of a value to store
# param * value value as float/ integer
function
ph._savecounter
()
{
local
varName
=
$1
local
value
=
$2
...
...
@@ -341,6 +346,9 @@ function ph._savecounter() {
echo
${
value
}
>
"
${
sStoreFile
}
"
}
# get age of last storage of a value
# used in perfdeltaspeed
# param string varName variable name of a value to store
function
ph._getageoflastvalue
()
{
local
varName
=
$1
local
sStoreFile
=
$(
ph._getStorefile
"
${
varName
}
"
)
...
...
@@ -349,6 +357,9 @@ function ph._getageoflastvalue() {
# local inow=`date +%s`
# echo $(( ${inow}-${ilast}+1 ))
}
# get the last value
# used in perfdeltaspeed
# param string varName variable name of a value to store
function
ph._readlastvalue
(){
local
varName
=
$1
local
sStoreFile
=
$(
ph._getStorefile
"
${
varName
}
"
)
...
...
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