basic monitoring for gemini

This commit is contained in:
n 2021-02-20 19:28:53 +01:00
parent c4b54e027b
commit a44a6022ca
Signed by: n
GPG Key ID: E96086FC951DAE30
1 changed files with 20 additions and 0 deletions

View File

@ -96,6 +96,26 @@ stream {
vger's vhost parameter is set (-v), so we'll have to create one or more directories within gemini's home directory, -i (directory index) is also set, so creating an index.gmi is not mandatory.
# Basic monitoring
The following miniamlistic script can be used to check for capsule availability in Nagios/Icinga/Shinken/Etc., assuming gnutls is installed:
```
#!/bin/sh
TLS_CLIENT="/usr/local/bin/gnutls-cli -p 1965"
errorOutput=$(echo -n "gemini://$1/\r\n" | ${TLS_CLIENT} $1 2>&1 > /dev/null)
errorCode=$?
if [ $errorCode -gt 0 ]
then
echo "ERROR: ${errorOutput}"
return 2
else
echo "OK: capsule responding"
return 0
fi
```
# Greetings
Many many thanks to @solene@bsd.network for writing that wonderful little piece of software thas is vger, and @hucste@framapiaf.org for pointing it to me.