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:
|
2020-11-13 11:56:48 +01:00
|
|
|
- description: The host example.net must return a certificate via TLS
|
|
|
|
code: |
|
|
|
|
COMMAND=id
|
|
|
|
OUTPUT=output_file
|
2020-11-12 21:36:18 +01:00
|
|
|
TF=$(mktemp)
|
2020-11-13 11:56:48 +01:00
|
|
|
echo "$COMMAND | tee $OUTPUT" > $TF
|
2020-11-12 21:36:18 +01:00
|
|
|
chmod +x $TF
|
2020-11-13 11:56:48 +01:00
|
|
|
check_ssl_cert --curl-bin $TF -H example.net
|
2020-11-12 21:36:18 +01:00
|
|
|
cat $OUTPUT
|
2020-11-12 14:21:00 +01:00
|
|
|
sudo:
|
2020-11-13 11:56:48 +01:00
|
|
|
- description: The host example.net must return a certificate via TLS
|
|
|
|
code: |
|
|
|
|
COMMAND=id
|
|
|
|
OUTPUT=output_file
|
2020-11-12 21:36:18 +01:00
|
|
|
TF=$(mktemp)
|
2020-11-13 11:56:48 +01:00
|
|
|
echo "$COMMAND | tee $OUTPUT" > $TF
|
2020-11-12 21:36:18 +01:00
|
|
|
chmod +x $TF
|
2020-11-13 11:56:48 +01:00
|
|
|
umask 022
|
|
|
|
check_ssl_cert --curl-bin $TF -H example.net
|
2020-11-12 21:36:18 +01:00
|
|
|
cat $OUTPUT
|
2020-11-12 14:21:00 +01:00
|
|
|
---
|