Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
Munin is a tool for graphing all sorts of information about one or
more servers and displaying it in a web interface. It uses the
execellent RRDTool (written by Tobi Oetiker) and is written in Perl.
Munin has a master/node architecture. The master connects to all the
nodes at regular intervals, and asks them for data. It then stores
the data in RRD-files, and (if needed) updates the graphs. One of the
main goals has been ease of creating own "plugins" (graphs).
This package contains the client.

View File

@@ -0,0 +1,12 @@
===========================================================================
$NetBSD: MESSAGE,v 1.3 2006/12/05 14:53:32 xtraeme Exp $
Plugins can be auto-configured with "munin-node-configure --shell | sh"
You may also want to add an entry such as
${VARBASE}/log/munin/munin-node.log munin:munin 644 7 * 24 Z
to /etc/newsyslog.conf to have the node log rotated.
===========================================================================

View File

@@ -0,0 +1,115 @@
# $NetBSD: Makefile,v 1.29 2013/05/31 12:42:02 wiz Exp $
#
DISTNAME= munin_${VER}
VER= 1.3.2
PKGNAME= munin-node-${VER}
PKGREVISION= 13
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=munin/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://munin-monitoring.org/
COMMENT= System monitoring tool, client version
PKG_DESTDIR_SUPPORT= destdir
USERGROUP_PHASE= pre-install
DEPENDS+= p5-Net-Server>=0:../../net/p5-Net-Server
DEPENDS+= p5-Net-SSLeay>=0:../../security/p5-Net-SSLeay
DEPENDS+= munin-doc>=1.3.1:../../sysutils/munin-doc
.include "../../mk/bsd.prefs.mk"
USE_TOOLS+= perl:run tar
USE_TOOLS+= gmake
USE_PKGINSTALL= YES
WRKSRC= ${WRKDIR}/${DISTNAME:S:_:-:}
PLIST_VARS+= sunos not-sunos netbsd not-netbsd linux not-linux
.if ${OPSYS} == "Linux"
PLIST.linux= yes
.else
PLIST.not-linux= yes
.endif
.if ${OPSYS} == "NetBSD"
PLIST.netbsd= yes
.else
PLIST.not-netbsd= yes
.endif
.if ${OPSYS} == "SunOS"
PLIST.sunos= yes
.else
PLIST.not-sunos= yes
.endif
PKG_GROUPS_VARS+= MUNIN_GROUP
PKG_USERS_VARS+= MUNIN_USER
MUNIN_GROUP?= munin
MUNIN_USER?= munin
PKG_GROUPS= ${MUNIN_GROUP}
PKG_USERS= ${MUNIN_USER}:${MUNIN_GROUP}
PKG_GECOS.${MUNIN_USER}= Munin user
PKG_SYSCONFSUBDIR?= munin
REPLACE_PERL+= node/node.d/*.in
STATEDIR?= ${VARBASE}/munin/plugin-state
MUNIN_RUN?= ${VARBASE}/run/munin
MAKE_DIRS+= ${PKG_SYSCONFDIR}/plugins
OWN_DIRS+= ${VARBASE}/munin
OWN_DIRS+= ${MUNIN_RUN}
OWN_DIRS+= ${VARBASE}/log/munin
OWN_DIRS+= ${STATEDIR}
OWN_DIRS_PERMS+=${VARBASE}/munin ${MUNIN_USER} ${MUNIN_GROUP} 0755
OWN_DIRS_PERMS+=${MUNIN_RUN} ${MUNIN_USER} ${MUNIN_GROUP} 0755
OWN_DIRS_PERMS+=${VARBASE}/log/munin ${MUNIN_USER} ${MUNIN_GROUP} 0755
OWN_DIRS_PERMS+=${STATEDIR} ${MUNIN_USER} ${MUNIN_GROUP} 0775
INSTALL_TARGET= install-node install-node-plugins
BUILD_TARGET= build
#MAKE_ENV+= PERL5_SITELIB=${PERL5_SITELIB}
MAKE_ENV+= PREFIX=${PREFIX}
MAKE_ENV+= CONFDIR=${PKG_SYSCONFDIR}
MAKE_ENV+= MUNIN_USER=${MUNIN_USER}
MAKE_ENV+= MUNIN_GROUP=${MUNIN_GROUP}
MAKE_ENV+= PERL5=${PERL5:Q}
MAKE_ENV+= PYTHONBIN=${PYTHONBIN:Q}
FILES_SUBST+= PERL=${PERL5:Q}
FILES_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
FILES_SUBST+= STATEDIR=${STATEDIR}
FILES_SUBST+= MUNIN_RUN=${MUNIN_RUN:Q}
FILES_SUBST+= MUNIN_USER=${MUNIN_USER:Q}
FILES_SUBST+= MUNIN_GROUP=${MUNIN_GROUP:Q}
MESSAGE_SUBST+= VARBASE=${VARBASE:Q}
BUILD_DEFS+= VARBASE
RCD_SCRIPTS+= munin-node
EGDIR= ${PREFIX}/share/examples/munin
CONF_FILES+= ${EGDIR}/munin-node.conf ${PKG_SYSCONFDIR}/munin-node.conf
INSTALLATION_DIRS+= ${EGDIR}
pre-configure:
cd ${FILESDIR}; ${TAR} cf - . | (cd ${WRKSRC}; ${TAR} xfp -)
post-install:
${INSTALL_DATA} ${WRKSRC}/build/node/munin-node.conf ${DESTDIR}${EGDIR}
.include "../../lang/python/application.mk"
.include "../../mk/bsd.pkg.mk"

146
sysutils/munin-node/PLIST Normal file
View File

@@ -0,0 +1,146 @@
@comment $NetBSD: PLIST,v 1.11 2010/12/11 12:09:23 abs Exp $
lib/munin/plugins/acpi
lib/munin/plugins/amavis
lib/munin/plugins/apache_accesses
lib/munin/plugins/apache_processes
lib/munin/plugins/apache_volume
lib/munin/plugins/apc_envunit_
lib/munin/plugins/apc_nis
${PLIST.linux}lib/munin/plugins/apt
${PLIST.linux}lib/munin/plugins/apt_all
lib/munin/plugins/bind9
lib/munin/plugins/bind9_rndc
lib/munin/plugins/courier_
lib/munin/plugins/courier_mta_mailqueue
lib/munin/plugins/courier_mta_mailstats
lib/munin/plugins/courier_mta_mailvolume
${PLIST.linux}lib/munin/plugins/cps_
lib/munin/plugins/cpu
lib/munin/plugins/cupsys_pages
lib/munin/plugins/df
${PLIST.linux}lib/munin/plugins/df_abs
lib/munin/plugins/df_inode
lib/munin/plugins/dhcpd3
${PLIST.linux}lib/munin/plugins/entropy
lib/munin/plugins/exim_mailqueue
lib/munin/plugins/exim_mailqueue_alt
lib/munin/plugins/exim_mailstats
${PLIST.linux}lib/munin/plugins/files_
lib/munin/plugins/foldingathome
lib/munin/plugins/foldingathome_rank
lib/munin/plugins/foldingathome_wu
${PLIST.not-sunos}lib/munin/plugins/forks
${PLIST.sunos}lib/munin/plugins/fs_df
${PLIST.sunos}lib/munin/plugins/fs_inodes
${PLIST.linux}lib/munin/plugins/fw_conntrack
${PLIST.linux}lib/munin/plugins/fw_forwarded_local
${PLIST.linux}lib/munin/plugins/fw_packets
lib/munin/plugins/hddtemp
lib/munin/plugins/hddtemp2
lib/munin/plugins/hddtemp_smartctl
lib/munin/plugins/hddtempd
${PLIST.linux}lib/munin/plugins/i2c
${PLIST.linux}lib/munin/plugins/i2c_fan
lib/munin/plugins/if_
${PLIST.linux}lib/munin/plugins/if_err_
${PLIST.not-linux}lib/munin/plugins/if_errcoll_
${PLIST.not-sunos}lib/munin/plugins/interrupts
${PLIST.not-sunos}lib/munin/plugins/iostat
${PLIST.linux}lib/munin/plugins/iostat_ios
${PLIST.sunos}lib/munin/plugins/io_busy_
${PLIST.sunos}lib/munin/plugins/io_bytes_
${PLIST.sunos}lib/munin/plugins/io_ops_
${PLIST.netbsd}lib/munin/plugins/iostat_ops
${PLIST.linux}lib/munin/plugins/ip_
lib/munin/plugins/ipac-ng
lib/munin/plugins/ircu
${PLIST.not-sunos}lib/munin/plugins/irqstats
lib/munin/plugins/load
lib/munin/plugins/loggrep
lib/munin/plugins/mailman
lib/munin/plugins/mailscanner
lib/munin/plugins/mbmon_
lib/munin/plugins/memory
${PLIST.netbsd}lib/munin/plugins/memory_pools
${PLIST.netbsd}lib/munin/plugins/memory_types
lib/munin/plugins/mhttping
lib/munin/plugins/multips
lib/munin/plugins/munin_graph
lib/munin/plugins/munin_update
lib/munin/plugins/mysql_bytes
lib/munin/plugins/mysql_isam_space_
lib/munin/plugins/mysql_queries
lib/munin/plugins/mysql_slowqueries
lib/munin/plugins/mysql_threads
lib/munin/plugins/named
${PLIST.linux}lib/munin/plugins/netopia
lib/munin/plugins/netstat
${PLIST.not-sunos}lib/munin/plugins/nfs_client
${PLIST.not-sunos}lib/munin/plugins/nfsd
lib/munin/plugins/ntp_
lib/munin/plugins/ntp_kernel_err
lib/munin/plugins/ntp_kernel_pll_freq
lib/munin/plugins/ntp_kernel_pll_off
lib/munin/plugins/ntp_states
lib/munin/plugins/nut_misc
lib/munin/plugins/nut_volts
${PLIST.not-sunos}lib/munin/plugins/open_files
${PLIST.linux}lib/munin/plugins/open_inodes
${PLIST.sunos}lib/munin/plugins/paging_in
${PLIST.sunos}lib/munin/plugins/paging_out
lib/munin/plugins/perdition
lib/munin/plugins/ping_
lib/munin/plugins/plugins.history
lib/munin/plugins/pm3users_
lib/munin/plugins/pop_stats
${PLIST.linux}lib/munin/plugins/port_
lib/munin/plugins/postfix_mailqueue
lib/munin/plugins/postfix_mailstats
lib/munin/plugins/postfix_mailvolume
lib/munin/plugins/processes
lib/munin/plugins/ps_
lib/munin/plugins/psu_
lib/munin/plugins/samba
lib/munin/plugins/sendmail_mailqueue
lib/munin/plugins/sendmail_mailstats
lib/munin/plugins/sendmail_mailtraffic
${PLIST.not-sunos}lib/munin/plugins/sensors_
lib/munin/plugins/smart_
lib/munin/plugins/snmp__cpuload
lib/munin/plugins/snmp__df
lib/munin/plugins/snmp__fc_if_
lib/munin/plugins/snmp__fc_if_err_
lib/munin/plugins/snmp__if_
lib/munin/plugins/snmp__if_err_
lib/munin/plugins/snmp__load
lib/munin/plugins/snmp__processes
lib/munin/plugins/snmp__sensors_fsc_bx_fan
lib/munin/plugins/snmp__sensors_fsc_bx_temp
lib/munin/plugins/snmp__sensors_fsc_fan
lib/munin/plugins/snmp__sensors_fsc_temp
lib/munin/plugins/snmp__sensors_mbm_fan
lib/munin/plugins/snmp__sensors_mbm_temp
lib/munin/plugins/snmp__sensors_mbm_volt
lib/munin/plugins/snmp__users
lib/munin/plugins/spamstats
lib/munin/plugins/squid_cache
lib/munin/plugins/squid_icp
lib/munin/plugins/squid_requests
lib/munin/plugins/squid_traffic
lib/munin/plugins/surfboard
${PLIST.not-sunos}lib/munin/plugins/swap
${PLIST.netbsd}lib/munin/plugins/swap_size
lib/munin/plugins/sybase_space
${PLIST.sunos}lib/munin/plugins/temperature
${PLIST.not-sunos}lib/munin/plugins/uptime
${PLIST.linux}lib/munin/plugins/users
${PLIST.linux}lib/munin/plugins/vlan_
${PLIST.linux}lib/munin/plugins/vlan_inetuse_
${PLIST.linux}lib/munin/plugins/vlan_linkuse_
lib/munin/plugins/vmstat
sbin/munin-node
sbin/munin-node-configure
sbin/munin-node-configure-snmp
sbin/munin-run
share/examples/munin/munin-node.conf
share/examples/rc.d/munin-node

View File

@@ -0,0 +1,13 @@
$NetBSD: distinfo,v 1.9 2011/04/30 19:10:12 abs Exp $
SHA1 (munin_1.3.2.tar.gz) = 575c1dc3373e2e001accd1920fd815d9b875c95a
RMD160 (munin_1.3.2.tar.gz) = 7bcc16d00ad28731041015ef240144ed0c4fdeb4
Size (munin_1.3.2.tar.gz) = 309319 bytes
SHA1 (patch-aa) = 6c4517444cbcedadd276924c0ff417443618fd2b
SHA1 (patch-ab) = bb0f63cdef893d8c224cdd03a4a4125d03f85f80
SHA1 (patch-ac) = 9ef503b4d20f65e990c332c7789188a6fbad618e
SHA1 (patch-ad) = d29f61134077f7875500af2e5671b67913fb2306
SHA1 (patch-ae) = 63b6acf126bc8baaed0ff429cfa0fa63945e5915
SHA1 (patch-af) = 094aa38a177778e6df7310a0e61839c08de7dc20
SHA1 (patch-ag) = d33ff87fae5bef1fb2dd1f12838471b7a7a42fbf
SHA1 (patch-ah) = bd2516b8961c04dd418677f7efb2b6589db15d2e

View File

@@ -0,0 +1,61 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: munin-node.sh,v 1.4 2006/12/29 06:37:03 obache Exp $
#
# PROVIDE: munin-node
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# You will need to set some variables in /etc/rc.conf to start munin-node:
#
# munin_node=YES
#
if [ -f /etc/rc.subr ]
then
. /etc/rc.subr
fi
name="munin_node"
rcvar=$name
command=@PREFIX@/sbin/munin-node
command_interpreter=@PERL@
pidfile="@VARBASE@/run/munin/munin-node.pid"
required_files=@PKG_SYSCONFDIR@/munin-node.conf
stop_cmd="munin_node_stop"
# Net::Server breaks rc.subr's techniques for detecting whether the
# process running at a certain PID is actually the process we wish to
# stop. Just unconditionally send SIGTERM to the PID instead.
#
munin_node_stop()
{
@ECHO@ "Stopping ${name}."
if [ -f ${pidfile} ]; then
pid=`@HEAD@ -1 ${pidfile}`
doit="kill ${pid}"
if ! eval $doit && [ -z "$rc_force" ]; then
return 1
fi
wait_for_pids $pid
fi
@RM@ -f ${pidfile}
}
if [ ! -d @STATEDIR@ ]; then
mkdir @STATEDIR@
chown @MUNIN_USER@:@MUNIN_GROUP@ @STATEDIR@
fi
if [ ! -d @MUNIN_RUN@ ]; then
mkdir @MUNIN_RUN@
chown @MUNIN_USER@:@MUNIN_GROUP@ @MUNIN_RUN@
fi
if [ -f /etc/rc.subr ]; then
load_rc_config $name
run_rc_command "$1"
else
echo -n " ${name}"
exec ${command} ${command_args}
fi

View File

@@ -0,0 +1,144 @@
#!/bin/sh
#
# Plugin to monitor CPU usage.
#
# Usage: Place in /etc/munin/node.d/ (or link it there using ln -s)
#
# Parameters understood:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# $Log: cpu.in,v $
# Revision 1.2 2006/06/08 18:59:26 he
# Remove installation of the documentation from this package, to be
# provided by the soon-to-be-committed munin-doc package.
#
# Other minor changes:
# o Remove comented-out bits from package Makefile
# o Re-ordered variables reported by NetBSD's cpu plugin script
# o Use shorter legend text in NetBSD's interrupts plugin script
#
# Bumped package revision.
#
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
# Magic markers - optional - used by installation scripts and
# munin-config:
#
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -x /sbin/sysctl ]; then
/sbin/sysctl kern.cp_time > /dev/null
if [ $? = "0" ]; then
echo yes
exit 0
else
echo no
exit 1
fi
else
echo no
exit 1
fi
fi
if [ "$1" = "config" ]; then
STATUNITS=`/sbin/sysctl -n kern.clockrate | cut -f15 -d' '`
PERCENT=`/sbin/sysctl -n hw.ncpu | awk '{print ($1)*100}'`
NCPU=`/sbin/sysctl -n hw.ncpu`
if [ "$scaleto100" = yes ]; then
CDEF="${STATUNITS},/,100,*,$NCPU,/"
PERCENT=100
else
CDEF="${STATUNITS},/,100,*"
PERCENT=$(($NCPU*100))
fi
# SYSWARNING=$PERCENT*30/100
# SYSCRITICAL=$PERCENT*50/100
# INTWARNING=$PERCENT*80/100
# USRWARNING=$PERCENT*80/100
echo 'graph_title CPU usage (' $NCPU ' CPUs)'
echo 'graph_order system interrupt user idle nice'
echo "graph_args --base 1000 -r --lower-limit 0 --upper-limit $PERCENT "
echo 'graph_vlabel %'
echo 'graph_scale no'
echo 'graph_info This graph shows how CPU time is spent.'
echo 'graph_category system'
echo 'graph_period second'
echo 'system.label system'
echo 'system.draw AREA'
echo 'system.max 5000'
echo 'system.type DERIVE'
echo 'system.min 0'
# echo "system.warning $SYSWARNING"
# echo "system.critical $SYSCRITICAL"
echo 'system.info CPU time spent by the kernel in system activities'
echo "system.cdef system,$CDEF"
echo 'interrupt.label interrupt'
echo 'interrupt.draw STACK'
echo 'interrupt.max 5000'
# echo "interrupt.warning $INTWARNING"
echo 'interrupt.type DERIVE'
echo 'interrupt.min 0'
echo 'interrupt.info CPU time spent by the kernel processing interrupts'
echo "interrupt.cdef interrupt,$CDEF"
echo 'user.label user'
echo 'user.draw STACK'
echo 'user.max 5000'
# echo "user.warning $USRWARNING"
echo 'user.type DERIVE'
echo 'user.info CPU time spent by normal programs and daemons'
echo 'user.min 0'
echo "user.cdef user,$CDEF"
echo 'idle.label idle'
echo 'idle.draw STACK'
echo 'idle.max 5000'
echo 'idle.type DERIVE'
echo 'idle.info Idle CPU time'
echo 'idle.min 0'
echo "idle.cdef idle,$CDEF"
echo 'nice.label nice'
echo 'nice.draw STACK'
echo 'nice.max 5000'
echo 'nice.type DERIVE'
echo 'nice.info CPU time spent by nice(1)d programs'
echo 'nice.min 0'
echo "nice.cdef nice,$CDEF"
exit 0
fi
/sbin/sysctl kern.cp_time | awk '{
gsub(",", "");
split($0, a);
print "system.value " a[10];
print "interrupt.value " a[13];
print "user.value " a[4];
print "idle.value " a[16];
print "nice.value " a[7];
}'

View File

@@ -0,0 +1,79 @@
#!/bin/sh
#
# Script to monitor disk usage.
#
# Parameters understood:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# $Log: df.in,v $
# Revision 1.2 2010/10/27 18:23:13 shattered
# Also ignore null and union filesystems, bump revision.
#
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
# Magic markers (optional - used by munin-config and installation
# scripts):
#
#%# family=auto
#%# capabilities=autoconf
MAXLABEL=20
TYPES=noprocfs,devfs,fdescfs,ptyfs,kernfs,nfs,null,union
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Filesystem usage (in %)'
echo 'graph_args --upper-limit 100 -l 0'
echo 'graph_vlabel %'
echo 'graph_category disk'
echo 'graph_info This graph shows disk usage on the machine.'
mfs=0
/bin/df -P -t $TYPES | tail +2 | grep -v "//" | while read i; do
case $i in
mfs:*) name=mfs$mfs; mfs=`expr $mfs + 1`;;
*) name=`echo $i | awk '{ gsub("[^a-zA-Z0-9_]", "_", $1); print $1 }'` ;;
esac
echo -n "$name.label "
echo $i | awk "{
dir=\$6;
if (length(dir) <= $MAXLABEL)
print dir
else
printf (\"...%s\n\", substr (dir, length(dir)-$MAXLABEL+4, $MAXLABEL-3))
print \"$name.info \" \$6 \" -> \" \$1;
}"
echo "$name.warning 92"
echo "$name.critical 98"
done
exit 0
fi
mfs=0
/bin/df -P -t $TYPES | tail +2 | grep -v "//" | while read i; do
case $i in
mfs:*) name=mfs$mfs; mfs=`expr $mfs + 1`;;
*) name=`echo $i | awk '{ gsub("[^a-zA-Z0-9_]", "_", $1); print $1 }'` ;;
esac
echo -n "$name.value "
echo $i | awk '{ print $5 }' | cut -f1 -d%
done

View File

@@ -0,0 +1,94 @@
#!/bin/sh
#
# Plugin to monitor inode-usage.
#
# Parameters understood:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# $Log: df_inode.in,v $
# Revision 1.2 2010/10/27 18:23:13 shattered
# Also ignore null and union filesystems, bump revision.
#
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#
# Magic markers (optional - used by munin-config and installation
# scripts):
#
#%# family=auto
#%# capabilities=autoconf
MAXLABEL=20
TYPES=noprocfs,devfs,fdescfs,ptyfs,kernfs,nfs,null,union
print_values() {
mfs=0
/bin/df -P -i -t $TYPES | tail +2 | grep -v "//" | \
while read i; do
case $i in
mfs:*) name=mfs$mfs; mfs=`expr $mfs + 1`;;
*) name=`echo $i | awk '{
gsub("[^a-zA-Z0-9_]", "_", $1); print $1 }'`
;;
esac
echo -n "$name.value "
echo $i | awk '{ print $8 }' | cut -f1 -d%
done
}
if [ "$1" = "autoconf" ]; then
if [ "`print_values`" = "" ] ; then
echo no
exit 1
else
echo yes
exit 0
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title Inode usage (in %)'
echo 'graph_args --upper-limit 100 -l 0'
echo 'graph_vlabel %'
echo 'graph_category disk'
echo 'graph_info This graph shows the inode usage for the partitions of types that use inodes.'
/bin/df -P -i -t $TYPES | tail +2 | grep -v "//" | awk "
BEGIN {
mfs = 0
}
{
name = \$1
dir = \$9
if (\$1 ~ /^mfs:/) {
name = \"mfs\" mfs
mfs = mfs + 1
} else {
gsub(/[^a-zA-Z0-9_]/, \"_\", name)
}
if (length(dir) <= $MAXLABEL)
print name \".label \" dir
else
printf (\"%s.label ...%s\n\", name, substr (dir, length(dir)-$MAXLABEL+4, $MAXLABEL-3))
print name \".info \" dir \" -> \" name
print name \".warning 92\"
print name \".critical 98\"
}"
exit 0
fi
print_values

View File

@@ -0,0 +1,75 @@
#!/bin/sh
#
# Plugin to monitor the number of forks per second on the machine.
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# $Log: forks.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#
# Magick markers (optional - used by munin-config and som installation
# scripts):
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -x /usr/bin/vmstat ]; then
echo yes
exit 0
else
echo "no (no /usr/bin/vmstat executable)"
exit 1
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title Fork rate'
echo 'graph_args --base 1000 -l 0 '
echo 'graph_vlabel forks / ${graph_period}'
echo 'graph_category processes'
echo 'graph_info This graph shows the number of forks (new processes started) per second.'
echo 'forks.label forks'
echo 'forks.type DERIVE'
echo 'forks.min 0'
echo 'forks.max 100000'
echo 'forks.info The number of forks per second.'
echo 'forkblk.label forks blocked parent'
echo 'forkblk.type DERIVE'
echo 'forkblk.min 0'
echo 'forkblk.max 100000'
echo 'forkblk.info The number of forks which blocked the parent process.'
echo 'forksh.label shared addrs w. parent'
echo 'forksh.type DERIVE'
echo 'forksh.min 0'
echo 'forksh.max 100000'
echo 'forksh.info The number of forks which shared address space with the parent process.'
exit 0
fi
vmstat -s | awk '
/forks total$/ { print "forks.value " $1; }
/forks blocked parent$/ { print "forkblk.value " $1; }
/forks shared address space with parent$/ { print "forksh.value " $1; }
'

View File

@@ -0,0 +1,80 @@
#!/bin/sh
#
# Wildcard-plugin to monitor network interfaces. To monitor an
# interface, link if_<interface> to this file. E.g.
#
# ln -s /usr/share/munin/node/plugins-auto/if_ /etc/munin/node.d/if_eth0
#
# ...will monitor eth0.
#
# Any device found in /usr/bin/netstat can be monitored.
#
# $Log: if_.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
# Magic markers (optional - used by munin-config and some installation
# scripts):
#
#%# family=auto
#%# capabilities=autoconf suggest
INTERFACE=`basename $0 | sed 's/^if_//g'`
if [ "$1" = "autoconf" ]; then
if [ -x /usr/bin/netstat ]; then
echo yes
exit 0
else
echo "no (/usr/bin/netstat not found)"
exit 1
fi
fi
if [ "$1" = "suggest" ]; then
if [ -x /usr/bin/netstat ]; then
netstat -i -b | sed -n -e '/^faith/d' -e '/^lo0/d' -e '/<Link.*>/s/\** .*//p'
exit 0
else
exit 1
fi
fi
if [ "$1" = "config" ]; then
echo "graph_order rbytes obytes"
echo "graph_title $INTERFACE traffic"
echo 'graph_args --base 1000'
echo 'graph_vlabel bits per ${graph_period} in (-) / out (+)'
echo 'graph_category network'
echo "graph_info This graph shows the traffic of the $INTERFACE network interface. Please note that the traffic is shown in bits per second, not bytes."
echo 'rbytes.label received'
echo 'rbytes.type COUNTER'
echo 'rbytes.graph no'
echo 'rbytes.cdef rbytes,8,*'
echo 'obytes.label bps'
echo 'obytes.type COUNTER'
echo 'obytes.negative rbytes'
echo 'obytes.cdef obytes,8,*'
echo "obytes.info Traffic sent (+) and received (-) on the $INTERFACE network interface."
exit 0
fi;
/usr/bin/netstat -i -b -I $INTERFACE | awk '
/<Link.*>/ {
print "rbytes.value ", $5;
print "obytes.value ", $6;
}'

View File

@@ -0,0 +1,76 @@
#!/bin/sh
#
# Wildcard-plugin to monitor network interfaces. To monitor an
# interface, link if_<interface> to this file. E.g.
#
# ln -s /usr/share/munin/node/plugins-auto/if_ /etc/munin/node.d/if_eth0
#
# ...will monitor eth0.
#
# Any device found in /usr/bin/netstat can be monitored.
#
# $Log: if_errcoll_.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#
# Magic markers (optional - used by munin-config and some installation
# scripts):
#
#%# family=auto
#%# capabilities=autoconf suggest
INTERFACE=`basename $0 | sed 's/^if_errcoll_//g'`
if [ "$1" = "autoconf" ]; then
if [ -x /usr/bin/netstat ]; then
echo yes
exit 0
else
echo "no (/usr/bin/netstat not found)"
exit 1
fi
fi
if [ "$1" = "suggest" ]; then
if [ -x /usr/bin/netstat ]; then
netstat -i -b | sed -n -e '/^faith/d' -e '/^lo0/d' -e '/<Link.*>/s/\** .*//p'
exit 0
else
exit 1
fi
fi
if [ "$1" = "config" ]; then
echo "graph_order ierrors oerrors collisions"
echo "graph_title $INTERFACE Errors & Collisions"
echo 'graph_args --base 1000'
echo 'graph_vlabel events / ${graph_period}'
echo 'graph_category network'
echo "graph_info This graph shows the amount of errors and collisions on the $INTERFACE network interface."
echo 'ierrors.label Input Errors'
echo 'ierrors.type COUNTER'
echo 'oerrors.label Output Errors'
echo 'oerrors.type COUNTER'
echo 'collisions.label Collisions'
echo 'collisions.type COUNTER'
exit 0
fi;
/usr/bin/netstat -i -I $INTERFACE | awk '
/<Link.*>/ {
print "ierrors.value", $6;
print "oerrors.value", $8;
print "collisions.value", $9;
}'

View File

@@ -0,0 +1,104 @@
#!/bin/sh
#
# Plugin to monitor the number of interrupts and context switches on a system.
#
# Idea and base from Ragnar Wisløff.
#
# Usage: Link or copy into /etc/munin/node.d/
#
# $Log: interrupts.in,v $
# Revision 1.2 2006/06/08 18:59:26 he
# Remove installation of the documentation from this package, to be
# provided by the soon-to-be-committed munin-doc package.
#
# Other minor changes:
# o Remove comented-out bits from package Makefile
# o Re-ordered variables reported by NetBSD's cpu plugin script
# o Use shorter legend text in NetBSD's interrupts plugin script
#
# Bumped package revision.
#
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
# Magic markers (optional - only used by munin-config and some
# installation scripts):
#
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -x /usr/bin/vmstat ]; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
# If run with the "config"-parameter, give out information on how the
# graphs should look.
if [ "$1" = "config" ]; then
# The title of the graph
echo 'graph_title Interrupts & context switches'
# Arguments to "rrdtool graph". In this case, tell it that the
# lower limit of the graph is '0', and that 1k=1000 (not 1024)
echo 'graph_args --base 1000 -l 0'
# The Y-axis label
echo 'graph_vlabel interrupts & ctx switches / ${graph_period}'
# Graph category
echo 'graph_category system'
# Graph information
echo 'graph_info This graph shows the number of interrupts and context switches on the system. These are typically high on a busy system.'
echo 'devint.info Device interrupts come from hardware (exceptions, NMI, IRQ)'
echo 'softint.info Software interrupts are typically deferred processing from hardware interrupts'
echo 'ctx.info A context switch occurs when a multitasking operatings system suspends the currently running process, and starts executing another.'
# The fields. "label" is used in the legend. "label" is the only
# required subfield.
echo 'devint.label device intrs'
echo 'softint.label software intrs'
echo 'ctx.label context switches'
# Specify type
echo 'devint.type DERIVE'
echo 'softint.type DERIVE'
echo 'ctx.type DERIVE'
# Set max (should always be done with counters) Note: this is max
# per second.
echo 'devint.max 100000'
echo 'softint.max 100000'
echo 'ctx.max 100000'
echo 'devint.min 0'
echo 'softint.min 0'
echo 'ctx.min 0'
# Last, if run with the "config"-parameter, quit here (don't
# display any data)
exit 0
fi
# The real work
vmstat -s | awk '
/device interrupts$/ { print "devint.value " $1; }
/context switches$/ { print "ctx.value " $1; }
/software interrupts$/ { print "softint.value " $1; }
'

View File

@@ -0,0 +1,117 @@
#!/bin/sh
#
# Plugin for watching io-bound traffic (in bytes) on disks.
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# $Log: iostat.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#
# Magick markers (optional - used by munin-config and som installation
# scripts):
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -x /usr/sbin/iostat ]; then
echo yes
exit 0
else
echo "no (no /usr/sbin/iostat executable)"
exit 1
fi
fi
nf=`/usr/sbin/iostat -I -x | tail -1 | awk '{ print NF }'`
if [ $nf -eq 5 ]; then
oldformat=true
else
oldformat=false
fi
if [ "$1" = "config" ]; then
echo 'graph_title IOstat by bytes'
echo 'graph_args --base 1024 -l 0 '
if ! $oldformat; then
echo 'graph_vlabel MB per ${graph_period} read (-) / written (+)'
else
echo 'graph_vlabel MB per ${graph_period} read+written'
fi
echo 'graph_category disk'
echo 'graph_info This graph shows the I/O to and from block devices'
drives=`/usr/sbin/iostat -I -x | awk '
/^device/ { next; }
// { print $1; }'`
echo -n 'graph_order'
for d in $drives; do
if $oldformat; then
echo -n ' '${d}'_io'
else
echo -n ' '${d}'_read '${d}'_write'
fi
done
echo
if $oldformat; then
for d in $drives; do
echo "${d}_io.label ${d}"
echo "${d}_io.info I/O on device ${d}"
echo "${d}_io.type DERIVE"
echo "${d}_io.max 2000"
echo "${d}_io.min 0"
done
else
for d in $drives; do
echo "${d}_read.label ${d}"
echo "${d}_read.type DERIVE"
echo "${d}_read.max 2000"
echo "${d}_read.min 0"
echo "${d}_read.graph no"
echo "${d}_write.label ${d}"
echo "${d}_write.info I/O on device ${d}"
echo "${d}_write.type DERIVE"
echo "${d}_write.max 2000"
echo "${d}_write.min 0"
echo "${d}_write.negative ${d}_read"
done
fi
exit 0
fi
if $oldformat; then
/usr/sbin/iostat -I -x | awk '
/^device/ { next; }
{
print $1 "_io.value " int($5);
}
'
else
/usr/sbin/iostat -I -x | awk '
/^device/ { next; }
{
print $1 "_read.value " int($5);
print $1 "_write.value " int($9);
}
'
fi

View File

@@ -0,0 +1,117 @@
#!/bin/sh
#
# Plugin for watching io-bound traffic (in transfers) on disks.
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# $Log: iostat_ops.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#
# Magick markers (optional - used by munin-config and som installation
# scripts):
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -x /usr/sbin/iostat ]; then
echo yes
exit 0
else
echo "no (no /usr/sbin/iostat executable)"
exit 1
fi
fi
nf=`/usr/sbin/iostat -I -x | tail -1 | awk '{ print NF }'`
if [ $nf -eq 5 ]; then
oldformat=true
else
oldformat=false
fi
if [ "$1" = "config" ]; then
echo 'graph_title IOstat by transfers'
echo 'graph_args --base 1000 -l 0 '
if ! $oldformat; then
echo 'graph_vlabel Xfers per ${graph_period} read (-) / written (+)'
else
echo 'graph_vlabel Xfers per ${graph_period} read+written'
fi
echo 'graph_category disk'
echo 'graph_info This graph shows the I/O to and from block devices'
drives=`/usr/sbin/iostat -I -x | awk '
/^device/ { next; }
// { print $1; }'`
echo -n 'graph_order'
for d in $drives; do
if $oldformat; then
echo -n ' ' ${d}'_io'
else
echo -n ' ' ${d}'_read ' ${d}'_write '
fi
done
echo
if $oldformat; then
for d in $drives; do
echo "${d}_io.label ${d}"
echo "${d}_io.info I/O on device ${d}"
echo "${d}_io.type DERIVE"
echo "${d}_io.max 20000"
echo "${d}_io.min 0"
done
else
for d in $drives; do
echo "${d}_read.label ${d}"
echo "${d}_read.type DERIVE"
echo "${d}_read.max 20000"
echo "${d}_read.min 0"
echo "${d}_read.graph no"
echo "${d}_write.label ${d}"
echo "${d}_write.info I/O on device ${d}"
echo "${d}_write.type DERIVE"
echo "${d}_write.max 20000"
echo "${d}_write.min 0"
echo "${d}_write.negative ${d}_read"
done
fi
exit 0
fi
if $oldformat; then
/usr/sbin/iostat -I -x | awk '
/^device/ { next; }
{
print $1 "_io.value " $3;
}
'
else
/usr/sbin/iostat -I -x | awk '
/^device/ { next; }
{
print $1 "_read.value " $3;
print $1 "_write.value " $7;
}
'
fi

View File

@@ -0,0 +1,84 @@
#! /bin/sh
#
# Plugin to monitor the individual interrupt sources.
#
# Usage: Link or copy into /etc/munin/node.d/
#
# $Log: irqstats.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
# Magic markers (optional - only used by munin-config and some
# installation scripts):
#
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -x /usr/bin/vmstat ]; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
intr_sources () {
/usr/bin/vmstat -i | awk '
/^interrupt/ { next; }
/^Total/ { next; }
{
s=substr($0, 1, 24);
gsub(" *$", "", s);
gsub(" ", "_", s);
print s;
}
'
}
# If run with the "config"-parameter, give out information on how the
# graphs should look.
if [ "$1" = "config" ]; then
echo 'graph_title Individual interrupts'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel interrupts / ${graph_period}'
echo 'graph_category system'
echo -n 'graph_order '
for i in `intr_sources`; do
echo -n ' intr_'${i}
done
echo
for i in `intr_sources`; do
# echo 'intr_'${i}'.draw LINE'
echo 'intr_'${i}'.label' `echo $i | sed -e 's/_/ /g'`
echo 'intr_'${i}'.info Interrupt' `echo $i | sed -e 's/_/ /g'`
echo 'intr_'${i}'.type DERIVE'
echo 'intr_'${i}'.min 0'
done
exit 0
fi
/usr/bin/vmstat -i | awk '
/^interrupt/ { next; }
/^Total/ { next; }
/[0-9]/{
s=substr($0, 1, 24);
gsub(" *$", "", s);
gsub(" ", "_", s);
print "intr_" s ".value " $(NF-1);
}
'

View File

@@ -0,0 +1,122 @@
#!/bin/sh
#
# Plugin to monitor the load average on a system.
#
# Usage: Link or copy into /etc/munin/node.d/
#
# Magic markers (optional - only used by munin-config and some
# installation scripts):
#
# $Log: load.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#
#%# family=auto
#%# capabilities=autoconf
# If run with the "autoconf"-parameter, give our opinion on wether we
# should be run on this system or not. This is optinal, and only used by
# munin-config. In the case of this plugin, we should most probably
# always be included.
if [ "$1" = "autoconf" ]; then
if [ -x /sbin/sysctl ]; then
/sbin/sysctl vm.loadavg > /dev/null
if [ $? = "0" ]; then
echo yes
exit 0
else
echo no
exit 1
fi
else
echo no
exit 1
fi
fi
NCPU=`/sbin/sysctl -n hw.ncpu`
# If we fail for some reason, default to 1 cpu
if [ $? != 0 ]; then NCPU=1; fi
# If run with the "config"-parameter, give out information on how the
# graphs should look.
if [ "$1" = "config" ]; then
# The host name this plugin is for. (Can be overridden to have
# one machine answer for several)
# The title of the graph
echo 'graph_title Load average'
# Arguments to "rrdtool graph". In this case, tell it that the
# lower limit of the graph is '0', and that 1k=1000 (not 1024)
echo 'graph_args --base 1000 -l 0'
# The Y-axis label
echo 'graph_vlabel load'
# We want Cur/Min/Avg/Max unscaled (i.e. 0.42 load instead of
# 420 milliload)
echo 'graph_noscale true'
# The category of the plugin. Defaults to "other".
echo 'graph_category system'
# The fields. "label" is used in the legend. "label" is the only
# required subfield.
echo 'load.label load'
# These two are optional. They are only used if you have
# configured your munin to tell a Nagios-server about any
# problems
echo 'load.warning ' $((10 * $NCPU))
echo 'load.critical 120'
# This one is purely to add an explanation to the web page. The first
# one is for the graph itself, while the second one is for the field
# "load".
echo 'graph_info The load average of the machine describes how many processes are in the run-queue (scheduled to run "immediately").'
echo 'load.info Average load for the five minutes.'
# Last, if run with the "config"-parameter, quit here (don't
# display any data)
exit 0
fi
# If not run with any parameters at all (or only unknown ones), do the
# real work - i.e. display the data. Almost always this will be
# "value" subfield for every data field.
echo -n "load.value "
/sbin/sysctl vm.loadavg | cut -f3 -d' '
# How could this plugin have been written in its simplest form?
# Something like this:
#
# ---------------------
# #!/bin/sh
#
# if [ "$1" = "config" ]; then
# echo "graph_title Load average"
# echo 'graph_args --base 1000 -l 0'
# echo 'graph_vlabel load'
# echo "load.label load"
# exit 0
# fi
# echo -n "load.value "
# cut -f1 -d' ' < /proc/loadavg
# ---------------------
#
# Except for the Nagios-warnings (which most people don't have any need
# for) and things used by installation scripts and munin-config (which
# you don't need if you don't plan on submitting your plugin to the
# pacakge), the two versions will work identically.

View File

@@ -0,0 +1,89 @@
#!/bin/sh
#
# Plugin to monitor memory usage.
#
# Parameters:
#
# config (required)
# autoconf (optional - only used by munin-config)
#
# $Log: memory.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#
# Magic markers (optional - only used by munin-config and some
# installation scripts):
#
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -x /sbin/sysctl ]; then
/sbin/sysctl hw.pagesize > /dev/null
if [ $? = "0" ]; then
echo yes
exit 0
else
echo no
exit 1
fi
else
echo no
exit 1
fi
fi
PAGESIZE=`/sbin/sysctl -n hw.pagesize`
MEMSIZE=`vmstat -s | awk '/pages managed/ { print $1 }'`
MEMMAX=`echo 2k $PAGESIZE $MEMSIZE '*p' | dc`
if [ "$1" = "config" ]; then
echo 'graph_args --base 1024 -l 0 --vertical-label Bytes --upper-limit '$MEMMAX
echo 'graph_title Memory usage'
echo 'graph_category system'
echo 'graph_info This graph shows what the machine uses its memory for.'
echo 'graph_order active inactive wired kernel free'
echo 'active.label active'
echo 'active.info pages recently statistically used'
echo 'active.draw AREA'
echo 'inactive.label inactive'
echo 'inactive.info pages recently statistically unused'
echo 'inactive.draw STACK'
echo 'wired.label wired'
echo 'wired.info pages that are fixed into memory'
echo 'wired.draw STACK'
echo 'kernel.label kernel'
echo 'kernel.info pages used by the kernel'
echo 'kernel.draw STACK'
echo 'free.label free'
echo 'free.info pages without data content'
echo 'free.draw STACK'
exit 0
fi
vmstat -s | awk -v bpp=$PAGESIZE '
/pages managed$/ { managed = $1; }
/pages free$/ { free = $1; print "free.value " $1 * bpp; }
/pages active$/ { active = $1; print "active.value " $1 * bpp; }
/pages inactive$/ { inactive = $1; print "inactive.value " $1 * bpp; }
/pages wired$/ { wired = $1; print "wired.value " $1 * bpp; }
END { kernel = managed - wired - inactive - active - free;
print "kernel.value " kernel * bpp; }'

View File

@@ -0,0 +1,143 @@
#! /bin/sh
#
# Plugin to monitor NetBSD kernel memory pool usage.
#
# Parameters:
#
# config (required)
# autoconf (optional - only used by munin-config)
#
# $Log: memory_pools.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#
# Magic markers (optional - only used by munin-config and some
# installation scripts):
#
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -x /usr/bin/vmstat ]; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
PAGESIZE=`/sbin/sysctl -n hw.pagesize`
KMEM=`vmstat -s | awk -v bpp=$PAGESIZE '
/pages managed$/ { managed = $1; }
/pages free$/ { free = $1; }
/pages active$/ { active = $1; }
/pages inactive$/ { inactive = $1;}
/pages wired$/ { wired = $1; }
END { kernel = managed - wired - inactive - active - free;
print kernel * bpp; }'`
if [ "$1" = "config" ]; then
echo 'graph_args --base 1024 -l 0 --vertical-label Bytes'
echo 'graph_title Kernel Pool Memory usage'
echo 'graph_category system'
echo 'graph_info This graph shows the kernel memory pool usage'
echo 'graph_order vnode ncache ffsino mbufs rest bufpl bufs'
echo 'vnode.label vnodes'
echo 'vnode.info vnode cache'
echo 'vnode.draw AREA'
echo 'ncache.label ncache'
echo 'ncache.info namei cache'
echo 'ncache.draw STACK'
echo 'ffsino.label ffs-i'
echo 'ffsino.info FFS inode cache'
echo 'ffsino.draw STACK'
echo 'mbufs.label mbufs'
echo 'mbufs.info network buffers (mbufs + mbuf clusters)'
echo 'mbufs.draw STACK'
echo 'rest.label rest'
echo 'rest.info sum of other memory pools'
echo 'rest.draw STACK'
echo 'bufpl.label bufpl'
echo 'bufpl.info buffer pool'
echo 'bufpl.draw STACK'
echo 'bufs.label bufs'
echo 'bufs.info buffer pools, for file metadata'
echo 'bufs.draw STACK'
exit 0
fi
vmstat -m -W > /dev/null 2>&1
if [ $? -eq 0 ]; then
vmstat -m -W 2>/dev/null | awk '
/^Memory resource pool statistics/ { inpool=1; next; }
/^In use/ { inpool=0; next; }
/^Name/ { next; }
/^vnodepl/ && inpool { vnode = $10 * $11; next; }
/^ncachepl/ && inpool { ncache = $10 * $11; next; }
/^ffsinopl/ && inpool { ffsino = $10 * $11; next; }
/^dino1pl/ && inpool { dinopl = $10 * $11; next; }
/^buf.*k / && inpool { bufk += $10 * $11; next; }
/^bufpl/ && inpool { bufpl = $10 * $11; next; }
/^mbpl/ && inpool { mbufs += $10 * $11; next; }
/^mclpl/ && inpool { mbufs += $10 * $11; next; }
$16 != "0x200" && $16 != "0x600" && inpool { rest += $10 * $11; }
END {
print "bufs.value " bufk;
print "bufpl.value " bufpl;
print "vnode.value " vnode;
print "ncache.value " ncache;
print "ffsino.value " ffsino;
print "mbufs.value " mbufs;
print "rest.value " rest;
}'
else
# Need to guess size of pool pages, may not be correct
# for small-memory machines (< 16MB)
vmstat -m 2>/dev/null | awk -v bpp=$PAGESIZE '
/^Memory resource pool statistics/ { inpool=1; next; }
/^In use/ { inpool=0; next; }
/^Name/ { next; }
/^vnodepl/ && inpool { vnode = $8 * bpp; next; }
/^ncachepl/ && inpool { ncache = $8 * bpp; next; }
/^ffsinopl/ && inpool { ffsino = $8 * bpp; next; }
/^dino1pl/ && inpool { dinopl = $8 * bpp; next; }
/^buf.*k / && inpool { bufk += $8 * 65536; next; }
/^bufpl/ && inpool { bufpl = $8 * bpp; next; }
/^mbpl/ && inpool { mbufs += $8 * bpp; next; }
/^mclpl/ && inpool { mbufs += $8 * bpp; next; }
/^kvakernel/ { next; }
/^kvakmem/ { next; }
inpool { rest += $8 * bpp; }
END {
print "bufs.value " bufk;
print "bufpl.value " bufpl;
print "vnode.value " vnode;
print "ncache.value " ncache;
print "ffsino.value " ffsino;
print "mbufs.value " mbufs;
print "rest.value " rest;
}'
fi

View File

@@ -0,0 +1,88 @@
#! /bin/sh
#
# Plugin to monitor memory usage by type.
#
# Parameters:
#
# config (required)
# autoconf (optional - only used by munin-config)
#
# $Log: memory_types.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#
# Magic markers (optional - only used by munin-config and some
# installation scripts):
#
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -x /sbin/sysctl ]; then
if /sbin/sysctl hw.pagesize > /dev/null 2>&1; then
echo yes
exit 0
else
echo no
exit 1
fi
else
echo no
exit 1
fi
fi
PAGESIZE=`/sbin/sysctl -n hw.pagesize`
MEMSIZE=`vmstat -s | awk '/pages managed/ { print $1 }'`
MEMMAX=`echo 2k $PAGESIZE $MEMSIZE '*p' | dc`
if [ "$1" = "config" ]; then
echo 'graph_args --base 1024 -l 0 --vertical-label Bytes --upper-limit '$MEMMAX
echo 'graph_title Memory usage by category'
echo 'graph_category system'
echo 'graph_info This graph shows how the machine uses its memory.'
echo 'graph_order exec anon file kernel free'
echo 'exec.label exec'
echo 'exec.info memory for cached executables'
echo 'exec.draw AREA'
echo 'anon.label anon'
echo 'anon.info anonymous memory'
echo 'anon.draw STACK'
echo 'file.label file'
echo 'file.info memory for cached non-executable files'
echo 'file.draw STACK'
echo 'kernel.label kernel'
echo 'kernel.info memory used by the kernel'
echo 'kernel.draw STACK'
echo 'free.label free'
echo 'free.info free memory'
echo 'free.draw STACK'
exit 0
fi
vmstat -s | awk -v bpp=$PAGESIZE '
/pages managed$/ { managed = $1; }
/pages free$/ { free = $1; print "free.value " $1 * bpp; }
/anonymous pages$/{ anon = $1; print "anon.value " $1 * bpp; }
/cached file pages$/{ file = $1; print "file.value " $1 * bpp; }
/cached executable pages$/{ exec = $1; print "exec.value " $1 * bpp; }
END { kernel = managed - anon - file - exec - free;
print "kernel.value " kernel * bpp; }'

View File

@@ -0,0 +1,94 @@
#!/bin/sh
#
# Plugin to monitor network connections.
#
# Parameters:
#
# config (required)
# autoconf (optional - only used by munin-config)
#
# $Log: netstat.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#
# Magic markers (optional - used by munin-config and some installation
# scripts):
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if ( netstat -s 2>/dev/null >/dev/null ); then
echo yes
exit 0
else
if [ $? -eq 127 ]
then
echo "no (netstat program not found)"
exit 1
else
echo no
exit 1
fi
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title Netstat'
echo 'graph_args -l 0 --base 1000'
echo 'graph_vlabel active connections per ${graph_period}'
echo 'graph_category network'
echo 'graph_period second'
echo 'graph_info This graph shows the TCP activity of all the network interfaces combined.'
echo 'active.label active'
echo 'active.type DERIVE'
echo 'active.min 0'
echo 'active.max 50000'
echo 'active.info The number of active TCP openings per second.'
echo 'passive.label passive'
echo 'passive.type DERIVE'
echo 'passive.min 0'
echo 'passive.max 50000'
echo 'passive.info The number of passive TCP openings per second.'
echo 'failed.label failed'
echo 'failed.type DERIVE'
echo 'failed.min 0'
echo 'failed.max 50000'
echo 'failed.info The number of failed TCP connection attempts per second.'
echo 'resets.label resets'
echo 'resets.type DERIVE'
echo 'resets.min 0'
echo 'resets.max 50000'
echo 'resets.info The number of TCP connection resets.'
echo 'established.label established'
echo 'established.type DERIVE'
echo 'established.min 0'
echo 'established.max 50000'
echo 'established.info The number of currently open connections.'
exit 0
fi
netstat -s | awk '
/connection requests/ { print "active.value " $1 }
/connection accepts/ { print "passive.value " $1 }
/bad connection/ { print "failed.value " $1 }
/reset/ { print "resets.value " $1 }
/connections established/ { print "established.value " $1 }'

View File

@@ -0,0 +1,82 @@
#!/bin/sh
#
# Plugin to monitor NFS client traffic
#
# $Log: nfs_client.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#%# family=auto
#%# capabilities=autoconf
getnames () {
/usr/bin/nfsstat -c | awk '
/RPC Counts/ { coll = 1; next; }
/RPC Info/ { exit 0; }
/[a-z]/ && coll {
for (n = 1; n <= NF; n++) {
print $n
}
}
'
}
if [ "$1" = "autoconf" ]; then
if [ -x /usr/bin/nfsstat ]; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title NFS Client'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel requests / ${graph_period}'
echo 'graph_total total'
echo 'graph_category NFS'
for a in `getnames` ; do
echo "$a.label $a"
echo "$a.type DERIVE"
echo "$a.min 0"
done
exit 0
fi
/usr/bin/nfsstat -c | awk '
/RPC Counts/ { coll=1; next; }
/RPC Info/ { exit 0; }
/[a-z]/ && coll {
for (n in names) {
names[n] = ""
}
for (n = 1; n <= NF; n++) {
names[n] = $n
}
}
/[0-9]/ && coll {
for (n = 1; n <= NF/2; n++) {
name = names[n]
values[name] = $((n - 1) * 2 + 1)
}
}
END {
for (v in values) {
print v ".value " values[v];
}
}
'

View File

@@ -0,0 +1,82 @@
#!/bin/sh
#
# Plugin to monitor NFS server traffic
#
# $Log: nfsd.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#%# family=auto
#%# capabilities=autoconf
getnames () {
/usr/bin/nfsstat -s | awk '
/RPC Counts/ { coll = 1; next; }
/Server Errors/ { exit 0; }
/[a-z]/ && coll {
for (n = 1; n <= NF; n++) {
print $n
}
}
'
}
if [ "$1" = "autoconf" ]; then
if [ -x /usr/bin/nfsstat ]; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title NFS Server'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel requests / ${graph_period}'
echo 'graph_total total'
echo 'graph_category NFS'
for a in `getnames` ; do
echo "$a.label $a"
echo "$a.type DERIVE"
echo "$a.min 0"
done
exit 0
fi
/usr/bin/nfsstat -s | awk '
/RPC Counts/ { coll=1; next; }
/Server Errors/ { exit 0; }
/[a-z]/ && coll {
for (n in names) {
names[n] = ""
}
for (n = 1; n <= NF; n++) {
names[n] = $n
}
}
/[0-9]/ && coll {
for (n = 1; n <= NF/2; n++) {
name = names[n]
values[name] = $((n - 1) * 2 + 1)
}
}
END {
for (v in values) {
print v ".value " values[v];
}
}
'

View File

@@ -0,0 +1,81 @@
#!/bin/sh
#
# Plugin to monitor the number of open files in the system.
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# $Log: open_files.in,v $
# Revision 1.2 2008/10/15 13:13:09 he
# Convert from using an input-less awk job (how did that ever work?)
# to using shell arithmetic, which should be more light-weight and should
# not pose a danger of hanging.
#
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#
# Magic markers (Used by munin-config and some installation scripts.
# Optional):
#
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -x /usr/sbin/pstat ]; then
/usr/sbin/pstat -T | grep files > /dev/null
if [ $? = "0" ]; then
echo yes
exit 0
else
echo no
exit 1
fi
else
echo no
exit 1
fi
fi
eval `/usr/sbin/pstat -T | awk '/files/ {
split($1, a, "/");
print "filemax=" a[2];
print "openfiles=" a[1];
}'`
if [ "$1" = "config" ]; then
echo 'graph_title File table usage'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel number of open files'
echo 'graph_category system'
echo 'graph_info This graph monitors the Linux open files table.'
echo 'used.label open files'
echo 'used.info The number of currently open files.'
echo 'max.label max open files'
echo 'max.info The maximum supported number of open files.'
echo "used.warning $(($filemax * 92/100))"
echo "used.critical $(($filemax * 98/100))"
exit 0
fi
echo 'max.value ' $filemax
echo 'used.value ' $openfiles

View File

@@ -0,0 +1,52 @@
#!/bin/sh
#
# Plugin to monitor the number of processes on the machine. Much like
# doing a "ps | wc -l".
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# $Log: processes.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#
# Magick markers (optional - used by munin-config and som installation
# scripts):
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Number of Processes'
echo 'graph_args --base 1000 -l 0 '
echo 'graph_vlabel number of processes'
echo 'graph_category processes'
echo 'graph_info This graph shows the number of processes in the system.'
echo 'processes.label processes'
echo 'processes.info The current number of processes.'
echo 'processes.draw LINE2'
exit 0
fi
echo -n "processes.value "
ps ax | wc -l

View File

@@ -0,0 +1,144 @@
#!/bin/sh
#
# Plugin to monitor various environment sensors provided by envstat(8)
# on NetBSD
#
# Requirements:
# - envsys(4) driver configured and supported hardware present
# - envstat(8) program present
#
# Parameters supported:
#
# config
# autoconf
# suggest
#
# $Log: sensors_.in,v $
# Revision 1.2 2006/07/21 23:28:37 abs
# Use PKG_SYSCONFSUBDIR so PKG_SYSCONFBASE can be set
# Use REPLACE_PERL on all plugins
# Adjust sensors_ to work with NetBSD 3
# Bump PKGREVISION
#
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#%# family=auto
#%# capabilities="autoconf suggest"
if [ "$1" = "autoconf" ]; then
if [ -x /usr/sbin/envstat ]; then
if /usr/sbin/envstat -r >/dev/null 2>&1; then
echo yes
exit 0
else
echo no '(no sensors available via envstat(8))'
exit 1
fi
else
echo no '(/usr/sbin/envstat not executable)'
exit 1
fi
fi
if [ "$1" = "suggest" ]; then
/usr/sbin/envstat -r | awk '
/degC$/ { temp=1; }
/RPM$/ { fans=1; }
/V$/ { volt=1; }
END {
if (temp) {
print "temp";
}
if (fans) {
print "fans";
}
if (volt) {
print "volt";
}
}'
exit 0
fi
envstat_config()
{
/usr/sbin/envstat -r | awk -v "lookfor=$1" -F: '
BEGIN { p=0 }
match($0, lookfor "$") {
l=$1
gsub("[^A-Za-z0-9\\-]", "", $1);
print tolower(lookfor) "_" tolower($1) ".label " l;
p=1;
}
END {
if (!p) {
exit 1;
}
}'
if [ $? != 0 ]; then
echo "No $1 sensors found" >&2
exit 1
fi
}
envstat_value()
{
/usr/sbin/envstat -r | awk -v "lookfor=$1" -F: '
match($0, lookfor "$") {
gsub("[^A-Za-z0-9\\-]", "", $1);
sub(" *", "", $2);
sub(" .*", "", $2);
print tolower(lookfor) "_" tolower($1) ".value " $2;
}
'
}
if [ "$1" = "config" ]; then
case $0 in
*sensors_temp)
echo 'graph_title Temperatures'
echo 'graph_vtitle deg Celcius'
echo 'graph_args --base 1000 -l 0'
envstat_config degC
;;
*sensors_fans)
echo 'graph_title Fans'
echo 'graph_vtitle RPM'
echo 'graph_args --base 1000 -l 0'
envstat_config RPM
;;
*sensors_volt)
echo 'graph_title Voltages'
echo 'graph_vtitle Volt'
echo 'graph_args --base 1000 --logarithmic'
envstat_config V
;;
esac
echo 'graph_category sensors'
exit 0
fi
case $0 in
*sensors_temp)
envstat_value degC
;;
*sensors_fans)
envstat_value RPM
;;
*sensors_volt)
envstat_value V
;;
esac

View File

@@ -0,0 +1,74 @@
#!/bin/sh
#
# Plugin to monitor swap IO in number of blocks per second.
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# $Log: swap.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#
# Magic markers (used by munin-config and some installation scripts (i.e.
# optional)):
#
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -x /usr/bin/vmstat ]; then
/usr/bin/vmstat -s | grep 'swap ins' > /dev/null
if [ $? = "0" ]; then
echo yes
exit 0
else
echo no
exit 1
fi
else
echo no
exit 1
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title Swap in/out'
echo 'graph_args -l 0 --base 1000'
echo 'graph_vlabel pages per ${graph_period} in (-) / out (+)'
echo 'graph_category system'
echo 'graph_info This graph shows the swap activity of the system.'
echo 'swap_in.label swap'
echo 'swap_in.type DERIVE'
echo 'swap_in.min 0'
echo 'swap_in.max 100000'
echo 'swap_in.graph no'
echo 'swap_out.label swap'
echo 'swap_out.type DERIVE'
echo 'swap_out.min 0'
echo 'swap_out.max 100000'
echo 'swap_out.negative swap_in'
exit 0
fi
vmstat -s | awk '
/swap ins$/ { print "swap_in.value " $1; }
/swap outs$/ { print "swap_out.value " $1; }
'

View File

@@ -0,0 +1,53 @@
#! /bin/sh
#
# Plugin to monitor swap usage.
#
# Parameters:
#
# config (required)
# autoconf (optional - only used by munin-config)
#
# Magic markers (optional - only used by munin-config and some
# installation scripts):
#
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -x /sbin/sysctl ]; then
if /sbin/sysctl hw.pagesize > /dev/null 2>&1; then
echo yes
exit 0
else
echo no
exit 1
fi
else
echo no
exit 1
fi
fi
PAGESIZE=`/sbin/sysctl -n hw.pagesize`
if [ "$1" = "config" ]; then
echo 'graph_args --base 1024 -l 0 --vertical-label Bytes'
echo 'graph_title Swap usage'
echo 'graph_category system'
echo 'graph_info This graph shows how the machine uses its swap.'
echo 'graph_order size used'
echo 'size.label swap size'
echo 'size.draw AREA'
echo 'used.label swap used'
echo 'used.draw AREA'
exit 0
fi
vmstat -s | awk -v bpp=$PAGESIZE '
/swap pages in use$/ { print "used.value " $1 * bpp; }
/swap pages$/ { print "size.value " $1 * bpp; }
'

View File

@@ -0,0 +1,63 @@
#!/bin/sh
#
# Plugin to measure uptime. Especially the average and max values on the
# bigger graphs (yearly) can be interesting.
#
# $Log: uptime.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
# Magic markers - optional - used by installation scripts and
# munin-config:
#
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -x /sbin/sysctl ]; then
if /sbin/sysctl kern.boottime >/dev/null 2>&1; then
if [ -x /bin/date ]; then
echo yes
exit 0
else
echo no '(no /bin/date)'
exit 1
fi
else
echo no '(sysctl kern.boottime failed)' 2>&1
exit 1
fi
else
echo no '(no /sbin/sysctl)'
exit 1
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title Uptime'
echo 'graph_args --base 1000 -l 0 '
echo 'graph_vlabel uptime in days'
echo 'uptime.label uptime'
echo 'uptime.draw AREA'
exit 0
fi
boottime=`/sbin/sysctl -n kern.boottime`
now=`/bin/date +%s`
awk -v boottime=$boottime -v now=$now </dev/null '
END {
printf "uptime.value %.2f\n", (now - boottime) / 86400;
}'

View File

@@ -0,0 +1,102 @@
#!/bin/sh
#
# 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: vmstat.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#
# Magick markers (optional):
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -x /usr/bin/vmstat ]; then
if /usr/bin/vmstat 1 1 2>/dev/null >/dev/null; then
echo yes
exit 0
else
echo no
exit 1
fi
else
echo no
exit 1
fi
fi
/usr/bin/vmstat -t -c 1 >/dev/null 2>&1
if [ $? -eq 0 ]; then
new=true
else
new=false
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 'sleep.label sleep'
echo 'sleep.info processes waiting for some event'
echo 'sleep.type GAUGE'
if $new; then
echo 'diskwait.label diskwait'
echo 'diskwait.info processes waiting for disk i/o activity'
echo 'diskwait.type GAUGE'
echo 'pagewait.label pagewait'
echo 'pagewait.info processes waiting for page-in'
echo 'pagewait.type GAUGE'
else
echo 'iowait.label wait'
echo 'iowait.info processes blocked for resources (i/o, paging, etc.)'
echo 'iowait.type GAUGE'
fi
exit 0
fi
if $new; then
/usr/bin/vmstat -t -c 1 | tail -1 | awk '// {
print "running.value " $1;
print "diskwait.value " $2;
print "pagewait.value " $3;
print "sleep.value " $4;
print "swapped.value " $5;
}'
else
/usr/bin/vmstat -c 1 | tail -1 | awk '// {
print "running.value " $1;
print "iowait.value " $2;
print "sleep.value " $3;
}'
fi

View File

@@ -0,0 +1,43 @@
#! /bin/sh
#
# $Id: ntp_kernel_err.in,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
#
# Plugin to monitor the estimated error for the kernel NTP
# status.
#
# Usage: Link or copy into /etc/munin/node.d/
#
# Magic markers (optional - only used by munin-config and some
# installation scripts):
#
#%# family=manual
#%# capabilities=autoconf
# If run with the "autoconf"-parameter, give our opinion on wether we
# should be run on this system or not. This is optinal, and only used by
# munin-config. In the case of this plugin, we should most probably
# always be included.
if [ "$1" = "autoconf" ]; then
if ntpdc -c help >/dev/null 2>&1; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title NTP kernel PLL estimated error (secs)'
# echo 'graph_args --logarithmic'
echo 'graph_vlabel est. err (secs)'
echo 'graph_category other'
echo 'graph_info The kernels estimated error for the phase-locked loop used by NTP'
echo 'ntp_err.label est-error'
echo 'ntp_err.info Estimated error for the kernel PLL'
exit 0
fi
echo -n 'ntp_err.value '
ntpdc -c kern | awk '/^estimated error:/ { print $3 }'

View File

@@ -0,0 +1,50 @@
#! /bin/sh
#
# $Id: ntp_kernel_pll_freq.in,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
#
# Plugin to monitor the kernel's PLL frequency for the NTP
# status.
#
# Usage: Link or copy into /etc/munin/node.d/
#
# Magic markers (optional - only used by munin-config and some
# installation scripts):
#
#%# family=manual
#%# capabilities=autoconf
# If run with the "autoconf"-parameter, give our opinion on wether we
# should be run on this system or not. This is optinal, and only used by
# munin-config. In the case of this plugin, we should most probably
# always be included.
if [ "$1" = "autoconf" ]; then
if ntpdc -c help >/dev/null 2>&1; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
if [ -f @@CONFDIR@@/ntp-freq-comp ]; then
fcomp=`cat @@CONFDIR@@/ntp-freq-comp`
else
fcomp=0
fi
if [ "$1" = "config" ]; then
echo 'graph_title NTP kernel PLL frequency (ppm +' ${fcomp}')'
# echo 'graph-args --logarithmic'
echo 'graph_args --alt-autoscale'
echo 'graph_vlabel PLL frequency (ppm +' ${fcomp}')'
echo 'graph_category other'
echo 'graph_info The frequency for the kernel phase-locked loop used by NTP'
echo 'ntp_pll_freq.label pll-freq'
echo 'ntp_pll_freq.info Phase-locked loop frequency in parts per million'
exit 0
fi
echo -n 'ntp_pll_freq.value '
ntpdc -c kern | awk -v fcomp=$fcomp '/^pll frequency:/ { print $3 + fcomp }'

View File

@@ -0,0 +1,43 @@
#! /bin/sh
#
# $Id: ntp_kernel_pll_off.in,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
#
# Plugin to monitor the kernel's PLL offset for the NTP
# status.
#
# Usage: Link or copy into /etc/munin/node.d/
#
# Magic markers (optional - only used by munin-config and some
# installation scripts):
#
#%# family=manual
#%# capabilities=autoconf
# If run with the "autoconf"-parameter, give our opinion on wether we
# should be run on this system or not. This is optinal, and only used by
# munin-config. In the case of this plugin, we should most probably
# always be included.
if [ "$1" = "autoconf" ]; then
if ntpdc -c help >/dev/null 2>&1; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title NTP kernel PLL offset (secs)'
# echo 'graph-args --logarithmic'
echo 'graph_vlabel PLL offset (secs)'
echo 'graph_category other'
echo 'graph_info The kernel offset for the phase-locked loop used by NTP'
echo 'ntp_pll_off.label pll-offset'
echo 'ntp_pll_off.info Phase-locked loop offset in seconds'
exit 0
fi
echo -n 'ntp_pll_off.value '
ntpdc -c kern | awk '/^pll offset:/ { print $3 }'

View File

@@ -0,0 +1,86 @@
$NetBSD: patch-aa,v 1.4 2011/04/30 19:10:13 abs Exp $
--- Makefile.config.orig 2005-04-15 20:29:18.000000000 +0000
+++ Makefile.config
@@ -7,32 +7,32 @@
#
# the base of the Munin installation.
#
-PREFIX = $(DESTDIR)/opt/munin
+UPREFIX=${DESTDIR}$(PREFIX)
# Where Munin keeps its configurations (server.conf, client.conf, ++)
-CONFDIR = $(DESTDIR)/etc/opt/munin
+CONFDIR ?= $(UPREFIX)/etc/munin
# Server only - where to put munin-cron
-BINDIR = $(PREFIX)/bin
+BINDIR = $(UPREFIX)/bin
# Client only - where to put munin-node, munin-node-configure, and munin-run
-SBINDIR = $(PREFIX)/sbin
+SBINDIR = $(UPREFIX)/sbin
# Where to put text and html documentation
-DOCDIR = $(PREFIX)/doc
+DOCDIR = $(UPREFIX)/share/doc/munin
# Where to put man pages
-MANDIR = $(PREFIX)/man
+MANDIR = $(UPREFIX)/${PKGMANDIR}
# Where to put internal binaries and plugin repository
-LIBDIR = $(PREFIX)/lib
+LIBDIR = $(UPREFIX)/lib/munin
# Server only - Output directory
-HTMLDIR = $(PREFIX)/var/www
+HTMLDIR = $(UPREFIX)/www/munin/data
CGIDIR = $(HTMLDIR)/cgi
# Client only - Where to put RRD files and other intenal data
-DBDIR = $(DESTDIR)/var/opt/munin
+DBDIR = $(DESTDIR)/var/munin
# Client only - Where plugins should put their states. Must be writable by
# group "munin", and should be preserved between reboots
@@ -45,14 +45,14 @@ LOGDIR = $(DESTDIR)/var/log/munin
# writable by the user "munin".
STATEDIR = $(DESTDIR)/var/run/munin
-# The perl interpreter to use
-PERL = $(shell which perl)
+# The perl interpreter to use (passed in by pkgsrc)
+PERL = ${PERL5}
# The python interpreter to use (used by some plugins)
-PYTHON = /usr/bin/env python
+PYTHON = ${PYTHONBIN}
# Server only - Where to install the perl libraries
-PERLLIB = $(DESTDIR)$(shell $(PERL) -V:sitelib | cut -d= -f2 | sed "s/[\';]//g")
+PERLLIB = ${PERL5_SITELIB}
# Client only - Install plugins for this architecture
OSTYPE = $(shell uname | tr '[A-Z]' '[a-z]')
@@ -65,16 +65,15 @@ HOSTNAME = $(shell hostname)
VERSION = $(shell cat RELEASE)
# User to run munin as
-USER = munin
-GROUP = munin
+USER = ${MUNIN_USER}
+GROUP = ${MUNIN_GROUP}
# Default user to run the plugins as
PLUGINUSER = nobody
# Which command to use to check if the USER and GROUP to run Munin as, exists.
-GETENT = $(shell which getent || which true 2>/dev/null)
-CHECKUSER = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
-CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
+CHECKUSER = $(shell grep $(USER) /etc/passwd >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
+CHECKGROUP = $(shell grep $(GROUP) /etc/group >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
CHOWN = chown
CHMOD = chmod

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-ab,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
--- node/munin-node.conf.in.orig 2004-01-29 18:15:47.000000000 +0100
+++ node/munin-node.conf.in
@@ -12,7 +12,7 @@ setseid 1
# Which port to bind to;
host *
user root
-group root
+group wheel
setsid yes
# Regexps for files to ignore

View File

@@ -0,0 +1,40 @@
$NetBSD: patch-ac,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
--- node/node.d/ntp_.in.orig 2004-11-21 21:19:09.000000000 +0100
+++ node/node.d/ntp_.in
@@ -76,6 +76,8 @@ $0 =~ /ntp_(.+)*$/;
my $name = $1;
exit 2 unless defined $name;
+my $do_delay = ! defined($ENV{'NTP_NODELAY'});
+
if ($ARGV[0] and $ARGV[0] eq "config") {
my @lines = `ntpq -c "hostnames no" -c peers`;
my $host;
@@ -91,8 +93,10 @@ if ($ARGV[0] and $ARGV[0] eq "config") {
print "graph_title NTP statistics for peer $host\n";
}
print "graph_args --base 1000 --vertical-label msec --lower-limit 0\n";
- print "delay.label Delay\n";
- print "delay.draw LINE2\n";
+ if ($do_delay) {
+ print "delay.label Delay\n";
+ print "delay.draw LINE2\n";
+ }
print "offset.label Offset\n";
print "offset.draw LINE2\n";
print "jitter.label Jitter\n";
@@ -110,8 +114,12 @@ foreach (@lines) {
$host =~ s/[\.-]/_/g;
next unless $host eq $name;
my @F = split;
- print <<"EOT";
+if ($do_delay) {
+ print <<"EOT"
delay.value $F[7]
+EOT
+}
+ print <<"EOT";
offset.value $F[8]
jitter.value $F[9]
EOT

View File

@@ -0,0 +1,58 @@
$NetBSD: patch-ad,v 1.3 2010/07/17 11:47:57 abs Exp $
--- Makefile.orig 2005-04-15 20:37:29.000000000 +0000
+++ Makefile
@@ -17,7 +17,7 @@ install: install-main install-node insta
install-main: build
$(CHECKUSER)
- mkdir -p $(CONFDIR)/templates
+ mkdir -p $(DESTDIR)$(CONFDIR)/templates
mkdir -p $(LIBDIR)
mkdir -p $(BINDIR)
mkdir -p $(PERLLIB)
@@ -31,13 +31,11 @@ install-main: build
$(CHOWN) $(USER) $(LOGDIR) $(STATEDIR) $(RUNDIR) $(HTMLDIR) $(DBDIR)
for p in build/server/*.tmpl; do \
- $(INSTALL) -m 0644 "$$p" $(CONFDIR)/templates/ ; \
+ $(INSTALL) -m 0644 "$$p" $(DESTDIR)$(CONFDIR)/templates/ ; \
done
- $(INSTALL) -m 0644 server/logo.png $(CONFDIR)/templates/
- $(INSTALL) -m 0644 server/style.css $(CONFDIR)/templates/
- $(INSTALL) -m 0644 server/definitions.html $(CONFDIR)/templates/
-
- test -f "$(CONFDIR)/munin.conf" || $(INSTALL) -m 0644 build/server/munin.conf $(CONFDIR)/
+ $(INSTALL) -m 0644 server/logo.png $(DESTDIR)$(CONFDIR)/templates/
+ $(INSTALL) -m 0644 server/style.css $(DESTDIR)$(CONFDIR)/templates/
+ $(INSTALL) -m 0644 server/definitions.html $(DESTDIR)$(CONFDIR)/templates/
$(INSTALL) -m 0755 build/server/munin-cron $(BINDIR)/
@@ -57,11 +55,10 @@ install-node-snmp: build
install-node-non-snmp: build
$(CHECKGROUP)
- mkdir -p $(CONFDIR)/plugins
- mkdir -p $(CONFDIR)/plugin-conf.d
+ mkdir -p $(DESTDIR)$(CONFDIR)/plugins
+ mkdir -p $(DESTDIR)$(CONFDIR)/plugin-conf.d
mkdir -p $(LIBDIR)/plugins
mkdir -p $(SBINDIR)
- mkdir -p $(PERLLIB)/Munin/Plugin
mkdir -p $(LOGDIR)
mkdir -p $(STATEDIR)
@@ -69,11 +66,10 @@ install-node-non-snmp: build
$(CHGRP) $(GROUP) $(PLUGSTATE)
$(CHMOD) 775 $(PLUGSTATE)
- $(CHMOD) 755 $(CONFDIR)/plugin-conf.d
+ $(CHMOD) 755 $(DESTDIR)$(CONFDIR)/plugin-conf.d
$(INSTALL) -m 0755 build/node/munin-node $(SBINDIR)/
$(INSTALL) -m 0755 build/node/munin-node-configure $(SBINDIR)/
- test -f "$(CONFDIR)/munin-node.conf" || $(INSTALL) -m 0644 build/node/munin-node.conf $(CONFDIR)/
$(INSTALL) -m 0755 build/node/munin-run $(SBINDIR)/
install-node-plugins: build

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-ae,v 1.1 2006/07/21 23:28:37 abs Exp $
--- node/node.d/hddtemp_smartctl.in.orig 2005-01-29 22:14:02.000000000 +0000
+++ node/node.d/hddtemp_smartctl.in
@@ -93,6 +93,10 @@ if ($^O eq 'linux') {
}
} elsif ($^O eq 'solaris') {
@drives = map { s@.*/@@ } glob '/dev/rdsk/c*t*d*s2';
+} elsif ($^O eq 'netbsd') {
+ my $rawpart = chr(`sysctl -n kern.rawpartition` + 97); # 'c' or 'd'
+ @drives = map { $_ . $rawpart } grep { /^wd/ } split ' ',
+ `sysctl -n hw.disknames`;
}
@drives = split ' ', $ENV{drives} if exists $ENV{drives};

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-af,v 1.1 2006/11/19 10:02:10 wiz Exp $
--- node/node.d/foldingathome_wu.in.orig 2004-12-09 20:19:57.000000000 +0000
+++ node/node.d/foldingathome_wu.in
@@ -31,7 +31,7 @@ fi
wu=`wget "http://vspx27.stanford.edu/cgi-bin/main.py?qtype=userpage&username=8d" -q -t 1 -T 5 -O - | egrep -A 2 "<TD> WU</TD>" | grep "<b>" | sed 's/.*<b> \([0-9]*\) .*/\1/'`
-if [ "$wu" == "" ]; then
+if [ "$wu" = "" ]; then
if [ -f $statefile ]; then
echo wu.value `cat $statefile`
fi

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-ag,v 1.1 2006/11/19 10:02:10 wiz Exp $
--- node/node.d/foldingathome_rank.in.orig 2004-12-09 20:19:57.000000000 +0000
+++ node/node.d/foldingathome_rank.in
@@ -31,7 +31,7 @@ if [ "$1" = "config" ]; then
fi
rank=`wget "http://vspx27.stanford.edu/cgi-bin/main.py?qtype=userpage&username=8d" -q -t 1 -T 5 -O - | egrep "<TD> <font size=3> <b> [0-9]* </b> of [0-9]* </font></TD>" | sed 's/.*<font size=3> <b> \([0-9]*\) .*/\1/'`
-if [ "$rank" == "" ]; then
+if [ "$rank" = "" ]; then
if [ -f $statefile ]; then
echo rank.value `cat $statefile`
fi

View File

@@ -0,0 +1,19 @@
$NetBSD: patch-ah,v 1.1 2009/02/17 18:58:34 joerg Exp $
--- node/node.d/exim_mailqueue_alt.in.orig 2009-02-17 19:55:26.000000000 +0100
+++ node/node.d/exim_mailqueue_alt.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
#
# Plugin to monitor Exim's mail queue
#
@@ -31,7 +31,7 @@ QUEUECRIT=200
[ "$queuewarn" ] && QUEUEWARN=$queuewarn
[ "$queuecrit" ] && QUEUECRIT=$queuecrit
-if [ "$1" == "config" ]; then
+if [ "$1" = "config" ]; then
echo 'graph_title Exim mailqueue'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel mails in queue'