openbsd-ports/net/munin/files/pf_searches
sthen 0e401c36bc - update/add OpenBSD-specific plugins (interrupt and pf monitoring), from mk@
- redo MESSAGE-main, making it a little more obvious how to get started,
following discussions with stephan@ and jasper@

ok jasper@
(reminder, ports is not fully open, do not commit without specific permission)
2010-02-25 17:07:17 +00:00

52 lines
1.0 KiB
Bash

#!/bin/sh
#
# $OpenBSD: pf_searches,v 1.1 2010/02/25 17:07:17 sthen Exp $
#
# (c) 2010 Kim Højgaard-Hansen <kimrhh@gmail.com>
#
# Script to monitor number of pf state lookups from "pfctl -si".
#
# ln -s /usr/local/libexec/munin/plugins/pf_states \
# /etc/munin/plugins/pf_states
#
# ...will monitor number of pf state lookups.
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
# suggest (optional - used by munin-config)
#
# Magic markers (optional):
#%# family=manual
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ "$(uname -s)" = "OpenBSD" ]; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
if [ "$1" = "suggest" ]; then
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title number of pf state lookups'
echo 'graph_args --base 1000'
echo 'graph_category pf'
echo 'graph_vlabel state lookups'
echo 'lookup.label Lookups'
echo 'lookup.info State table lookups'
echo 'lookup.type DERIVE'
echo 'lookup.min 0'
exit 0
fi
pfctl -si | awk '$1 == "searches" { print "lookup.value " $2 }'