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
76c2d434
Commit
76c2d434
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
add template for checks
parent
366d5ae2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
zz_template_check_xyz
+95
-0
95 additions, 0 deletions
zz_template_check_xyz
with
95 additions
and
0 deletions
zz_template_check_xyz
0 → 100644
+
95
−
0
View file @
76c2d434
#!/bin/bash
# ======================================================================
#
# Check !!!describe what it does!!!
#
# ----------------------------------------------------------------------
# 202n-nn-nn v0.0 <name@unibe.ch> initial version
# ======================================================================
.
`
dirname
$0
`
/inc_pluginfunctions
# ----------------------------------------------------------------------
# functions
# ----------------------------------------------------------------------
function
showHelp
(){
cat
<<
EOF
______________________________________________________________________
CHECK_XYZ !!! add a short description
(c) Institute for Medical Education - Univerity of Bern
Licence: GNU GPL 3
______________________________________________________________________
!!! Add some information what the check does.
!!! add / remove params in syntax, options and example
SYNTAX:
`basename
$0
` [-w WARN_LIMIT] [-c CRITICAL_LIMIT]
OPTIONS:
-w VALUE cpu usage warning level (default: 75)
-c VALUE cpu usage critical level (default: 90)
-h or --help show this help.
PARAMETERS:
None.
EXAMPLE:
`basename
$0
` -w 60 -c 80
EOF
}
# ----------------------------------------------------------------------
# MAIN
# ----------------------------------------------------------------------
# --- check param -h
case
"
$1
"
in
"--help"
|
"-h"
)
showHelp
exit
0
;;
*
)
esac
# --- check required tools
# !!! add needed tools here
# ph.require bc top
# set default / override from command line params
typeset
-i
iWarnLimit
=
`
ph.getValueWithParam 75 w
"
$@
"
`
typeset
-i
iCriticalLimit
=
`
ph.getValueWithParam 90 c
"
$@
"
`
# !!! add some logic for a check and fetch values from some output
# !!! set status
# ph.setStatusByLimit $iMyvalue $iWarnLimit $iCriticalLimit
# or with a condition:
# ph.setStatus warning
# ph.setStatus critical
# !!! generate output
# ph.status "my check sends value $iMyValue"
# --- performance data usage
# !!! add counters if Icinga must show a chart
# ph.perfadd "checkname-countername" "${iMyValue}" $iWarnLimit $iCriticalLimit 0 100
# ph.exit
# ----------------------------------------------------------------------
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