20 lines
560 B
Bash
Executable File
20 lines
560 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ "$1" == "config" ];then
|
|
echo "graph_title dnsmasq queries
|
|
graph_info Displays DNS resolver query caching statistics
|
|
graph_args --base 1000 -l 0
|
|
graph_period minute
|
|
graph_vlabel queries per \${graph_period}
|
|
graph_category network
|
|
graph_scale no
|
|
hits.label answered
|
|
hits.type COUNTER
|
|
misses.label forwarded
|
|
misses.type COUNTER"
|
|
exit 0
|
|
fi
|
|
|
|
/bin/kill -SIGUSR1 `/usr/bin/pgrep dnsmasq`
|
|
/sbin/logread|/usr/bin/sort -r|/bin/grep dnsmasq|/usr/bin/awk -F "[ \t\n/,]+" '/queries forwarded/ { print "misses.value "$10"\nhits.value "$14; exit; }'
|