dox
deb-src
Debug
+*~
\ No newline at end of file
--- /dev/null
+#!/bin/sh
+
+usage()
+{
+cat <<EOF
+usage: $0 options
+
+This script run the test1 or test2 over a machine.
+
+OPTIONS:
+ -h Show this message
+ -H host name or IP
+ -w Warning level
+ -c Critical level
+ -p port name
+EOF
+}
+
+
+MSG="OK";
+HOST=localhost
+PORT=8004
+
+while getopts "hH:w:c:p:" OPTION
+do
+ case $OPTION in
+ h) usage; exit 3;;
+ H)
+ HOST=$OPTARG
+ ;;
+ p)
+ PORT=$OPTARG
+ ;;
+ w)
+ WARN_LEVEL=$OPTARG
+ ;;
+ c)
+ CRIT_LEVEL=$OPTARG
+ ;;
+ esac
+done
+
+#echo $HOST $PORT $WARN_LEVEL $CRIT_LEVEL
+
+`wget -q "http://$HOST:$PORT/search.pz2?command=server-status" -O- | xsltproc /etc/pazpar2/server-status-nagios.xsl - 2> /dev/null`
+
+if [ $? -ne 0 ] ; then
+ MSG="FATAL failed to communicate with pazpar2"
+ exit 128
+fi
+
+if [ "$WARN_LEVEL" != "" ] ; then
+ if [ $SESSIONS -gt $WARN_LEVEL ]; then
+ MSG="WARNING "
+ rc=1;
+ fi
+fi
+
+if [ "$CRIT_LEVEL" != "" ] ; then
+ if [ $SESSIONS -gt $CRIT_LEVEL ]; then
+ MSG="CRITICAL "
+ rc=2;
+ fi
+fi
+
+echo "SESSIONS $MSG $SESSIONS ($CLIENTS) | $SESSIONS;$WARN_LEVEL;$CRIT_LEVEL "
+exit $rc
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:output indent="no" method="text" version="1.0" encoding="UTF-8" />
+
+ <xsl:template match="/server-status">
+ <xsl:apply-templates />
+ </xsl:template>
+
+ <xsl:template match="sessions">
+ <xsl:text>export SESSIONS=</xsl:text><xsl:value-of select="." />
+ </xsl:template>
+
+ <xsl:template match="clients">
+ <xsl:text>export CLIENTS=</xsl:text><xsl:value-of select="." />
+ </xsl:template>
+
+ <xsl:template match="resultsets">
+ <xsl:text>export RESULTSETS=</xsl:text><xsl:value-of select="." />
+ </xsl:template>
+
+ <xsl:template match="*">
+ </xsl:template>
+
+</xsl:stylesheet>
-http://localhost:9763/search.pz2?command=init&clear=0&service=sru-proxy
+http://localhost:9763/search.pz2?command=init&clear=1&service=sru-proxy
http://localhost:9763/search.pz2?session=1&command=settings&pz:sru%5Bkb.dadsthirdnode.cvt.dk%2Fsru-proxy%5D=get&pz%3Aname%5Bkb.dadsthirdnode.cvt.dk%2Fsru-proxy%5D=sru-proxy&pz%3Axslt%5Bkb.dadsthirdnode.cvt.dk%2Fsru-proxy%5D=dads-pz2.xsl&pz%3Aqueryencoding%5Bkb.dadsthirdnode.cvt.dk%2Fsru-proxy%5D=UTF-8&pz%3Aapdulog%5Bkb.dadsthirdnode.cvt.dk%2Fsru-proxy%5D=1&pz%3Asru_version%5Bkb.dadsthirdnode.cvt.dk%2Fsru-proxy%5D=1.1&pz%3Aextra_args%5Bkb.dadsthirdnode.cvt.dk%2Fsru-proxy%5D=%26x-facet_def%3Ddtic_test%26x-noxsl%3D1&pz:query_syntax%5Bkb.dadsthirdnode.cvt.dk%2Fsru-proxy%5D=pqf
http://localhost:9763/search.pz2?session=1&command=search&query=water
4 http://localhost:9763/search.pz2?session=1&command=show&block=1