From 24d3404d92d636300cda59a3a25e2a985043d75f Mon Sep 17 00:00:00 2001 From: Lucas Holt Date: Wed, 8 Jul 2020 16:21:59 -0400 Subject: [PATCH] Revert creating a new node.d.midnightbsd directory and instead modify freebsd plugins. --- Build.PL | 5 +- contrib/plugin-gallery/print-gallery.awk | 1 - plugins/node.d.freebsd/cpu | 5 +- plugins/node.d.freebsd/systat | 2 +- plugins/node.d.freebsd/vmstat | 6 +- plugins/node.d.midnightbsd/coretemp | 100 ---------------- plugins/node.d.midnightbsd/cpu | 103 ----------------- plugins/node.d.midnightbsd/dev_cpu_ | 138 ----------------------- plugins/node.d.midnightbsd/df | 57 ---------- plugins/node.d.midnightbsd/df_inode | 69 ------------ plugins/node.d.midnightbsd/if_ | 109 ------------------ plugins/node.d.midnightbsd/if_errcoll_ | 80 ------------- plugins/node.d.midnightbsd/if_packets_ | 110 ------------------ plugins/node.d.midnightbsd/iostat | 82 -------------- plugins/node.d.midnightbsd/load | 103 ----------------- plugins/node.d.midnightbsd/memory | 96 ---------------- plugins/node.d.midnightbsd/netstat | 101 ----------------- plugins/node.d.midnightbsd/open_files | 53 --------- plugins/node.d.midnightbsd/swap | 57 ---------- plugins/node.d.midnightbsd/systat | 74 ------------ plugins/node.d.midnightbsd/uptime | 36 ------ plugins/node.d.midnightbsd/vmstat | 67 ----------- 22 files changed, 11 insertions(+), 1443 deletions(-) delete mode 100755 plugins/node.d.midnightbsd/coretemp delete mode 100755 plugins/node.d.midnightbsd/cpu delete mode 100755 plugins/node.d.midnightbsd/dev_cpu_ delete mode 100755 plugins/node.d.midnightbsd/df delete mode 100755 plugins/node.d.midnightbsd/df_inode delete mode 100755 plugins/node.d.midnightbsd/if_ delete mode 100755 plugins/node.d.midnightbsd/if_errcoll_ delete mode 100755 plugins/node.d.midnightbsd/if_packets_ delete mode 100755 plugins/node.d.midnightbsd/iostat delete mode 100755 plugins/node.d.midnightbsd/load delete mode 100755 plugins/node.d.midnightbsd/memory delete mode 100755 plugins/node.d.midnightbsd/netstat delete mode 100755 plugins/node.d.midnightbsd/open_files delete mode 100755 plugins/node.d.midnightbsd/swap delete mode 100755 plugins/node.d.midnightbsd/systat delete mode 100755 plugins/node.d.midnightbsd/uptime delete mode 100755 plugins/node.d.midnightbsd/vmstat diff --git a/Build.PL b/Build.PL index a7571cba56..14fa5cd161 100755 --- a/Build.PL +++ b/Build.PL @@ -236,8 +236,11 @@ if ( not $build->install_path('plugins') ) { $plugins_files->{'plugins/plugin.sh'} = 'plugins/plugin.sh'; +# MidnightBSD is similar to FreeBSD, so we also want to include FreeBSD specific plugins here. +my $os = $^O; +$os =~ s/midnightbsd/freebsd/; File::Find::find( { wanted => \&_find_plugins_wanted }, - 'plugins/node.d', "plugins/node.d.$^O" ); + 'plugins/node.d', "plugins/node.d.$os" ); sub _find_plugins_wanted { diff --git a/contrib/plugin-gallery/print-gallery.awk b/contrib/plugin-gallery/print-gallery.awk index 340486566e..349a6ad094 100755 --- a/contrib/plugin-gallery/print-gallery.awk +++ b/contrib/plugin-gallery/print-gallery.awk @@ -37,7 +37,6 @@ BEGIN { node_dir_map["node.d.hp-ux"] = "Platform HP-UX" node_dir_map["node.d.java"] = "Platform Java" node_dir_map["node.d.linux"] = "Platform Linux" - node_dir_map["node.d.midnightbsd"] = "Platform MidnightBSD" node_dir_map["node.d.netbsd"] = "Platform NetBSD" node_dir_map["node.d.openbsd"] = "Platform OpenBSD" node_dir_map["node.d.sunos"] = "Platform SunOS / Solaris" diff --git a/plugins/node.d.freebsd/cpu b/plugins/node.d.freebsd/cpu index e204b88a78..3e7217a94f 100755 --- a/plugins/node.d.freebsd/cpu +++ b/plugins/node.d.freebsd/cpu @@ -34,9 +34,10 @@ if [ "$1" = "autoconf" ]; then fi if [ "$1" = "config" ]; then - OSV=`$SYSCTL_BIN -n kern.osrelease | cut -f1 -d.` - if [ "$OSV" = "4" ]; then + if [ $(uname -s) = "MidnightBSD" ]; then + STATUNITS=`$SYSCTL_BIN -n kern.clockrate | cut -f13 -d' '` + elif [ "$OSV" = "4" ]; then STATUNITS=`$SYSCTL_BIN -n kern.clockrate | cut -f16 -d' '` elif [ "$OSV" -ge "5" ]; then STATUNITS=`$SYSCTL_BIN -n kern.clockrate | cut -f13 -d' '` diff --git a/plugins/node.d.freebsd/systat b/plugins/node.d.freebsd/systat index f1c1137d66..1e70afd1e4 100755 --- a/plugins/node.d.freebsd/systat +++ b/plugins/node.d.freebsd/systat @@ -50,7 +50,7 @@ EOF exit 0 fi ostype=`uname -s` - if [ ${ostype} = "FreeBSD" ]; then + if [ ${ostype} = "FreeBSD" ] || [ ${ostype} = "MidnightBSD" ]; then echo "yes" exit 0 fi diff --git a/plugins/node.d.freebsd/vmstat b/plugins/node.d.freebsd/vmstat index 572ed243e7..e855106b92 100755 --- a/plugins/node.d.freebsd/vmstat +++ b/plugins/node.d.freebsd/vmstat @@ -20,7 +20,7 @@ OSV=`/sbin/sysctl -n kern.osrelease | cut -f1 -d.` if [ "$1" = "autoconf" ]; then - if [ "$OSV" -ge "5" ]; then + if [ $(uname -s) = "MidnightBSD" ] || [ "$OSV" -ge "5" ]; then /sbin/sysctl -n vm.vmtotal 2>/dev/null >/dev/null RESULT=$? NAME=/sbin/sysctl @@ -49,7 +49,7 @@ if [ "$1" = "config" ]; then echo 'graph_vlabel process states' echo 'graph_category processes' echo 'graph_info This graph shows number of processes in each state.' - if [ "$OSV" -ge "5" ]; then + if [ $(uname -s) = "MidnightBSD" ] || [ "$OSV" -ge "5" ]; then echo 'running.label running' echo 'running.info processes on CPU or waiting for CPU' echo 'running.type GAUGE' @@ -71,7 +71,7 @@ if [ "$1" = "config" ]; then exit 0 fi -if [ "$OSV" -ge "5" ]; then +if [ $(uname -s) = "MidnightBSD" ] || [ "$OSV" -ge "5" ]; then /sbin/sysctl -n vm.vmtotal | /usr/bin/awk ' /^Processes:/ { print "running.value", $3; diff --git a/plugins/node.d.midnightbsd/coretemp b/plugins/node.d.midnightbsd/coretemp deleted file mode 100755 index 9b9321215c..0000000000 --- a/plugins/node.d.midnightbsd/coretemp +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2008 Dag-Erling Coïdan Smørgrav -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer -# in this position and unchanged. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# - -# This plugin's functionality has been replaced by the dev_cpu_ plugin. -#%# family=legacy - -# Munin plugin for CPU temperature on CPUs supported by FreeBSD's -# coretemp driver (includes all Intel Core and Core 2 CPUs) - -die() { - echo "$@" 1>&2 - exit 1 -} - -cpus() { - sysctl -N dev.cpu | - awk -F. '$4 == "temperature" { print $3 }' -} - -reqcpus() { - if [ -z "$cpus" ] ; then - die "No supported CPUs" - fi -} - -autoconf() { - if [ -n "$cpus" ] ; then - echo "yes" - else - echo "no" - fi -} - -config() { - reqcpus - echo "graph_title CPU Core Temperature" - echo -n "graph_order" - for cpu in $cpus ; do - echo -n " CPU$cpu" - done - echo "" - echo "graph_category sensors" - echo "graph_vlabel Core temperature in °C" - echo "graph_scale no" - for cpu in $cpus ; do - echo "CPU$cpu.label CPU $cpu" - done -} - -get() { - reqcpus - for cpu in $cpus ; do - echo -n "CPU$cpu.value " - sysctl -n dev.cpu.$cpu.temperature | tr -d C - done -} - -self=$(basename $0) -cpus=$(cpus) - -case "$*" in -autoconf) - autoconf - ;; -config) - config - ;; -"") - get - ;; -*) - die "usage: $self [autoconf|config]" - ;; -esac diff --git a/plugins/node.d.midnightbsd/cpu b/plugins/node.d.midnightbsd/cpu deleted file mode 100755 index b4d78b00bf..0000000000 --- a/plugins/node.d.midnightbsd/cpu +++ /dev/null @@ -1,103 +0,0 @@ -#!/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) -# -# Magic markers - optional - used by installation scripts and -# munin-config: -# -#%# family=auto -#%# capabilities=autoconf - -SYSCTL_BIN=$(command -v sysctl) - -if [ "$1" = "autoconf" ]; then - if [ ! -z "$SYSCTL_BIN" ]; then - $SYSCTL_BIN kern.cp_time > /dev/null - if [ $? = "0" ]; then - echo yes - exit 0 - else - echo no - exit 0 - fi - else - echo no - exit 0 - fi -fi - -if [ "$1" = "config" ]; then - - STATUNITS=`$SYSCTL_BIN -n kern.clockrate | cut -f13 -d' '` - PERCENT=`$SYSCTL_BIN -n hw.ncpu | awk '{print ($1)*100}'` - NCPU=`$SYSCTL_BIN -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' - echo 'graph_order system interrupt user nice idle' - 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 '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" - 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" - exit 0 -fi - -$SYSCTL_BIN kern.cp_time | awk '{ print "user.value " $2 "\nnice.value " $3 "\nsystem.value " $4 "\ninterrupt.value " $5 "\nidle.value " $6 }' - diff --git a/plugins/node.d.midnightbsd/dev_cpu_ b/plugins/node.d.midnightbsd/dev_cpu_ deleted file mode 100755 index 9d38ebbb01..0000000000 --- a/plugins/node.d.midnightbsd/dev_cpu_ +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2008 Dag-Erling Coïdan Smørgrav -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer -# in this position and unchanged. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# - -#%# family=auto -#%# capabilities=autoconf suggest - -# Munin plugin for CPU temperature and frequency on MidnightBSD - -export PATH=/sbin:/usr/bin:/bin - -die() { - echo "$@" 1>&2 - exit 1 -} - -cpus() { - sysctl -N dev.cpu | awk -F. '$4 == "'"$func"'" { print $3 }' -} - -reqcpus() { - if [ -z "$func" ] ; then - die "No function specified" - fi - cpus=$(cpus) - if [ -z "$cpus" ] ; then - die "No supported CPUs" - fi -} - -autoconf() { - if [ -n "$cpus" ] ; then - echo "yes" - exit 0 - else - echo "no (function not supported by kernel)" - exit 0 - fi -} - -suggest() { - if [ -n "$func" ] ; then - echo "$func" - exit 0 - fi - - # Suggest output must be newline separated, so get in newlines - # and preserve them. - for func in freq temperature ; do - if cpus >/dev/null ; then - funcs="$funcs -$func" - fi - done - [ -n "$funcs" ] && echo "$funcs" - exit $? -} - -config() { - reqcpus - echo -n "graph_order" - for cpu in $cpus ; do - echo -n " CPU$cpu" - done - echo "" - echo "graph_category sensors" - echo "graph_scale no" - case $func in - freq) - echo "graph_title CPU Frequency" - echo "graph_vlabel Frequency in MHz" - ;; - temperature) - echo "graph_title CPU Core Temperature" - echo "graph_vlabel Core temperature in °C" - ;; - esac - for cpu in $cpus ; do - echo "CPU$cpu.label CPU $cpu" - done - exit 0 -} - -get() { - reqcpus - for cpu in $cpus ; do - echo -n "CPU$cpu.value " - sysctl -n "dev.cpu.$cpu.$func" | tr -d 'C' - done -} - -self=$(basename $0) -func=${self##*_} - -case "$*" in -autoconf) - autoconf - ;; -suggest) - suggest - ;; -config) - config - ;; -"") - get - ;; -*) - die "usage: $self [autoconf|config]" - ;; -esac - -exit 0 diff --git a/plugins/node.d.midnightbsd/df b/plugins/node.d.midnightbsd/df deleted file mode 100755 index 43a477ad74..0000000000 --- a/plugins/node.d.midnightbsd/df +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# -# -# Script to monitor disk usage. -# -# Parameters understood: -# -# config (required) -# autoconf (optional - used by munin-config) -# -# Environment: -# warning Warning percentage, default 92 -# critical Critical percentage, default 98 -# -# Magic markers (optional - used by munin-config and installation -# scripts): -# -#%# family=auto -#%# capabilities=autoconf - -if [ "$1" = "autoconf" ]; then - echo yes - exit 0 -fi - -EXCLUDEDFS="-t noprocfs,devfs,fdescfs,linprocfs,linsysfs,sysfs,nfs,nullfs,cd9660" - -if [ "$1" = "config" ]; then - echo 'graph_title Disk usage in percent' - echo 'graph_args --upper-limit 100 -l 0' - echo 'graph_vlabel %' - echo 'graph_category disk' - echo 'graph_scale no' - echo 'graph_info This graph shows disk usage on the machine.' - mfs=0 - /bin/df -P $EXCLUDEDFS | tail -n +2 | sort | grep -v '//' | 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 '{ print $6 }' - echo "$name.warning ${warning:-92}" - echo "$name.critical ${critical:-98}" - done - exit 0 -fi - -mfs=0 -/bin/df -P $EXCLUDEDFS | tail -n +2 | sort | grep -v '//' | 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 '{ if ($2 == 0) print 0; else printf("%.2f\n", 100.0 * ($2 - $4) / $2); }' -done diff --git a/plugins/node.d.midnightbsd/df_inode b/plugins/node.d.midnightbsd/df_inode deleted file mode 100755 index 1e511e54ed..0000000000 --- a/plugins/node.d.midnightbsd/df_inode +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# -# -# Plugin to monitor inode-usage. -# -# Parameters understood: -# -# config (required) -# autoconf (optional - used by munin-config) -# -# Magic markers (optional - used by munin-config and installation -# scripts): -# -#%# family=auto -#%# capabilities=autoconf - -EXCLUDEDFS="-t noprocfs,devfs,fdescfs,linprocfs,linsysfs,sysfs,nfs,nullfs,cd9660" - -print_values() { - mfs=0 - /bin/df -P -i $EXCLUDEDFS | tail -n +2 | sort | 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 - printf "$name.value " - echo $i | awk '{ total = $6 + $7; if (total == 0) print 0; else printf("%.2f\n", 100.0 * $6 / total); }' - done -} - -if [ "$1" = "autoconf" ]; then - if [ "`print_values`" = "" ] ; then - echo no - else - echo yes - fi - exit 0 -fi - -if [ "$1" = "config" ]; then - - echo 'graph_title Inode usage in percent' - echo 'graph_args --upper-limit 100 -l 0' - echo 'graph_vlabel %' - echo 'graph_category disk' - echo 'graph_scale no' - echo 'graph_info This graph shows the inode usage for the partitions of types that use inodes.' - /bin/df -P -i $EXCLUDEDFS | tail -n +2 | sort | 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) - } - print name \".label \" dir - print name \".info \" dir \" -> \" \$1 - print name \".warning 92\" - print name \".critical 98\" - }" - exit 0 -fi - -print_values diff --git a/plugins/node.d.midnightbsd/if_ b/plugins/node.d.midnightbsd/if_ deleted file mode 100755 index 4ed566336f..0000000000 --- a/plugins/node.d.midnightbsd/if_ +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/sh -# -# Wildcard-plugin to monitor network interfaces. To monitor an -# interface, link if_ to this file. E.g. -# -# ln -s /usr/share/munin/node/plugins-auto/if_ /etc/munin/node.d/if_eth0 -# -# ...will monitor eth0. -# -# To aggregate all network interfaces on the system (except lo0), -# link if_aggregated to this file. -# -# Any device found in /usr/bin/netstat can be monitored. -# -# Magic markers (optional - used by munin-config and some installation -# scripts): -# -#%# family=auto -#%# capabilities=autoconf suggest - -INTERFACE=${0##*if_} - -if [ "$1" = "autoconf" ]; then - if [ -x /sbin/ifconfig -o -x /usr/bin/netstat ]; then - echo yes - exit 0 - else - echo "no (/usr/bin/netstat not found)" - exit 0 - fi -fi - -if [ "$1" = "suggest" ]; then - if [ -x /sbin/ifconfig ] - then - ifconfig -l | sed -Ee 's/[[:<:]](pfsync|faith|pf(log|sync)|lo|plip|carp|enc|fwe)[^ ]*//g' | xargs -n 1 echo - exit 0 - elif [ -x /usr/bin/netstat ]; then - netstat -i -b -n | sed -n -e '/^faith/d' -e '/^lo[0-9]/d' -e '/^pf(log|sync)/d' -e '//s/\** .*//p' - exit 0 - else - exit 1 - fi -fi - -if [ "$1" = "config" ]; then - - echo "graph_order rbytes obytes" - echo "graph_title Interface $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. IMPORTANT: On older BSD systems the data source for this plugin uses 32bit counters, this plugin is really unreliable and unsuitable for most 100Mb (or faster) interfaces, where bursts are expected to exceed 50Mbps. This means that this plugin is unsuitable for old production environments." - echo 'rbytes.label received' - echo 'rbytes.type DERIVE' - echo 'rbytes.graph no' - echo 'rbytes.cdef rbytes,8,*' - echo 'rbytes.min 0' - echo 'obytes.label bps' - echo 'obytes.type DERIVE' - echo 'obytes.negative rbytes' - echo 'obytes.cdef obytes,8,*' - echo 'obytes.min 0' - echo "obytes.info Traffic sent (+) and received (-) on the $INTERFACE network interface." - exit 0 -fi - -if [ "$INTERFACE" = "aggregated" ]; then - /usr/bin/netstat -i -b -n | grep -v '^lo' | awk ' -BEGIN { rsum = 0; osum = 0; } -// { - if (NF == 10) { - rsum += $6; osum += $9; - } else if (NF == 11) { - if ($4 ~ /:/) { - rsum += $7; osum += $10; - } else { - rsum += $7; osum += $10; - } - } else { # NF == 12 - rsum += $8; osum += $11; - } -} -END { - printf "rbytes.value %i\n", rsum; - printf "obytes.value %i\n", osum; -}' - -else - /usr/bin/netstat -i -b -n -I $INTERFACE | awk ' -// { - if (NF == 10) { - print "rbytes.value", $6; - print "obytes.value", $9; - } else if (NF == 11) { - if ($4 ~ /:/) { - print "rbytes.value", $7; - print "obytes.value", $10; - } else { - print "rbytes.value", $7; - print "obytes.value", $10; - } - } else { # NF == 12 - print "rbytes.value", $8; - print "obytes.value", $11; - } -}' -fi - diff --git a/plugins/node.d.midnightbsd/if_errcoll_ b/plugins/node.d.midnightbsd/if_errcoll_ deleted file mode 100755 index a55d1bf213..0000000000 --- a/plugins/node.d.midnightbsd/if_errcoll_ +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh -# -# Wildcard-plugin to monitor network interfaces. To monitor an -# interface, link if_ 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. -# -# Magic markers (optional - used by munin-config and some installation -# scripts): -# -#%# family=auto -#%# capabilities=autoconf suggest - -INTERFACE=${0##*if_errcoll_} - -if [ "$1" = "autoconf" ]; then - if [ -x /sbin/ifconfig -o -x /usr/bin/netstat ]; then - echo yes - exit 0 - else - echo "no (/usr/bin/netstat not found)" - exit 0 - fi -fi - -if [ "$1" = "suggest" ]; then - if [ -x /sbin/ifconfig ] - then - ifconfig -l | sed -Ee 's/[[:<:]](pfsync|faith|pf(log|sync)|lo|plip|carp|enc|fwe)[^ ]*//g' | xargs -n 1 echo - exit 0 - elif [ -x /usr/bin/netstat ]; then - netstat -i -b -n | sed -n -e '/^faith/d' -e '/^lo[0-9]/d' -e '/^pf(log|sync)/d' -e '//s/\** .*//p' - exit 0 - else - exit 1 - fi -fi - -if [ "$1" = "config" ]; then - echo "graph_order ierrors oerrors collisions" - echo "graph_title Interface $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 -b -n -I $INTERFACE | awk ' -// { - if (NF == 10) { - print "ierrors.value", $5; - print "oerrors.value", $8; - print "collisions.value", $10; - } else if (NF == 11) { - if ($4 ~ /:/) { - print "ierrors.value", $6; - print "oerrors.value", $9; - print "collisions.value", $11; - } else { - print "ierrors.value", $5; - print "oerrors.value", $9; - print "collisions.value", $11; - } - } else { # NF == 12 - print "ierrors.value", $6; - print "oerrors.value", $10; - print "collisions.value", $12; - } -}' diff --git a/plugins/node.d.midnightbsd/if_packets_ b/plugins/node.d.midnightbsd/if_packets_ deleted file mode 100755 index 2714a091a3..0000000000 --- a/plugins/node.d.midnightbsd/if_packets_ +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/sh -# -*- sh -*- -# -# Wildcard-plugin to monitor network interfaces. To monitor an -# interface, link if_packets_ to this file. E.g. -# -# ln -s /usr/share/munin/node/plugins-auto/if_packets_ /etc/munin/node.d/if_packets_eth0 -# -# ...will monitor eth0. -# -# To aggregate all network interfaces on the system (except lo0), -# link if_packets_aggregated to this file. -# -# Any device found in /usr/bin/netstat can be monitored. -# -# Magic markers (optional - used by munin-config and some installation -# scripts): -# -#%# family=auto -#%# capabilities=autoconf suggest - -INTERFACE=${0##*if_packets_} - -if [ "$1" = "autoconf" ]; then - if [ -x /sbin/ifconfig -o -x /usr/bin/netstat ]; then - echo yes - exit 0 - else - echo "no (/usr/bin/netstat not found)" - exit 0 - fi -fi - -if [ "$1" = "suggest" ]; then - if [ -x /sbin/ifconfig ] - then - ifconfig -l | sed -Ee 's/[[:<:]](pfsync|faith|pf(log|sync)|lo|plip|carp|enc|fwe)[^ ]*//g' | xargs -n 1 echo - exit 0 - elif [ -x /usr/bin/netstat ]; then - netstat -i -b -n | sed -n -e '/^faith/d' -e '/^lo[0-9]/d' -e '/^pf(log|sync)/d' -e '//s/\** .*//p' - exit 0 - else - exit 1 - fi -fi - -if [ "$1" = "config" ]; then - - echo "graph_order rpackets opackets" - echo "graph_title Interface $INTERFACE pps" - echo 'graph_args --base 1000' - echo 'graph_vlabel packets per ${graph_period} in (-) / out (+)' - echo 'graph_category network' - echo "graph_info This graph shows the packets counter of the $INTERFACE network interface. Please note that the traffic is shown in packets per second." - echo 'rpackets.label received' - echo 'rpackets.type COUNTER' - echo 'rpackets.graph no' - - echo 'rpackets.min 0' - echo 'opackets.label pps' - echo 'opackets.type COUNTER' - echo 'opackets.negative rpackets' - - echo 'opackets.min 0' - echo "opackets.info Packets sent (+) and received (-) on the $INTERFACE network interface." - exit 0 -fi - -if [ "$INTERFACE" = "aggregated" ]; then - /usr/bin/netstat -i -b -n | grep -v '^lo' | awk ' -BEGIN { rsum = 0; osum = 0; } -// { - if (NF == 10) { - rsum += $4; osum += $7; - } else if (NF == 11) { - if ($4 ~ /:/) { - rsum += $5; osum += $8; - } else { - rsum += $4; osum += $8; - } - } else { # NF == 12 - rsum += $6; osum += $9; - } -} -END { - printf "rpackets.value %i\n", rsum; - printf "opackets.value %i\n", osum; -}' - -else - /usr/bin/netstat -i -b -n -I $INTERFACE | awk ' -// { - if (NF == 10) { - print "rpackets.value", $4; - print "opackets.value", $7; - } else if (NF == 11) { - if ($4 ~ /:/) { - print "rpackets.value", $5; - print "opackets.value", $8; - } else { - print "rpackets.value", $4; - print "opackets.value", $8; - } - } else { # NF == 12 - print "rpackets.value", $5; - print "opackets.value", $9; - } -}' -fi - diff --git a/plugins/node.d.midnightbsd/iostat b/plugins/node.d.midnightbsd/iostat deleted file mode 100755 index 9a031d5f6b..0000000000 --- a/plugins/node.d.midnightbsd/iostat +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/sh -# -# Original script (NetBSD) by he -# -# Adapted to FreeBSD 6.2 / PC-BSD 1.4 by Pierre Bauduin (pierre@baudu.in) -# Version 0.0.3 -# September 2 24 2014 -# -# Plugin for watching io-bound traffic (in bytes) on disks. -# -# Parameters: -# -# config (required) -# autoconf (optional - used by munin-config) -# -# Magic markers (optional - used by munin-config and some installation -# scripts): -#%# family=auto -#%# capabilities=autoconf - -# autoconf - -if [ "$1" = "autoconf" ]; then - # Is the iostat executable there at least ? - if [ -x /usr/sbin/iostat ]; then - if iostat -x > /dev/null 2>&1; then - echo yes - exit 0 - else - echo "no (iostat too old, does not yet support -x option)" - exit 0 - fi - else - echo "no (no /usr/sbin/iostat executable)" - exit 0 - fi -fi - -# config -if [ "$1" = "config" ]; then - echo 'graph_title IOstat by bytes' - echo 'graph_args --base 1024 -l 0' - echo 'graph_vlabel Bytes per ${graph_period} read+written' - echo 'graph_category disk' - echo 'graph_info This graph shows the I/O to and from block devices' - # We don't give a XXXX about device or extended - drives=`/usr/sbin/iostat -I -x | - awk '/^device/ { next; } // { print $1; }' | - awk '/extended/ { next; } // { print $1; }'` - echo -n 'graph_order' - for d in $drives; do - echo -n ' '${d}'_read '${d}'_write' - done - echo - for d in $drives; do - echo "${d}_read.label ${d}" - echo "${d}_read.type DERIVE" - echo "${d}_read.max 1073741824" - 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 1073741824" - echo "${d}_write.min 0" - echo "${d}_write.negative ${d}_read" - done -exit 0 -fi - -# This is the main part of the script, basically it calls -# /usr/sbin/iostat and processes its output - - # We don't give a XXXX about device or extended - # On NetBSD the kilobyte read and kilobyte write are columns 5 and 9 - # On FreeBSD the kilobyte read and kilobyte write are columns 4 and 5 - /usr/sbin/iostat -I -x | - awk '/^device/ { next; } //' | - awk '/extended/ { next; } //' | - awk ' { - print $1 "_read.value " int($4)*1024; - print $1 "_write.value " int($5)*1024;}' diff --git a/plugins/node.d.midnightbsd/load b/plugins/node.d.midnightbsd/load deleted file mode 100755 index 19320c06dc..0000000000 --- a/plugins/node.d.midnightbsd/load +++ /dev/null @@ -1,103 +0,0 @@ -#!/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): -# -#%# family=auto -#%# capabilities=autoconf - - - -# If run with the "autoconf"-parameter, give our opinion on whether we -# should be run on this system or not. This is optional, 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 0 - fi - else - echo no - exit 0 - fi -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' - 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 -# package), the two versions will work identically. diff --git a/plugins/node.d.midnightbsd/memory b/plugins/node.d.midnightbsd/memory deleted file mode 100755 index dcbc930bf2..0000000000 --- a/plugins/node.d.midnightbsd/memory +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/sh -# -# Plugin to monitor memory usage on MidnightBSD. -# -# 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 vm.stats.vm.v_page_size > /dev/null; then - echo yes - exit 0 - else - echo no - exit 0 - fi - else - echo no - exit 0 - fi -fi - -PAGESIZE=$(/sbin/sysctl -n vm.stats.vm.v_page_size) -MEMSIZE=$(/sbin/sysctl -n vm.stats.vm.v_page_count) -MEMMAX=$(($PAGESIZE*$MEMSIZE)) -CACHE_COUNT=$(/sbin/sysctl -n vm.stats.vm.v_cache_count) -LAUNDRY_COUNT=$(/sbin/sysctl -n vm.stats.vm.v_laundry_count) - -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.' - # assemble the graph order (including the optional items) - printf 'graph_order active inactive wired' - if [ -n "$CACHE_COUNT" ]; then printf ' cached'; fi - if [ -n "$LAUNDRY_COUNT" ]; then printf ' laundry'; fi - echo ' free swap buffers' - 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, usually for kernel purposes, but also sometimes for special use in processes' - echo 'wired.draw STACK' - # the "cache" counter was removed in 2015 - if [ -n "$CACHE_COUNT" ]; then - echo 'cached.label cache' - echo 'cached.info pages that have percolated from inactive to a status where they maintain their data, but can often be immediately reused' - echo 'cached.draw STACK' - fi - # the "laundry" counter was introduced in 2015 - if [ -n "$LAUNDRY_COUNT" ]; then - echo 'laundry.label laundry' - echo 'laundry.info number of dirty bytes inactive' - echo 'laundry.draw STACK' - fi - echo 'free.label free' - echo 'free.info pages without data content' - echo 'free.draw STACK' - echo 'swap.label swap' - echo 'swap.info Swap space used' - echo 'swap.draw STACK' - echo 'buffers.label buffers' - echo 'buffers.info pages used for filesystem buffers' - echo 'buffers.draw LINE' - exit 0 -fi - -ACTIVE_COUNT=$(/sbin/sysctl -n vm.stats.vm.v_active_count) -INACTIVE_COUNT=$(/sbin/sysctl -n vm.stats.vm.v_inactive_count) -WIRED_COUNT=$(/sbin/sysctl -n vm.stats.vm.v_wire_count) -BUFFERS_COUNT=$(/sbin/sysctl -n vfs.bufspace) -FREE_COUNT=$(/sbin/sysctl -n vm.stats.vm.v_free_count) - -echo active.value $(($ACTIVE_COUNT*$PAGESIZE)) -echo inactive.value $(($INACTIVE_COUNT*$PAGESIZE)) -echo wired.value $(($WIRED_COUNT*$PAGESIZE)) -echo buffers.value $(($BUFFERS_COUNT)) -if [ -n "$CACHE_COUNT" ]; then - echo cached.value $(($CACHE_COUNT*$PAGESIZE)) -fi -if [ -n "$LAUNDRY_COUNT" ]; then - echo "laundry.value $(( LAUNDRY_COUNT * PAGESIZE ))" -fi -echo free.value $(($FREE_COUNT*$PAGESIZE)) -echo swap.value $(swapinfo -k | awk '!/^Total/ && !/^Device/ {sum += $3}; END {print sum * 1024}') diff --git a/plugins/node.d.midnightbsd/netstat b/plugins/node.d.midnightbsd/netstat deleted file mode 100755 index b70df24bb4..0000000000 --- a/plugins/node.d.midnightbsd/netstat +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/sh - -: << =cut - -=head1 NAME - -netstat - Plugin to monitor network connections - -=head1 CONFIGURATION - -No configuration - -=head1 AUTHOR - -Unknown author - -=head1 LICENSE - -GPLv2 - -=head1 MAGIC MARKERS - - #%# family=auto - #%# capabilities=autoconf - -=cut - -. "$MUNIN_LIBDIR/plugins/plugin.sh" - - -NETSTAT_CMD=netstat - - -if [ "$1" = "autoconf" ]; then - if ( "$NETSTAT_CMD" -s 2>/dev/null >/dev/null ); then - echo yes - exit 0 - else - if [ $? -eq 127 ] - then - echo "no (program $NETSTAT_CMD not found)" - exit 0 - else - echo no - exit 0 - fi - fi -fi - -if [ "$1" = "config" ]; then - - echo 'graph_title Netstat' - echo 'graph_args --base 1000 --logarithmic' - echo 'graph_vlabel TCP connections' - 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.' - print_warning active - print_critical active - 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.' - print_warning passive - print_critical passive - 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.' - print_warning failed - print_critical failed - 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.' - print_warning resets - print_critical 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.' - print_warning established - print_critical established - exit 0 -fi - -"$NETSTAT_CMD" -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 }' diff --git a/plugins/node.d.midnightbsd/open_files b/plugins/node.d.midnightbsd/open_files deleted file mode 100755 index 05903e9b48..0000000000 --- a/plugins/node.d.midnightbsd/open_files +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# -# Plugin to monitor the number of open files in the system. -# -# Parameters: -# -# config (required) -# autoconf (optional - used by munin-config) -# -# Magic markers (Used by munin-config and some installation scripts. -# Optional): -# -#%# family=auto -#%# capabilities=autoconf - - - -if [ "$1" = "autoconf" ]; then - if [ -x /sbin/sysctl ]; then - /sbin/sysctl kern.openfiles > /dev/null - if [ $? = "0" ]; then - echo yes - exit 0 - else - echo no - exit 0 - fi - else - echo no - exit 0 - fi -fi - -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 number of open files.' - 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.' - /sbin/sysctl -n kern.maxfiles | awk '{printf "used.warning %d\nused.critical %d\n",$1*0.92,$1*0.98}' - exit 0 -fi - -#awk '{print "used.value " $1-$2 "\nmax.value " $3}' < /proc/sys/fs/file-nr -echo -n 'max.value ' -/sbin/sysctl -n kern.maxfiles -echo -n 'used.value ' -/sbin/sysctl -n kern.openfiles diff --git a/plugins/node.d.midnightbsd/swap b/plugins/node.d.midnightbsd/swap deleted file mode 100755 index b44dc2d103..0000000000 --- a/plugins/node.d.midnightbsd/swap +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# -# Plugin to monitor swap IO in number of blocks per second. -# -# Parameters: -# -# config (required) -# autoconf (optional - used by munin-config) -# -# Magic markers (used by munin-config and some installation scripts (i.e. -# optional)): -#%# family=auto -#%# capabilities=autoconf - - - -if [ "$1" = "autoconf" ]; then - if [ -x /sbin/sysctl ]; then - /sbin/sysctl vm.stats.vm.v_swappgsin > /dev/null - if [ $? = "0" ]; then - echo yes - exit 0 - else - echo no - exit 0 - fi - else - echo no - exit 0 - 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 - -#awk '/swap/ { print "swap_in.value " $2 "\nswap_out.value " $3 }' < /proc/stat -echo -n 'swap_in.value ' -/sbin/sysctl -n vm.stats.vm.v_swappgsin -echo -n 'swap_out.value ' -/sbin/sysctl -n vm.stats.vm.v_swappgsout diff --git a/plugins/node.d.midnightbsd/systat b/plugins/node.d.midnightbsd/systat deleted file mode 100755 index a13ccc4ef7..0000000000 --- a/plugins/node.d.midnightbsd/systat +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh -# System statistics for MidnightBSD -# -# Copyright: Gergely Czuczy -# -# Define the environment variable "logarithmic" in plugins.conf to -# make graphs with logarithmic scale. Default is linear scale. -# -#%# family=auto -#%# capabilities=autoconf - -sysctl='/sbin/sysctl' - -if [ "$logarithmic" ]; then - graph_args="--logarithmic --units=si" -else - graph_args="--lower-limit 0" -fi - -case $1 in - config) - cat </dev/null >/dev/null - RESULT=$? - NAME=/sbin/sysctl - if [ $RESULT -eq 0 ]; then - echo yes - exit 0 - else - if [ $RESULT -eq 127 ]; then - echo "no (could not run \"$NAME\")" - exit 0 - else - echo no - exit 0 - 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 'diskwait.label diskwait' - echo 'diskwait.info processes waiting for disk activity' - echo 'diskwait.type GAUGE' - echo 'pagewait.label pagewait' - echo 'pagewait.info processes waiting for page-in' - echo 'pagewait.type GAUGE' - echo 'sleep.label sleep' - echo 'sleep.info processes waiting for some event' - echo 'sleep.type GAUGE' - exit 0 -fi - - -/sbin/sysctl -n vm.vmtotal | /usr/bin/awk ' -/^Processes:/ { - print "running.value", $3; - print "diskwait.value", $6; - print "pagewait.value", $9; - print "sleep.value", $11+0; -}' -