Permalink
Browse files

Add a basic nagios check against the backer API

  • Loading branch information...
1 parent 6e4838a commit 81392e49171efdf80ccb539488ddb2789d85bf25 @gozer gozer committed Mar 19, 2012
Showing with 15 additions and 1 deletion.
  1. +14 −0 check/check_backer
  2. +1 −1 scripts/openbadges.spec.in
View
14 check/check_backer
@@ -0,0 +1,14 @@
+#!/bin/sh
+CHECK_HTTP=/usr/lib*/nagios/plugins/check_http
+ASSERTION_URL=http://people.mozilla.com/~pchiasson/badges/mrz.json
+
+HOST=$1
+shift
+
+exec $CHECK_HTTP \
+ -H $HOST \
+ --header="Accept: application/json" \
+ --regex='"status"\s*:"success"' \
+ -u /baker?assertion=$ASSERTION_URL \
+ $*
+
View
2 scripts/openbadges.spec.in
@@ -42,7 +42,7 @@ npm ls
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_rootdir}
-for f in bin controllers lib models node_modules scripts static views *.json *.js; do
+for f in bin controllers check lib models node_modules scripts static views *.json *.js; do
cp -rp $f %{buildroot}%{_rootdir}/
done

0 comments on commit 81392e4

Please sign in to comment.