From 3687166c6c3015f34b7f78ad35a7abeeca81a1e8 Mon Sep 17 00:00:00 2001 From: he Date: Thu, 25 Jul 2013 11:41:25 +0000 Subject: Add an entropy monitoring script for NetBSD. This script needs to run as root, so you need a ${SYSCONFDIR}/munin/plugin-conf.d/entropy file with [entropy] user root as contents to get any values. And... at the same time, I notice that the postfix_mailqueue script also needs a postfix plugin-conf.d file with [postfix_mailqueue] user postfix as contents to get any values. Bump PKGREVISION. --- sysutils/munin-node/Makefile | 4 +-- sysutils/munin-node/PLIST | 3 +- .../munin-node/files/node/node.d.netbsd/entropy.in | 39 ++++++++++++++++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 sysutils/munin-node/files/node/node.d.netbsd/entropy.in diff --git a/sysutils/munin-node/Makefile b/sysutils/munin-node/Makefile index 3b3ac40b1aa..4908b9d40b7 100644 --- a/sysutils/munin-node/Makefile +++ b/sysutils/munin-node/Makefile @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.30 2013/07/12 10:45:03 jperkin Exp $ +# $NetBSD: Makefile,v 1.31 2013/07/25 11:41:25 he Exp $ # DISTNAME= munin_${VER} VER= 1.3.2 PKGNAME= munin-node-${VER} -PKGREVISION= 14 +PKGREVISION= 15 CATEGORIES= sysutils MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=munin/} diff --git a/sysutils/munin-node/PLIST b/sysutils/munin-node/PLIST index f4669e0322d..0e83ea4a98f 100644 --- a/sysutils/munin-node/PLIST +++ b/sysutils/munin-node/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.11 2010/12/11 12:09:23 abs Exp $ +@comment $NetBSD: PLIST,v 1.12 2013/07/25 11:41:25 he Exp $ lib/munin/plugins/acpi lib/munin/plugins/amavis lib/munin/plugins/apache_accesses @@ -22,6 +22,7 @@ ${PLIST.linux}lib/munin/plugins/df_abs lib/munin/plugins/df_inode lib/munin/plugins/dhcpd3 ${PLIST.linux}lib/munin/plugins/entropy +${PLIST.netbsd}lib/munin/plugins/entropy lib/munin/plugins/exim_mailqueue lib/munin/plugins/exim_mailqueue_alt lib/munin/plugins/exim_mailstats diff --git a/sysutils/munin-node/files/node/node.d.netbsd/entropy.in b/sysutils/munin-node/files/node/node.d.netbsd/entropy.in new file mode 100644 index 00000000000..1939394dea4 --- /dev/null +++ b/sysutils/munin-node/files/node/node.d.netbsd/entropy.in @@ -0,0 +1,39 @@ +#!/bin/sh +# +# Plugin to monitor available entropy +# +# Usage: Link or copy into /etc/munin/node.d/ +# +# Magic markers (optional - only used by munin-config and some +# installation scripts): +# +#%# family=auto +#%# capabilities=autoconf + + + +if [ "$1" = "autoconf" ]; then + if [ -x /sbin/rndctl ]; then + echo yes + exit 0 + else + echo no + exit 1 + fi +fi + + +if [ "$1" = "config" ]; then + echo 'graph_title Available entropy' + echo 'graph_args --base 1000 -l 0' + echo 'graph_vlabel entropy (bytes)' + echo 'graph_scale no' + echo 'graph_category system' + echo 'graph_info This graph shows the amount of entropy available in the system.' + echo 'entropy.label entropy' + echo 'entropy.info The number of random bytes available. This is typically used by cryptographic applications.' + exit 0 +fi + +echo -n "entropy.value " +/sbin/rndctl -s | /usr/bin/awk '/bits currently stored/ { print $1 }' -- cgit v1.2.3