root / scripts / stat_apache @ 865f4ff4
1 |
#!/bin/sh
|
---|---|
2 |
|
3 |
PARAM=${1:-noexistent} |
4 |
|
5 |
BASE_URL=https://$(hostname --fqdn) |
6 |
|
7 |
CACHE_FILE=/tmp/zbx-apache |
8 |
test -z `/usr/bin/find ${CACHE_FILE} -mmin -5 2>/dev/null` && \ |
9 |
wget --bind-address 127.0.0.1 \ |
10 |
--user-agent=\"ApacheStats\/0.4 wget\/1.8\" -q \ |
11 |
-t3 -T5 --no-check-certificate \ |
12 |
-O ${CACHE_FILE} \ |
13 |
${BASE_URL}/server-status?auto |
14 |
|
15 |
cat ${CACHE_FILE} | perl -ne "print \$1 if m/^${PARAM}: (\d*\.?\d+)/" |
16 |
|