. $MUNIN_LIBDIR/plugins/plugin.sh
echo "no (quick hacky plugin)"
for kind in access error; do
echo "multigraph nginx_${kind}_by_vhost"
echo "graph_title Nginx requests by vhost (${kind})"
echo 'graph_args --base 1000'
echo 'graph_vlabel requests / ${graph_period}'
echo 'graph_category nginx'
name="$(clean_fieldname "$vhost")"
echo "${name}.label ${vhost}"
echo "${name}.type DERIVE"
echo "${name}.draw LINE1"
for kind in access error; do
echo "multigraph nginx_${kind}_by_vhost"
name="$(clean_fieldname "$vhost")"
echo "${name}.value $(wc -l "/var/log/nginx/${vhost}.${kind}.log" | cut -d' ' -f1)"