Skip to content
Snippets Groups Projects
Commit dc905296 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

hello: add help and markdown doc

parent 267283ed
No related branches found
No related tags found
1 merge request!300harden source of files; quote basename and dirname
......@@ -53,4 +53,4 @@
* [check_systemdunit](check_systemdunit.md)
* [check_timesync](check_timesync.md)
* [check_uptime](check_uptime.md)
* hello
* [hello](hello.md)
## Hello
Script: `hello`
It prints a hello message to signal that a non reachable host is alive.
Use it for passive checks in private networks that can't be reached from an Icinga sattelite.
## Requirements
Nothing special.
## Standalone installation
From this repository ypu need next to this script:
* `inc_pluginfunctions` shared function for all IML checks written in bash
## Syntax
Start the script with `-h` or `--help` to get the help.
```txt
______________________________________________________________________
HELLO
v1.1
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
https://os-docs.iml.unibe.ch/icinga-checks/Checks/hello.html
______________________________________________________________________
Print a hello message to signal that a non reachable host is alive.
Use it for passive checks in private networks that can't be reached from an
Icinga sattelite.
SYNTAX:
hello [-h]
OPTIONS:
-h or --help show this help.
PARAMETERS:
None.
```
## Examples
No parameter is needed.
`./hello`
returns
```txt
OK: Here I am!
Thu Feb 20 09:11:55 CET 2025
```
......@@ -9,10 +9,51 @@
#
# ----------------------------------------------------------------------
# 2021-06-04 v1.0 <axel.hahn@iml.unibe.ch> hello :-)
# 2025-02-20 v1.1 <axel.hahn@unibe.ch> add help
# ======================================================================
. `dirname $0`/inc_pluginfunctions
. "$( dirname "$0" )/inc_pluginfunctions"
self_APPVERSION=1.1
# show help text
function showHelp(){
local _self; _self=$(basename $0)
cat <<EOF
$( ph.showImlHelpHeader )
Print a hello message to signal that a non reachable host is alive.
Use it for passive checks in private networks that can't be reached from an
Icinga sattelite.
SYNTAX:
$_self [-h]
OPTIONS:
-h or --help show this help.
PARAMETERS:
None.
EOF
}
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
showHelp
exit 0;
fi
if [ -n "$*" ]; then
echo "ERROR: no parameter expected."
exit 1
fi
ph.status "Here I am!"
date
ph.exit
# ----------------------------------------------------------------------
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment