#! /bin/sh
# anders@aftenposten.no, 2008-01-17
# Number of open sockets

PATH="$PATH:/sbin"
export PATH

case $1 in
autoconf) echo yes;;
config)
	echo 'graph_title Open sockets'
	echo 'graph_vlabel sockets'
	echo 'graph_category system'
	echo 'graph_info This graph shows the number of open sockets'

	echo 'sockets.label sockets'
	echo 'sockets.type GAUGE'
	echo 'sockets.graph yes'
	;;
*)
	printf "sockets.value "
	sysctl -n kern.ipc.numopensockets
	;;
esac
