add montoring script to check that Firefox Send is up to date
This commit is contained in:
parent
b42764aa4e
commit
f30d708cbc
26
monitoring/check_dropchaprilorg_update
Executable file
26
monitoring/check_dropchaprilorg_update
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Nagios plugin to check Firefox Send version
|
||||
#
|
||||
|
||||
LAST_VERSION=$(curl --silent https://api.github.com/repos/mozilla/send/tags | jq -r '.[0].name')
|
||||
INSTALLED_VERSION=$(jq -r '.version' /srv/drop/www/package.json)
|
||||
|
||||
if [ -z "$LAST_VERSION" ]; then
|
||||
echo "WARNING : cannot get version from github."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$INSTALLED_VERSION" ]; then
|
||||
echo "WARNING : cannot find installed version."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$LAST_VERSION" == "v$INSTALLED_VERSION" ]; then
|
||||
echo "OK"
|
||||
exit 0
|
||||
else
|
||||
echo "WARNING : new version available, installed is $INSTALLED_VERSION, last is $LAST_VERSION."
|
||||
exit 1
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user