2020-11-12 14:21:00 +01:00
|
|
|
---
|
|
|
|
description: |
|
2023-09-30 20:40:05 +02:00
|
|
|
This is the `check_ssl_cert` Nagios plugin, available e.g. in `/usr/lib/nagios/plugins/`.
|
2020-11-12 14:21:00 +01:00
|
|
|
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
|
|
|
---
|