mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
Merge pull request #536 from smith153/master
add standard squid env config vars
This commit is contained in:
commit
613ba240a5
1 changed files with 7 additions and 3 deletions
|
@ -13,8 +13,11 @@
|
||||||
#%# family=auto
|
#%# family=auto
|
||||||
#%# capabilities=autoconf
|
#%# capabilities=autoconf
|
||||||
|
|
||||||
|
host=${squidhost:-localhost}
|
||||||
|
port=${squidport:-3128}
|
||||||
|
|
||||||
if [ "$1" = "autoconf" ]; then
|
if [ "$1" = "autoconf" ]; then
|
||||||
SQUID_STATS=`printf "GET cache_object://localhost/info HTTP/1.0\n\n" | netcat localhost 3128`
|
SQUID_STATS=`printf "GET cache_object://$host/info HTTP/1.0\n\n" | netcat $host $port`
|
||||||
if [ -n "${SQUID_STATS}" ]; then
|
if [ -n "${SQUID_STATS}" ]; then
|
||||||
echo yes
|
echo yes
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -42,7 +45,7 @@ if [ "$1" = "config" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SQUID_TIME=$(printf "GET cache_object://localhost/info HTTP/1.0\n\n" | nc localhost 3128)
|
SQUID_TIME=$(printf "GET cache_object://$host/info HTTP/1.0\n\n" | nc $host $port)
|
||||||
|
|
||||||
SQUID_TIME_HTTP=$(echo "$SQUID_TIME" | grep "HTTP Requests (All)" | cut -d':' -f2 | sed -e "s/^\ *//" | cut -d' ' -f1)
|
SQUID_TIME_HTTP=$(echo "$SQUID_TIME" | grep "HTTP Requests (All)" | cut -d':' -f2 | sed -e "s/^\ *//" | cut -d' ' -f1)
|
||||||
SQUID_TIME_CACHE_MISSES=$(echo "$SQUID_TIME" | grep "Cache Misses" | cut -d':' -f2 | sed -e "s/^\ *//" | cut -d' ' -f1)
|
SQUID_TIME_CACHE_MISSES=$(echo "$SQUID_TIME" | grep "Cache Misses" | cut -d':' -f2 | sed -e "s/^\ *//" | cut -d' ' -f1)
|
||||||
|
@ -58,4 +61,5 @@ echo "mean_chits.value $SQUID_TIME_CACHE_HITS"
|
||||||
echo "mean_nhits.value $SQUID_TIME_NEAR_HITS"
|
echo "mean_nhits.value $SQUID_TIME_NEAR_HITS"
|
||||||
echo "mean_nmr.value $SQUID_TIME_NM_REPLIES"
|
echo "mean_nmr.value $SQUID_TIME_NM_REPLIES"
|
||||||
echo "mean_dnsl.value $SQUID_TIME_DNS_LOOKUPS"
|
echo "mean_dnsl.value $SQUID_TIME_DNS_LOOKUPS"
|
||||||
echo "mean_icpq.value $SQUID_TIME_ICP_QUERIES"
|
echo "mean_icpq.value $SQUID_TIME_ICP_QUERIES"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue