2020-11-12 14:21:00 +01:00
|
|
|
---
|
|
|
|
description: |
|
|
|
|
This is the `check_by_ssh` Nagios plugin, available e.g. in `/usr/lib/nagios/plugins/`.
|
|
|
|
functions:
|
|
|
|
command:
|
|
|
|
- code: |
|
2020-11-13 11:56:48 +01:00
|
|
|
COMMAND=id
|
|
|
|
OUTPUT=output_file
|
2020-11-12 14:21:00 +01:00
|
|
|
TF=$(mktemp)
|
2020-11-13 11:56:48 +01:00
|
|
|
echo "ProxyCommand $COMMAND | tee $OUTPUT" > $TF
|
|
|
|
check_by_ssh -F $TF -H localhost -C something
|
2020-11-12 14:21:00 +01:00
|
|
|
cat $OUTPUT
|
|
|
|
sudo:
|
|
|
|
- code: |
|
2020-11-13 11:56:48 +01:00
|
|
|
COMMAND=id
|
|
|
|
OUTPUT=output_file
|
2020-11-12 14:21:00 +01:00
|
|
|
TF=$(mktemp)
|
2020-11-13 11:56:48 +01:00
|
|
|
echo "ProxyCommand $COMMAND | tee $OUTPUT" > $TF
|
|
|
|
sudo check_by_ssh -F $TF -H localhost -C something
|
2020-11-12 14:21:00 +01:00
|
|
|
cat $OUTPUT
|
|
|
|
---
|