|
#!/bin/sh
|
|
|
|
PARAM=${1:-noexistent}
|
|
|
|
BASE_URL=https://$(hostname --fqdn)
|
|
|
|
CACHE_FILE=/tmp/zbx-apache
|
|
test -z `/usr/bin/find ${CACHE_FILE} -mmin -5 2>/dev/null` && \
|
|
wget --bind-address 127.0.0.1 \
|
|
--user-agent=\"ApacheStats\/0.4 wget\/1.8\" -q \
|
|
-t3 -T5 --no-check-certificate \
|
|
-O ${CACHE_FILE} \
|
|
${BASE_URL}/server-status?auto
|
|
|
|
cat ${CACHE_FILE} | perl -ne "print \$1 if m/^${PARAM}: (\d*\.?\d+)/"
|
|
|