Merge branch 'master' of gitops.sunet.se:eid-ops
This commit is contained in:
commit
54925abf1b
1 changed files with 21 additions and 0 deletions
21
global/overlay/usr/lib/nagios/plugins/check_sa_version.sh
Normal file
21
global/overlay/usr/lib/nagios/plugins/check_sa_version.sh
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
URL=$1
|
||||
VERSION=$2
|
||||
|
||||
|
||||
JSONVERSION=$(curl -ksL $URL | jq .version 2> /dev/null | sed s/\"//g)
|
||||
EXITCODE=$?
|
||||
|
||||
if [ $EXITCODE -ne 0 ]; then
|
||||
echo "Could not get version from URL: $URL"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$VERSION" != "$JSONVERSION" ]; then
|
||||
echo "Version missmatch, $JSONVERSION != $VERSION"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "OK - Version: $JSONVERSION"
|
||||
exit 0
|
Loading…
Add table
Reference in a new issue