openbsd-ports/net/munin/files/vmstat
sthen f03621ea64 import ports/net/munin, this was joint work with mk@ and includes
a couple of his OpenBSD-specific plugins.

Munin the monitoring tool surveys all your computers and
remembers what it saw. It presents all the information in graphs
through a web interface. Its emphasis is on plug and play
capabilities. After completing an installation a high number
of monitoring plugins will be playing with no more effort.

Using Munin you can easily monitor the performance of your
computers, networks, SANs, applications, weather measurements
and whatever comes to mind. It makes it easy to determine
"what's different today" when a performance problem crops up. It
makes it easy to see how you're doing capacity-wise on any
resources.
2009-11-17 11:11:20 +00:00

85 lines
2.0 KiB
Bash
Executable File

#!/bin/sh
#
# $OpenBSD: vmstat,v 1.1.1.1 2009/11/17 11:11:20 sthen Exp $
#
# Adapted from node/node.d.freebsd/vmstat.in
#
# Plugin to monitor the number of procs in io-sleep and other wait
# states. Uses `vmstat`.
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# _Log$
# Revision 1.4.2.1 2005/01/28 14:51:22 lupe
# Add graph_info and some filed.info
#
# Revision 1.5 2005/01/28 14:47:31 lupe
# Add graph_info and some filed.info
#
# Revision 1.4 2004/11/28 09:43:54 lupe
# 6-CURRENT support
#
# Revision 1.3 2004/05/20 19:02:36 jimmyo
# Set categories on a bunch of plugins
#
# Revision 1.2 2004/02/01 18:59:54 lupe
# FreeBSD 5 compatibility.
#
# Revision 1.1 2004/01/02 18:50:00 jimmyo
# Renamed occurrances of lrrd -> munin
#
# Revision 1.1.1.1 2004/01/02 15:18:07 jimmyo
# Import of LRRD CVS tree after renaming to Munin
#
# Revision 1.2 2003/11/07 17:43:16 jimmyo
# Cleanups and log entries
#
#
#
# Magick markers (optional):
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
/usr/bin/vmstat 1 1 2>/dev/null >/dev/null
RESULT=$?
NAME=/usr/bin/vmstat
if [ $RESULT -eq 0 ]; then
echo yes
exit 0
else
if [ $RESULT -eq 127 ]; then
echo "no (could not run \"$NAME\")"
exit 1
else
echo no
exit 1
fi
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title VMstat'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel process states'
echo 'graph_category processes'
echo 'graph_info This graph shows number of processes in each state.'
echo 'running.label running'
echo 'running.info processes on CPU or waiting for CPU'
echo 'running.type GAUGE'
echo 'blocked.label wait'
echo 'blocked.info processes blocked for resources (I/O, paging, etc)'
echo 'blocked.type GAUGE'
echo 'pagewait.label pagewait'
echo 'pagewait.info processes waiting for page-in'
echo 'pagewait.type GAUGE'
exit 0
fi
/usr/bin/vmstat 1 2 | /usr/bin/awk 'END { print "wait.value " $1 "\nblocked.value " $2 "\npagewait.value " $3}'