@@ -65,7 +65,7 @@ if($ARGV[0] && $ARGV[0] eq "config")
my(@swapInfo) = getSwapSpace();
print "total.value $swapInfo[0]\n";
print "used.value $swapInfo[1]\n";

sub getSwapSpace
{
my($line,@lineArray,$amountUsed,$totalSpace);
@@ -49,8 +49,8 @@ if [ "$1" = "autoconf" ]; then
fi

# If run with the "config"-parameter, give out information on how the
# graphs should look.
# graphs should look.

if [ "$1" = "config" ]; then
LOAD_WARN=${load_warn:-10}
LOAD_CRIT=${load_crit:-120}
@@ -71,7 +71,7 @@ if [ "$1" = "config" ]; then
# Graph category. Defaults to 'other'
echo 'graph_category system'
# The fields. "label" is used in the legend. "label" is the only
# required subfield.
# 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
@@ -67,7 +67,7 @@ if($mode eq "autoconf") {


# Collect data
#
#
open(FH, $PROCNETDEV)
or die "Failed to open $PROCNETDEV: $!";

@@ -16,11 +16,11 @@ if ($ARGV[0] eq "config") {


my $epoch = time;

for (my $i = $epoch - 5; $i < $epoch; $i += 1) {
print "sin.value $i:". sin($i / 3600). "\n";
}

for (my $i = $epoch - 5; $i < $epoch; $i += 1) {
print "cos.value $i:". cos($i / 3600). "\n";
}
@@ -57,11 +57,11 @@ graph_order \
donald_disk \
ferdinand_disk=mg_ferdinand_disk.sda \
donald_mb=mg_donald_mb.temp1 \
ferdinand_mb=mg_ferdinand_mb.temp1
ferdinand_mb=mg_ferdinand_mb.temp1
donald_disk.sum \
mg_donald_disk.sda \
mg_donald_disk.sdb \
mg_donald_disk.sdc
mg_donald_disk.sdc
donald_disk.cdef donald_disk,3,/
donald_disk.label donald disk
donald_mb.label Mainboard donald
@@ -5,7 +5,7 @@ if [ "$1" == "config" ]; then
echo "graph_category Debug"
echo "graph_vlabel Some value"
echo "field99_100.label Some random decimal between 99 and 100"
else
else
# emit a random decimal value between 99 and 100
echo "field99_100.value 99.${RANDOM:1}"
fi
@@ -6,8 +6,8 @@
# 22:00 < janll> 4. broken config, good fetch
# 22:00 < janll> 5. good config, broken fetch
# 22:00 < janll> 6. broken everything
#
# 22:03 < janll> modes of breakage: mistyped keywords, missing keywords, missing
#
# 22:03 < janll> modes of breakage: mistyped keywords, missing keywords, missing
# values, illegal values

# Plugin filename = testplugin
@@ -132,11 +132,11 @@ if ($other eq 'sleep') {
if ($other eq 'disturb') {
$configure_mode -= 1;
}


if ($configure_mode) {
foreach $line (keys %{$config{$config}->{$aspect}}) {
print $line, " ", $config{$config}->{$aspect}->{$line}, "\n";
print $line, " ", $config{$config}->{$aspect}->{$line}, "\n";
}
} else {
foreach $line (keys %{$fetch{$fetch}->{$aspect}}) {
@@ -67,8 +67,8 @@ if [ "$1" = "config" ]; then
echo 'system.max 5000'
echo 'system.type DERIVE'
echo 'system.min 0'
# echo "system.warning $SYSWARNING"
# echo "system.critical $SYSCRITICAL"
# 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'
@@ -8,7 +8,7 @@
#
# ...will monitor eth0.
#
# To aggregate all network interfaces on the system (except lo0),
# 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.
@@ -46,7 +46,7 @@ fi

if [ "$1" = "config" ]; then

echo "graph_order rbytes obytes"
echo "graph_order rbytes obytes"
echo "graph_title $INTERFACE traffic"
echo 'graph_args --base 1000'
echo 'graph_vlabel bits per ${graph_period} in (-) / out (+)'
@@ -70,7 +70,7 @@ if [ "$INTERFACE" = "aggregated" ]; then
/usr/bin/netstat -i -b -n | grep -v '^lo' | awk '
BEGIN { rsum = 0; osum = 0; }
/<Link#[0-9]*>/ {
if (NF == 10) {
if (NF == 10) {
rsum += $6; osum += $9;
} else if (NF == 11) {
if ($4 ~ /:/) {
@@ -86,11 +86,11 @@ END {
printf "rbytes.value %i\n", rsum;
printf "obytes.value %i\n", osum;
}'

else
/usr/bin/netstat -i -b -n -I $INTERFACE | awk '
/<Link#[0-9]*>/ {
if (NF == 10) {
if (NF == 10) {
print "rbytes.value", $6;
print "obytes.value", $9;
} else if (NF == 11) {
@@ -8,7 +8,7 @@
#
# ...will monitor eth0.
#
# To aggregate all network interfaces on the system (except lo0),
# 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.
@@ -70,7 +70,7 @@ if [ "$INTERFACE" = "aggregated" ]; then
/usr/bin/netstat -i -b -n | grep -v '^lo' | awk '
BEGIN { rsum = 0; osum = 0; }
/<Link#[0-9]*>/ {
if (NF == 10) {
if (NF == 10) {
rsum += $4; osum += $7;
} else if (NF == 11) {
if ($4 ~ /:/) {
@@ -2,7 +2,7 @@
# -*- sh -*-
#
# Original script (NetBSD) by he
#
#
# Adapted to FreeBSD 6.2 / PC-BSD 1.4 by Pierre Bauduin (pierre@baudu.in)
# Version 0.0.2
# October 24 2007
@@ -45,8 +45,8 @@ if [ "$1" = "config" ]; then
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; }' |
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
@@ -76,7 +76,7 @@ fi
# 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 '/^device/ { next; } //' |
awk '/extended/ { next; } //' |
awk ' {
print $1 "_read.value " int($4);
@@ -1,10 +1,10 @@
#!@@GOODSH@@
# -*- sh -*-
#
#
# Plugin to monitor the number of open files in the system.
#
# Parameters:
#
#
# config (required)
# autoconf (optional - used by munin-config)
#
@@ -18,13 +18,13 @@
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
if [ $? = "0" ]; then
echo yes
exit 0
else
echo no
exit 0
fi
else
echo no
exit 0
@@ -51,7 +51,7 @@ if [ "$1" = "config" ]; then
exit 0
fi

#awk '/swap/ { print "swap_in.value " $2 "\nswap_out.value " $3 }' < /proc/stat
#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 '
@@ -1,4 +1,4 @@
if (gbl_interval > 2) then
if (gbl_interval > 2) then
{
print "mem_util.value ",gbl_mem_util|6|2
print "mem_user.value ",gbl_mem_user_util|6|2
@@ -1,7 +1,7 @@
#!@@GOODSH@@
#
# gp_gbl_mem - Munin plug-in to fetch global memory utilisation via Glance
# (should only run on HP-UX with GlancePlus (GP) installed therefore)
# (should only run on HP-UX with GlancePlus (GP) installed therefore)
#
# Requires: Separate GP adviser syntax file whose location is made known
# by ADVISER environment variable which defaults to
@@ -23,13 +23,13 @@
#
#
# Note, to avoid parsing problems on start of munin-node
# add this entry to your munin-node.conf if you place the *.adv file
# add this entry to your munin-node.conf if you place the *.adv file
# in above mentioned location: "ignore_file \.adv$"
#
# The contents of the syntax file for this plugin should look like
# this:
#
# if (gbl_interval > 2) then
# if (gbl_interval > 2) then
# {
# print "mem_util.value ",gbl_mem_util|6|2
# print "mem_user.value ",gbl_mem_user_util|6|2
@@ -23,8 +23,8 @@ LANSCAN=/usr/sbin/lanscan

if [[ $1 = autoconf ]]; then
if ! uname -s|grep -qEi hp-?ux; then
echo "no (OS doesn't seem to be HP-UX but reports as '$(uname -s)')"
exit 0
echo "no (OS doesn't seem to be HP-UX but reports as '$(uname -s)')"
exit 0
fi
if [ -x $LANADMIN ]; then
echo yes
@@ -38,22 +38,22 @@ fi
if [[ $1 = suggest ]]; then
# lanscan will list all usable NICs seen by the kernel
if [ -x $LANSCAN ] \
&& seen=$($LANSCAN|awk '$3~/^[0-9]+$/&&$4=="UP"{print$5}'); then
&& seen=$($LANSCAN|awk '$3~/^[0-9]+$/&&$4=="UP"{print$5}'); then
# but netstat will only list currently configured NICs
if [[ -n $seen ]] && netstat -in|grep -q "$seen"; then
# HP-UX names all NICs with leading string "lan" (afaik)
# Note, in SG environments NICs with trailing asterisk
# are usually standby NICs that often are used for heartbeat exchange,
# why they are suitable for collecting data as well
netstat -in|awk 'NR>1&&$1~/^lan[0-9]+\*?$/{print$1}'|tr -d \*
exit 0
fi
if [[ -n $seen ]] && netstat -in|grep -q "$seen"; then
# HP-UX names all NICs with leading string "lan" (afaik)
# Note, in SG environments NICs with trailing asterisk
# are usually standby NICs that often are used for heartbeat exchange,
# why they are suitable for collecting data as well
netstat -in|awk 'NR>1&&$1~/^lan[0-9]+\*?$/{print$1}'|tr -d \*
exit 0
fi
fi
exit 1
fi

if [[ $1 = config ]]; then
echo "graph_order inbound outbound"
echo "graph_order inbound outbound"
echo "graph_title $INTERFACE traffic"
echo 'graph_args --base 1000'
echo 'graph_vlabel bits per ${graph_period} in (-) / out (+)'
@@ -1,6 +1,6 @@
#!@@GOODSH@@
#
# if_err_
# if_err_
#
# HP-UX wildcard-plugin to fetch error mibstats from network interfaces (NICs).
# To add a NIC, symlink if_err_<NIC> in munin-node's plugins confdir to this file,
@@ -53,7 +53,7 @@ if [[ $1 = suggest ]]; then
fi

if [[ $1 = config ]]; then
echo "graph_order inbound outbound"
echo "graph_order inbound outbound"
echo "graph_title $INTERFACE errors"
echo 'graph_args --base 1000'
echo 'graph_vlabel packets per ${graph_period} in (-) / out (+)'
@@ -1,5 +1,5 @@
#!@@PERL@@
# -*- perl -*-
# -*- perl -*-
#
# this is public domain copy and share at will
# quick n dirty hack to read specific performance data on HP-UX thru
@@ -35,7 +35,7 @@ Needed configuration on the Tomcat side: add
to CATALINA_OPTS in your startup scripts.
Replace authenticate=false with
Replace authenticate=false with
-Dcom.sun.management.jmxremote.password.file=/etc/tomcat/jmxremote.password \
-Dcom.sun.management.jmxremote.access.file=/etc/tomcat/jmxremote.access
...if you want authentication.
@@ -33,7 +33,7 @@ Needed configuration on the Tomcat side: add
to CATALINA_OPTS in your startup scripts.
Replace authenticate=false with
Replace authenticate=false with
-Dcom.sun.management.jmxremote.password.file=/etc/tomcat/jmxremote.password \
-Dcom.sun.management.jmxremote.access.file=/etc/tomcat/jmxremote.access
...if you want authentication.
@@ -52,8 +52,8 @@ No encryption supported in the JMX connection.
=encoding UTF-8
Code written by Jimmy Olsen, Redpill Linpro AS. This code also
uses code written by Mo Amini, Diyar Amin and Younes Hajji,
Code written by Jimmy Olsen, Redpill Linpro AS. This code also
uses code written by Mo Amini, Diyar Amin and Younes Hajji,
Høgskolen i Oslo/Oslo University College.
Previous work on JMX plugin by Aleksey Studnev. Support for
@@ -111,7 +111,7 @@ sub config() {
sub fetch() {

# Fetch bean values (through jmx) via the command line. We basically run the class "org.munin.plugin.jmx.Beans"
# with the parameters <bean> and <filter>, the <bean> being a bean pattern to fetch (in this case
# with the parameters <bean> and <filter>, the <bean> being a bean pattern to fetch (in this case
# "Catalina:type=DataSource,class=javax.sql.DataSource,name=*", and <filter> being "numActive" (the single field
# we're actually interested in). We can fetch multiple fields by listing them all as parameters, or list all fields
# by not supplying a filter (only a bean).
@@ -1,7 +1,7 @@
#!@@GOODSH@@
# -*- sh -*-

: <<=cut
: <<=cut
=head1 NAME
@@ -21,7 +21,7 @@ Link this plugin to @@CONFDIR@@/plugins/ and restart the munin-node.
=head1 INTERPRETATION
The plugin shows the temperature from the different thermal zones.
The plugin shows the temperature from the different thermal zones.
=head1 MAGIC MARKERS
@@ -128,7 +128,7 @@ if ($ARGV[0] and $ARGV[0] eq "update")
{
my $maxinterval = $ARGV[1] ? $ARGV[1] : update_helpandexit;
my $probability = $ARGV[2] ? $ARGV[2] : update_helpandexit;

# if it's been $probability seconds since the last update, do
# it now.
if(-e $statefile &&
@@ -200,7 +200,7 @@ if ($ARGV[0] and $ARGV[0] eq "config") {
if ($ARGV[0] and $ARGV[0] eq "update") {
my $maxinterval = $ARGV[1] ? $ARGV[1] : update_helpandexit;
my $probability = $ARGV[2] ? $ARGV[2] : update_helpandexit;

# if it's been $probability seconds since the last update, do
# it now.
if(-e $statefile &&
@@ -147,7 +147,7 @@ if [ "$1" = "config" ]; then
echo 'system.draw AREA'
echo 'system.min 0'
echo 'system.type DERIVE'
echo "system.info CPU time spent by the kernel in system activities"
echo "system.info CPU time spent by the kernel in system activities"
echo 'user.label user'
echo 'user.draw STACK'
echo 'user.min 0'
@@ -83,7 +83,7 @@ if [ "$1" = "config" ]; then
echo 'graph_total Total'
fi
# shellcheck disable=SC2086
df -P -l $exclude | sed 1d | grep -v "//" |
df -P -l $exclude | sed 1d | grep -v "//" |
while read -r dev size used avail cap mnt; do
name="$(get_fieldname "$dev" "$mnt")"
echo "$name.label $mnt"
@@ -101,7 +101,7 @@ if [ "$1" = "config" ]; then
fi

# shellcheck disable=SC2034,SC2086
df -P -l $exclude | sed 1d | grep -v "//" |
df -P -l $exclude | sed 1d | grep -v "//" |
while read -r dev size used avail cap mnt; do
echo "$(get_fieldname "$dev" "$mnt").value $used"
done
@@ -389,7 +389,7 @@ sub calculate_and_print_values {

my $average_rq_size_in_kb
= $total_ios
? ( $rd_sectors + $wr_sectors )
? ( $rd_sectors + $wr_sectors )
* $bytes_per_sector / 1024
/ $total_ios
: 0;
@@ -825,7 +825,7 @@ EOF
multigraph ${plugin_name}_iops
graph_title Disk IOs per device
graph_args --base 1000
graph_vlabel IOs/\${graph_period} read (-) / write (+)
graph_vlabel IOs/\${graph_period} read (-) / write (+)
graph_category disk
graph_width $config_graph_width
@@ -37,7 +37,7 @@ if [ "$1" = "autoconf" ]; then
exit 0
fi
fi

if [ "$1" = "config" ]; then
echo 'graph_title Available entropy'
echo 'graph_args --base 1000 -l 0'
@@ -30,7 +30,7 @@ GPLv2

if [ "$1" = "autoconf" ]; then
if [ -r /proc/stat ]; then
echo yes
echo yes
exit 0
else
echo "no (/proc/stat not readable)"
@@ -82,7 +82,7 @@ while (<F>) {
# destined for the firewall, then the difference is wrong. If
# you firewall does not receive traffic itself it is correct
# though.
#
#
# print "rejected.value ", $received - $forwarded,"\n";
last;
}
@@ -139,9 +139,9 @@ sub fetch_stat() {
$devs{$name} =
{
name => $name,
rio => $3,
rio => $3,
rsect => $4,
wio => $5,
wio => $5,
wsect => $6
};
}
@@ -181,7 +181,7 @@ sub fetch_detailed() {
$tmpnam =~ s/^([^\/]+)\//$1/;
$tmpnam =~ s/\/disc$//;

$devs{"dev".$major."_".&get_disk_count($major)} =
$devs{"dev".$major."_".&get_disk_count($major)} =
{
major => $major,
name => $tmpnam,
@@ -6,17 +6,17 @@
#
# Author: Trygve Vea <tv@redpill-linpro.com>
# Author: Kristian Lyngstøl <kristian@redpill-linpro.com>
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@@ -27,13 +27,13 @@ proc - Munin plugin to monitor various aspects of named processes
=head1 APPLICABLE SYSTEMS
Processes running under Linux for a longer timespan.
Processes running under Linux for a longer timespan.
=head1 CONFIGURATION
The plugin needs to be able to parse the /proc-filesystem.
The plugin is configured by supplying a pipe-delimitered list of parameters
The plugin is configured by supplying a pipe-delimitered list of parameters
through environment variables.
[proc]
env.procname proc1|proc2|proc3
@@ -42,10 +42,10 @@ through environment variables.
env.procaspect cpu|memory|ctxt_switches|threads|processes|io
env.procname defines the processname as seen inside the paranthesis of the
env.procname defines the processname as seen inside the paranthesis of the
second column in /proc/pid/stat. If you don't get the data you expect, you
can check if the value is what you expect here. This is what's used for the
first filter, and args/user-filters are then applied on top of this filter.
can check if the value is what you expect here. This is what's used for the
first filter, and args/user-filters are then applied on top of this filter.
env.procargs defines a string which is matched against the command line of the
process. It's a wildcard match, so you don't have to provide the entire
@@ -54,7 +54,7 @@ argument list if there's only one key option you care about filtering on.
env.procuser defines the user the process has to run as. If nothing is
provided, processes ran by any user are included.
env.procaspect defines which graphs to render. Per default, all graphs are
env.procaspect defines which graphs to render. Per default, all graphs are
included. You don't have to set this unless you want to exclude graphs.
=head1 INTERPRETATION
@@ -89,8 +89,8 @@ Kristian Lyngstol <kristian@varnish-software.com>
=head1 THANKS
Thanks to Kristian Lyngstol, I stole most of the initial code in this plugin
from his varnish_-plugin, which is a really nice outline of how a
Thanks to Kristian Lyngstol, I stole most of the initial code in this plugin
from his varnish_-plugin, which is a really nice outline of how a
wildcardplugin should look like. I've added some weird hacks to make it output
multigraph. It's pretty ugly, but it works.
@@ -140,13 +140,13 @@ my @field_parameters = ('graph', 'min', 'max', 'draw', 'cdef', 'warning',
'colour', 'info', 'type', 'negative');
# Data structure that defines all possible graphs (aspects) and how they
# are to be plotted. Every top-level entry is a graph/aspect. Each top-level graph
# MUST have title set and 'values'.
#
# MUST have title set and 'values'.
#
# 'rpn' on values allows easy access to graphs consisting of multiple
# values from procstats. (Reverse polish notation). The RPN
# implementation only accepts +-*/ and procstats-values.
#
# Any value left undefined will be left up to Munin to define/ignore/yell
# Any value left undefined will be left up to Munin to define/ignore/yell
# about.
#
# See munin documentation or rrdgraph/rrdtool for more information.
@@ -404,7 +404,7 @@ sub print_if_exist
}

# Walk through the relevant aspect and print all top-level configuration
# values and value-definitions.
# values and value-definitions.
sub get_config
{
my $graph = $_[0];
@@ -550,7 +550,7 @@ sub set_run
}
}

# Read and verify the aspect ($self).
# Read and verify the aspect ($self).
sub set_aspect
{
$self = $0;
@@ -651,7 +651,7 @@ print "multigraph proc_$asp\n";
foreach (@procname) {
if ( $asp eq 'cpu' ) {
print "$procuniq[$i].value " .
($procstats{$procuniq[$i]}{'utime'} +
($procstats{$procuniq[$i]}{'utime'} +
$procstats{$procuniq[$i]}{'stime'})."\n";
}
if ( $asp eq 'ctxt_switches' ) {
@@ -63,7 +63,7 @@ if [ "$1" = "config" ]; then
fi

if [ -f /proc/vmstat ]; then
awk '/pswpin/ { print "swap_in.value " $2 } /pswpout/ { print "swap_out.value " $2 }' < /proc/vmstat
awk '/pswpin/ { print "swap_in.value " $2 } /pswpout/ { print "swap_out.value " $2 }' < /proc/vmstat
else
awk '/swap/ { print "swap_in.value " $2 "\nswap_out.value " $3 }' < /proc/stat
awk '/swap/ { print "swap_in.value " $2 "\nswap_out.value " $3 }' < /proc/stat
fi
@@ -9,8 +9,8 @@
# The interface must also have an accounting iptables rules defined, _before_
# any action rules. E.g., in /etc/network/vlan-firewall.d/eth1-200-out, you
# will find:
#
# --out-interface eth0 -p tcp --sport http
#
# --out-interface eth0 -p tcp --sport http
# --out-interface eth0 -p tcp --sport smtp
# --out-interface eth0 -p tcp --sport ssh
# --out-interface eth0 -p tcp --sport domain
@@ -96,65 +96,65 @@ if ($ARGV[0] and $ARGV[0] eq "config")

if (@in_fields)
{
push (@out , "$in.draw STACK\n");
push (@out , "$in.draw STACK\n");
}
else
{
push (@out , "$in.draw AREA\n");
push (@out , "$in.draw AREA\n");
}
push (@in_fields, "$in");
push (@out , "$in.label $label\n");
push (@out , "$in.cdef $in,8,*\n");
push (@out , "$in.graph no\n");
push (@out , "$in.type DERIVE\n");
push (@out , "$in.min 0\n");
push (@out , "$in.label $label\n");
push (@out , "$in.cdef $in,8,*\n");
push (@out , "$in.graph no\n");
push (@out , "$in.type DERIVE\n");
push (@out , "$in.min 0\n");

if (@out_fields)
{
push (@out , "$out.draw STACK\n");
push (@out , "$out.draw STACK\n");
}
else
{
push (@out , "$out.draw AREA\n");
push (@out , "$out.draw AREA\n");
}
push (@out_fields, "$out");
push (@out , "$out.label $label\n");
push (@out , "$out.cdef $out,8,*\n");
push (@out , "$out.negative $in\n");
push (@out , "$out.type DERIVE\n");
push (@out , "$out.min 0\n");
push (@out , "$out.label $label\n");
push (@out , "$out.cdef $out,8,*\n");
push (@out , "$out.negative $in\n");
push (@out , "$out.type DERIVE\n");
push (@out , "$out.min 0\n");
}
}

if (@in_fields)
{
push (@out , "in_other.draw STACK\n");
push (@out , "in_other.draw STACK\n");
}
else
{
push (@out , "in_other.draw AREA\n");
push (@out , "in_other.draw AREA\n");
}
push (@in_fields, "in_other");
push (@out , "in_other.label other\n");
push (@out , "in_other.cdef in_other,8,*\n");
push (@out , "in_other.graph no\n");
push (@out , "in_other.type DERIVE\n");
push (@out , "in_other.min 0\n");
push (@out , "in_other.label other\n");
push (@out , "in_other.cdef in_other,8,*\n");
push (@out , "in_other.graph no\n");
push (@out , "in_other.type DERIVE\n");
push (@out , "in_other.min 0\n");

if (@out_fields)
{
push (@out , "out_other.draw STACK\n");
push (@out , "out_other.draw STACK\n");
}
else
{
push (@out , "out_other.draw AREA\n");
push (@out , "out_other.draw AREA\n");
}
push (@out_fields, "out_other");
push (@out , "out_other.label other\n");
push (@out , "out_other.cdef out_other,8,*\n");
push (@out , "out_other.negative in_other\n");
push (@out , "out_other.type DERIVE\n");
push (@out , "out_other.min 0\n");
push (@out , "out_other.label other\n");
push (@out , "out_other.cdef out_other,8,*\n");
push (@out , "out_other.negative in_other\n");
push (@out , "out_other.type DERIVE\n");
push (@out , "out_other.min 0\n");


print "graph_order ", join (' ', @in_fields, @out_fields), "\n";
@@ -8,8 +8,8 @@
#
# The interface must also have an accounting iptables rule defined, _before_
# any action rules. E.g., in /etc/network/vlan-firewall.d/eth1-200-out, you
# will find:
#
# will find:
#
# --out-interface eth0
#
# ...which will make the out-traffic graphable. (Both in and out-files must
@@ -45,11 +45,11 @@ while (<IN>)
print "graph_args --base 1000\n";
print "graph_category network\n";
print "graph_vlabel bits per \${graph_period} in (-) / out (+)\n";
print "in.label bps\n";
print "in.cdef in,8,*\n";
print "in.graph no\n";
print "in.type DERIVE\n";
print "in.min 0\n";
print "in.label bps\n";
print "in.cdef in,8,*\n";
print "in.graph no\n";
print "in.type DERIVE\n";
print "in.min 0\n";
}
else
{
@@ -71,11 +71,11 @@ while (<IN>)
next unless (($proto eq "all") and (!$comment));
if ($ARGV[0] and $ARGV[0] eq "config")
{
print "out.label bps\n";
print "out.cdef out,8,*\n";
print "out.negative in\n";
print "out.type DERIVE\n";
print "out.min 0\n";
print "out.label bps\n";
print "out.cdef out,8,*\n";
print "out.negative in\n";
print "out.type DERIVE\n";
print "out.min 0\n";
}
else
{
@@ -125,9 +125,9 @@ KCIN=$(( 16#${INFO[2]} ))

# If this is 1, then VCI_SPACES is present in the kernel (new in 2.6.19)
if [ $(( (KCIN >> 10) & 1 )) -eq 1 ]
then
then
NAMELOC="nsproxy"
else
else
NAMELOC="cvirt"
fi

@@ -171,19 +171,19 @@ if [ -z "$MODE" ] ; then
MODE=hold
# shellcheck disable=SC2001
TARGET=$(echo "$BASEPARAM" | sed 's/^hold_//')
else
else
MODE=cpu
# shellcheck disable=SC2001
TARGET=$(echo "$BASEPARAM" | sed 's/^cpu_//')
fi

CPU1=0
if [ -n "$TARGET" ] ; then
if [ "${#TARGET}" == 1 ] ; then
if [ "${#TARGET}" == 1 ] ; then
if [ -n "$debug" ]; then echo "$MODE, only on cpu $TARGET, for all vservers"; fi
WHAT=ALLVSERVER
CPU1=$TARGET
else
else
if [ -n "$debug" ]; then echo "$MODE on all cpus together, only for vserver $TARGET"; fi
WHAT=VSERVER
fi
@@ -218,21 +218,21 @@ if [ "$1" = "config" ]; then
echo 'graph_info Shows jiffies on hold used per cpu on each vserver.'
fi

for j in $CPUS ; do
for j in $CPUS ; do
A=0
for i in $XIDS ; do
for i in $XIDS ; do
LABEL=$(grep "NodeName" "/proc/virtual/$i/$NAMELOC" | cut -f 2)
if [ "$WHAT" == "ALLVSERVER" ] || [ "$TARGET" == "$LABEL" ] ; then
NAME=$(echo "$LABEL" | cut -d. -f1 | tr '-' '_')
if [ "$MODE" == "cpu" ] ; then
echo "${NAME}_$j.label cpu usage for cpu $j on $LABEL"
echo "${NAME}_$j.info cpu usage for cpu $j on $LABEL."
else
else
echo "${NAME}_$j.label on hold for cpu $j on $LABEL"
echo "${NAME}_$j.info on hold for cpu $j on $LABEL."
fi
echo "${NAME}_$j.type COUNTER"
if [ "$A" == 0 ] ; then
if [ "$A" == 0 ] ; then
echo "${NAME}_$j.draw AREA"
A=1
else
@@ -244,7 +244,7 @@ if [ "$1" = "config" ]; then
exit 0
fi

for j in $CPUS ; do
for j in $CPUS ; do
for i in $XIDS ; do
LABEL=$(grep "NodeName" "/proc/virtual/$i/$NAMELOC" | cut -f 2)
if [ "$WHAT" == "ALLVSERVER" ] || [ "$TARGET" == "$LABEL" ] ; then
@@ -257,6 +257,6 @@ for j in $CPUS ; do
else
grep "cpu $j:" "/proc/virtual/$i/sched" | cut -d ' ' -f 5
fi
fi
fi
done
done
@@ -84,9 +84,9 @@ KCIN=$(( 16#${INFO[2]} ))

# If this is 1, then VCI_SPACES is present in the kernel (new in 2.6.19)
if [ $(( (KCIN >> 10) & 1 )) -eq 1 ]
then
then
NAMELOC="nsproxy"
else
else
NAMELOC="cvirt"
fi

@@ -108,9 +108,9 @@ else
fi
done
fi

# If run with the "config"-parameter, give out information on how the
# graphs should look.
# graphs should look.
if [ "$1" = "config" ]; then
# The title of the graph
echo 'graph_title loadavg of vserver'
@@ -132,7 +132,7 @@ if [ "$1" = "config" ]; then
NAME=$(echo "$LABEL" | cut -d. -f1 | tr '-' '_')
echo "$NAME.label $LABEL: load average"
echo "$NAME.info $NAME average load for the past 5 minutes"
done
done
# Last, if run with the "config"-parameter, quit here (don't
# display any data)
exit 0
@@ -55,7 +55,7 @@ specified more than one vserver when the resource is set to ALL:
[vserver_resources]
user root
env.vservers vserver5
env.vservers vserver5
env.resource ALL
env.limits 0
@@ -190,9 +190,9 @@ KCIN=$(( 16#${INFO[2]} ))

# If this is 1, then VCI_SPACES is present in the kernel (new in 2.6.19)
if [ $(( (KCIN >> 10) & 1 )) -eq 1 ]
then
then
NAMELOC="nsproxy"
else
else
NAMELOC="cvirt"
fi

@@ -290,12 +290,12 @@ if [ "$1" = "config" ]; then
esac
echo 'graph_category vserver'


# do not assume we are on i386 where pagesize is 4096...
pagesize=$(perl -MPOSIX -e 'print POSIX::sysconf(_SC_PAGESIZE), "\n";')

for xid in $XIDS ; do

LABEL=$(grep "NodeName" "/proc/virtual/$xid/$NAMELOC" | cut -f 2)
NAME=$(echo "$LABEL" | cut -d. -f1 | tr '-' '_')

@@ -354,7 +354,7 @@ if [ "$1" = "config" ]; then
exit 1
;;
esac

if [ ! -z "$LIMITS" ] && [ "$LIMITS" = 1 ]; then
LIMIT=$(grep "$RESOURCE" "/proc/virtual/$xid/limit" | cut -f 4)
if [ "${LIMIT:-0}" -gt 0 ]; then
@@ -78,8 +78,8 @@ if [ "$1" = "config" ]; then
echo 'system.max 5000'
echo 'system.type DERIVE'
echo 'system.min 0'
# echo "system.warning $SYSWARNING"
# echo "system.critical $SYSCRITICAL"
# 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"

@@ -8,7 +8,7 @@
# autoconf (optional - used by munin-config)
#
# $Id$
#
#
# Magic markers (optional - used by munin-config and installation
# scripts):
#
@@ -31,7 +31,7 @@

if [ "$1" = "autoconf" ]; then
if [ -x /usr/bin/vmstat ]; then
echo yes
echo yes
exit 0
else
echo "no (no /usr/bin/vmstat executable)"
@@ -53,20 +53,20 @@ fi

if [ "$1" = "config" ]; then

echo "graph_order rbytes obytes"
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 DERIVE'
echo 'rbytes.graph no'
echo 'rbytes.cdef rbytes,8,*'
echo 'rbytes.type DERIVE'
echo 'rbytes.graph no'
echo 'rbytes.cdef rbytes,8,*'
echo 'rbytes.min 0'

echo 'obytes.label bps'
echo 'obytes.label bps'
echo 'obytes.type DERIVE'
echo 'obytes.negative rbytes'
echo 'obytes.cdef obytes,8,*'
@@ -1,6 +1,6 @@
#!@@GOODSH@@
#
# Plugin to monitor the number of interrupts and context switches on a system.
#
# Plugin to monitor the number of interrupts and context switches on a system.
#
# Idea and base from Ragnar Wisl�ff.
#
@@ -37,8 +37,8 @@ if [ "$1" = "autoconf" ]; then
fi

# If run with the "config"-parameter, give out information on how the
# graphs should look.
# graphs should look.

if [ "$1" = "config" ]; then
# The title of the graph
echo 'graph_title Interrupts & context switches'
@@ -59,7 +59,7 @@ if [ "$1" = "config" ]; then
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.
# required subfield.
echo 'devint.label device interrupts'
echo 'softint.label software interrupts'
echo 'ctx.label context switches'
@@ -28,7 +28,7 @@

if [ "$1" = "autoconf" ]; then
if [ -x /usr/sbin/iostat ]; then
echo yes
echo yes
exit 0
else
echo "no (no /usr/sbin/iostat executable)"
@@ -30,7 +30,7 @@

if [ "$1" = "autoconf" ]; then
if [ -x /usr/sbin/iostat ]; then
echo yes
echo yes
exit 0
else
echo "no (no /usr/sbin/iostat executable)"
@@ -1,5 +1,5 @@
#!@@GOODSH@@
#
#
# Plugin to monitor the individual interrupt sources.
#
# Usage: Link or copy into /etc/munin/node.d/
@@ -48,8 +48,8 @@ intr_sources () {
}

# If run with the "config"-parameter, give out information on how the
# graphs should look.
# graphs should look.

if [ "$1" = "config" ]; then

echo 'graph_title Individual interrupts'
@@ -1,5 +1,5 @@
#!@@GOODSH@@
#
#
# Plugin to monitor the load average on a system.
#
# Usage: Link or copy into /etc/munin/node.d/
@@ -53,8 +53,8 @@ NCPU=`/sbin/sysctl -n hw.ncpu`
if [ $? != 0 ]; then NCPU=1; fi

# If run with the "config"-parameter, give out information on how the
# graphs should look.
# graphs should look.

if [ "$1" = "config" ]; then
# The host name this plugin is for. (Can be overridden to have
# one machine answer for several)
@@ -72,7 +72,7 @@ if [ "$1" = "config" ]; then
# 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.
# 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
@@ -39,7 +39,7 @@ GPLv2
=cut

#
#
#
#
#
#
@@ -1,9 +1,9 @@
#!@@GOODSH@@
#
#
# Plugin to monitor the number of open files in the system.
#
# Parameters:
#
#
# config (required)
# autoconf (optional - used by munin-config)
#
@@ -44,7 +44,7 @@ if [ "$1" = "autoconf" ]; then
exit 0
fi
fi


if [ "$1" = "suggest" ]; then
/usr/sbin/envstat -r | awk '
@@ -3,7 +3,7 @@
# Plugin to monitor the number of procs in io-sleep and other wait
# states. Uses `vmstat`.
#
# Parameters:
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
@@ -89,5 +89,5 @@ $DF -k -l ${only:-} | $TAIL +2 | while read -r dev size used avail pct mnt; do
swap:*) name=$(clean_fieldname "$mnt");;
*:*) name=$(clean_fieldname "$dev");;
esac
echo "$name.value $pct" | cut -f1 -d%
echo "$name.value $pct" | cut -f1 -d%
done
@@ -111,5 +111,5 @@ eval $DF | $TAIL +2 | while read dev size used avail pct mnt; do
swap:*) name=$(clean_fieldname $mnt);;
*) name=$(clean_fieldname $dev);;
esac
echo "$name.value $pct" | cut -f1 -d%
echo "$name.value $pct" | cut -f1 -d%
done
@@ -65,7 +65,7 @@ fi

if [ "$1" = "config" ]; then

echo "graph_order rbytes obytes"
echo "graph_order rbytes obytes"
echo "graph_title $INTERFACE traffic"
echo 'graph_args --base 1000'
echo 'graph_vlabel bits per ${graph_period} in (-) / out (+)'
@@ -51,9 +51,9 @@ use constant IOSTATPRM => "-Ixr";

if ($ARGV[0] && $ARGV[0] eq "autoconf"){
if (-x IOSTATBIN) {
print "yes\n";
print "yes\n";
} else {
print 'no (no ',IOSTATBIN," executable)\n";
print 'no (no ',IOSTATBIN," executable)\n";
}
exit 0;
}
@@ -88,7 +88,7 @@ if ($ARGV[0] && $ARGV[0] eq "config"){
exit 0;
}

open(IOSTAT, IOSTATBIN." ".IOSTATPRM."|") ||
open(IOSTAT, IOSTATBIN." ".IOSTATPRM."|") ||
die ("Couldn't run iostat $!\n");

my($dev,$nri,$nwi,$bri,$bwi);
@@ -100,14 +100,14 @@ while(<IOSTAT>){
($dev,$nri,$nwi,$bri,$bwi,undef) = split(',',$_,6);
# print "$dev $nri $nwi $bri $bwi\n";
if ($dev =~ /^sd/) {
$dev = 'disk';
$dev = 'disk';
} elsif ($dev =~ /^st/) {
$dev = 'tape';
$dev = 'tape';
} elsif ($dev =~ /^nfs/) {
$dev = 'nfs';
$dev = 'nfs';
} else {
# We ignore fd = floppy, and lines of headers and such
next;
# We ignore fd = floppy, and lines of headers and such
next;
}
$nri{$dev} += $nri;
$nwi{$dev} += $nwi;
@@ -121,4 +121,3 @@ foreach $dev ('disk','tape','nfs') {
print $dev,"w.value ", (defined($bwi{$dev}) ? $bwi{$dev} : "U"), "\n";
print $dev,"r.value ", (defined($bri{$dev}) ? $bri{$dev} : "U"), "\n";
}

@@ -59,12 +59,12 @@ graph_category system
graph_scale no
graph_vlabel load
graph_args --base 1000 -l 0
graph_info The load average of the machine describes how many processes are in the run-queue
graph_info The load average of the machine describes how many processes are in the run-queue
load.label load
load.info 5 minute load average
EOF
print_warning load
print_critical load
print_warning load
print_critical load
exit 0
fi

@@ -74,4 +74,3 @@ fi

printf "load.value "
/bin/uptime | sed -e 's/.*, \([\.0-9]*\),.*/\1/g'

@@ -109,8 +109,8 @@ if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )
next;
}
else {
print "no (ExtendedStatus option for apache"
. " mod_status is missing on port $port)\n";
print "no (ExtendedStatus option for apache"
. " mod_status is missing on port $port)\n";
exit 0;
}
}
@@ -138,7 +138,7 @@ if ( defined $ARGV[0] and $ARGV[0] eq "config" )
print "accesses$port.type DERIVE\n";
print "accesses$port.max 1000000\n";
print "accesses$port.min 0\n";
print "accesses$port.info The number of accesses (pages and other items"
print "accesses$port.info The number of accesses (pages and other items"
. " served) globally on the Apache server\n";
print_thresholds("accesses$port");
}
@@ -116,8 +116,8 @@ if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )
next;
}
else {
print "no (ExtendedStatus option for apache"
. " mod_status is missing on port $port)\n";
print "no (ExtendedStatus option for apache"
. " mod_status is missing on port $port)\n";
exit 0;
}
}
@@ -97,7 +97,7 @@ if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )
print "no ($ret)\n";
exit 0;
}

my $ua = LWP::UserAgent->new(timeout => 30,
agent => sprintf("munin/%s (libwww-perl/%s)", $Munin::Common::Defaults::MUNIN_VERSION, $LWP::VERSION));

@@ -109,8 +109,8 @@ if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )
next;
}
else {
print "no (ExtendedStatus option for apache"
. " mod_status is missing on port $port)\n";
print "no (ExtendedStatus option for apache"
. " mod_status is missing on port $port)\n";
exit 0;
}
}
@@ -126,11 +126,11 @@ $pop->print("\n");

#Response: Follows
#Privilege: Command
#Peer User/ANR Call ID Seq (Tx/Rx) Format Hold Last Message
#Peer User/ANR Call ID Seq (Tx/Rx) Format Hold Last Message
#0 active SIP channels
# -- OR --
#74.218.176.166 (None) c24a5a230c6 00101/278584006 0x0 (nothing) No Rx: REGISTER
#74.218.176.166 (None) 508c037f936 00101/07310 0x0 (nothing) No Rx: REGISTER
#74.218.176.166 (None) c24a5a230c6 00101/278584006 0x0 (nothing) No Rx: REGISTER
#74.218.176.166 (None) 508c037f936 00101/07310 0x0 (nothing) No Rx: REGISTER
#2 active SIP channels
#--END COMMAND--

@@ -61,11 +61,11 @@ address with the copyright notice upgrade with your name.
# #################################################################################
# Following example from current asterisk 1.4
#> sip show peers
#Name/username Host Dyn Nat ACL Port Status
#104-RANDALLBUILT/104-RAND 74.218.176.166 D 5060 Unmonitored
#...
#102-ROCKSOLID/102-ROCKSOL (Unspecified) D 0 Unmonitored
#101-ROCKSOLID/101-ROCKSOL (Unspecified) D N 0 UNKNOWN
#Name/username Host Dyn Nat ACL Port Status
#104-RANDALLBUILT/104-RAND 74.218.176.166 D 5060 Unmonitored
#...
#102-ROCKSOLID/102-ROCKSOL (Unspecified) D 0 Unmonitored
#101-ROCKSOLID/101-ROCKSOL (Unspecified) D N 0 UNKNOWN
#20 sip peers [Monitored: 0 online, 1 offline Unmonitored: 2 online, 17 offline]
# #################################################################################

@@ -118,7 +118,7 @@ my @fields;
while (($line = $pop->getline) and ($line !~ /--END/o))
{
if ($start) {
@fields = (split ' ', $line);
@fields = (split ' ', $line);
$results = $results + pop(@fields);
}

@@ -11,7 +11,7 @@ The following environment variables are used by this plugin

[bind_rndc]
env.rndc /usr/sbin/rndc
env.rndc_options
env.rndc_options
env.querystats /var/run/named.stats

The user/group that runs the plugin must have read access to the stats
@@ -85,18 +85,18 @@ if (!defined ($session)) {
7 => 'low',
8 => 'warn',
);

# TODO: Fill out more from MIB
my %sensor_types = (
1 => 'not available',
10 => 'temperature',
);

if ($configure) {
# .1.3.6.1.4.1.2606.4.2.3.5.2.1.x.1
# unit -^ ^ ^- index
# `- property

my $baseoid = "1.3.6.1.4.1.2606.4.2." . (2 + $sensor_unit) . ".5.2.1";
if (defined (my $response = $session->get_table ($baseoid))) {
while (my ($oid, $value) = each (%$response)) {
@@ -138,19 +138,19 @@ if (!defined ($session)) {
# Find number of connected CMC units
my $num_units_oid = '1.3.6.1.4.1.2606.4.2.2.0';
my $num_units = $session->get_request ($num_units_oid)->{$num_units_oid};

# .1.3.6.1.4.1.2606.4.2.3.5.2.1.1.1
# ^- 2 + $unit_no

for (my $i = 1; $i <= $num_units; $i++) {

# Walk each table
my $baseoid = "1.3.6.1.4.1.2606.4.2." . (2 + $i) . ".5.2.1";

# Find properties and values
# We only traverse the OID tree once per sensor,
# to reduce number of SNMP GET requests.

if (defined (my $response = $session->get_table ($baseoid))) {
while (my ($oid, $value) = each (%$response)) {
my $prop_id = undef;
@@ -183,12 +183,12 @@ if (!defined ($session)) {
# Go directly to the OID we want
my $oid = "1.3.6.1.4.1.2606.4.2." . (2 + $sensor_unit) . ".5.2.1.5." . $sensor_index;
my $value = $session->get_request ($oid)->{$oid};

# Show values
print "sensor_" . $sensor_unit . "_" . $sensor_index . ".value $value\n";
}
}

$session->close();
}
exit 0;
@@ -141,19 +141,19 @@ foreach my $i (keys %{$rejects}) {

if(-l $statefile) {
die("$statefile is a symbolic link, refusing to touch it.");
}
}
open (OUT, ">$statefile") or exit 4;
print OUT "$pos:$delivered\n";
foreach my $i (keys %{$rejects}) {
print OUT "$i:", $rejects->{$i}, "\n";
}
close OUT;

sub parseLogfile {
sub parseLogfile {
my ($fname, $start, $stop) = @_;
open (LOGFILE, $fname) or exit 3;
seek (LOGFILE, $start, 0) or exit 2;

while (tell (LOGFILE) < $stop) {
my $line =<LOGFILE>;
chomp ($line);
@@ -163,7 +163,7 @@ sub parseLogfile {
$rejects->{$1} ++;
}
}
close(LOGFILE);
close(LOGFILE);
}

sub get_prev_date {
@@ -121,24 +121,24 @@ print "volume.value $volume\n";

if(-l $statefile) {
die("$statefile is a symbolic link, refusing to touch it.");
}
}
open (OUT, ">$statefile") or exit 4;
print OUT "$pos:$volume\n";
close OUT;

sub parseLogfile {
sub parseLogfile {
my ($fname, $start, $stop) = @_;
open (LOGFILE, $fname) or exit 3;
seek (LOGFILE, $start, 0) or exit 2;

while (tell (LOGFILE) < $stop) {
my $line =<LOGFILE>;
chomp ($line);
if($line =~ /(?:courierlocal|courieresmtp): id=.*,from=.*,addr=.*,size=(\d+),success:.*delivered/) {
$volume += $1;
}
}
close(LOGFILE);
close(LOGFILE);
}

sub get_prev_date {
@@ -152,7 +152,7 @@ sub parselogfile {
} elsif(defined($printers{$1})) {
$printers{$1} += int($2)*int($3);
}
}
}
}
close(LOGFILE);
}
@@ -26,9 +26,9 @@ The following environment settings are the default configuration. The
env.critical 0.95
env.warning 0.9

The optional filter setting is used to strip parts of ranges for the
The optional filter setting is used to strip parts of ranges for the
network labels (example will show 10.140.80.0 as 80.0). Both critical
and warning are optional settings, default for warning is 0.9 (90%)
and warning are optional settings, default for warning is 0.9 (90%)
and 0.95 for critical (95%).

=head1 INTERPRETATION
@@ -72,7 +72,7 @@ if(! eval "require HTTP::Date") {
}
if(! eval "require Net::IP") {
$ret = "Net::IP not found";
}
}


use strict;
@@ -159,10 +159,10 @@ foreach my $network (sort(keys %leases)) {

sub parseconfig {
my($configfile) = @_;

local(*IN);
open(IN, "<$configfile") or exit 4;

my $name = undef;
LINE: while(<IN>) {
if(/subnet\s+((?:\d+\.){3}\d+)\s+netmask\s+((?:\d+\.){3}\d+)/ && ! /^\s*#/) {
@@ -201,7 +201,7 @@ sub rangecount {

$from = ((new Net::IP($from))->intip())->numify();
$to = ((new Net::IP($to))->intip())->numify();

if($from < $to) {
return ($to - $from) + 1;
} else {
@@ -213,7 +213,7 @@ sub rangecount {
sub parseleases {
my $ip = 0;
my $abandon = 0;
my $time = time();
my $time = time();

open(IN, "<$LEASEFILE") or exit 4;
while(<IN>) {
@@ -225,9 +225,9 @@ sub parseleases {
# 2037/12/31 23:59:59 is max date on perl <= 5.6
print "# DEBUG: end $1\n" if $DEBUG;
my $end = HTTP::Date::str2time($1, "GMT");
# we asume that missing $end is valid due to
# we asume that missing $end is valid due to
# restrictions in Time::Local on perl <= 5.6
if($end && $end < $time) {
if($end && $end < $time) {
print "# DEBUG: old $end $time:(\n" if $DEBUG;
$abandon = 1;
}
@@ -104,7 +104,7 @@ if [ "$1" = "autoconf" ]; then
exit 0
fi
fi

if [ "$1" = "config" ]; then
echo "graph_title $GRAPHTITLE"
echo 'graph_args --base 1000 -l 0'
@@ -4,17 +4,17 @@
# Copyright (C) 2012 Redpill Linpro AS
#
# Author: Trygve Vea <tv@redpill-linpro.com>
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@@ -7,7 +7,7 @@
# the preferred one.
#
# client-conf.d/-options:
#
#
# drives -- List drives to monitor. E.g. "hda hdc".
#
#%# family=contrib
@@ -3,7 +3,7 @@
#
# Plugin to monitor hard drive temperatures.
#
# This plugin is an alternative to the hddtemp_smartctl, which is the
# This plugin is an alternative to the hddtemp_smartctl, which is the
# preferred one.
#
# Requirements:
@@ -3,7 +3,7 @@
#
# Munin plugin to monitor hdd temperature from a hddtemp daemon.
#
# This plugin is an alternative to the hddtemp_smartctl, which is the
# This plugin is an alternative to the hddtemp_smartctl, which is the
# preferred one.
#
# Author: Stein Magnus Jodal <jodal at users.sourceforge.net>
@@ -81,7 +81,7 @@ if ($ARGV[0] and $ARGV[0] eq "config") {
${$this}[0] =~ tr#_#/#;
print "${$this}[0]\n";
}

exit 0;
}

@@ -5,7 +5,7 @@

=head1 NAME

ipac-ng - Skeleton-plugin to monitor ipac-ng rules.
ipac-ng - Skeleton-plugin to monitor ipac-ng rules.

=head1 CONFIGURATION

@@ -41,32 +41,32 @@ if [ "$1" = "autoconf" ]; then
if [ -x /usr/sbin/fetchipac ] && [ -x /usr/sbin/ipacsum ]; then
echo yes
exit 0
else
else
echo no
exit 0
fi
fi
fi

if [ "$1" = "config" ]; then
echo "graph_order down up"
echo "graph_title $TITLE"
echo "graph_title $TITLE"
echo 'graph_args --base 1000'
echo 'graph_vlabel b/s in (-) / out (+)'
echo 'down.label received'
echo 'down.label received'
echo 'down.graph no'
# Divide it by 1500 seconds (5m), to get b/s
echo 'down.cdef down,1500,/'
echo 'up.label b/s'
echo 'down.cdef down,1500,/'
echo 'up.label b/s'
echo 'up.negative down'
echo 'up.cdef up,1500,/'
exit 0
fi;

if fetchipac; then
ipacsum -s 5m -x -f "$UP" | tail -n 1 | cut -d : -f 2 | awk \
'{print "up.value " $1}'
'{print "up.value " $1}'
ipacsum -s 5m -x -f "$DOWN" | tail -n 1 | cut -d : -f 2 | awk \
'{print "down.value " $1}'
'{print "down.value " $1}'
else
echo 'up.value U'
echo 'down.value U'
@@ -47,7 +47,7 @@ case $1 in
autoconf)
type -p ipmitool &>/dev/null ||
{ echo 'no (missing ipmitool command)' && exit 0; }

ipmitool sensor &>/dev/null ||
{ echo 'no (unable to access IPMI device)' && exit 0; }

@@ -127,6 +127,6 @@ $conn->add_global_handler('luserchannels', \&luserchannels);

while(1) {
$irc->do_one_loop();
}
}

# vim:syntax=perl
@@ -129,7 +129,7 @@ for my $key (keys %regex) {

if(-l $statefile) {
die("$statefile is a symbolic link, refusing to touch it.\n");
}
}
open(my $out, '>', $statefile) or die("Can't write $statefile: $!\n");
for my $key (keys %regex) {
print $out "$key=$regex{$key}{'value'}\n";
@@ -56,7 +56,7 @@ $ENV{'LC_MESSAGES'} = "C";
my $host = '127.0.0.1';

my $lpstat = exists $ENV{lpstat} ? $ENV{lpstat} : '';

# If the envvar is not set, look for lpstat
if (!$lpstat) {
# Still not found? Check obvious places
@@ -148,7 +148,7 @@ sub mailmanDomains {
if (-e "$libdir/data") {
@domains = (".");
} else {
opendir(DOMAINS, $libdir) or
opendir(DOMAINS, $libdir) or
die "Can't open directory $libdir for reading: $!";
@domains = grep ( { !/^\@/ && !/^\./ && -d "$libdir/$_" }
readdir(DOMAINS) );
@@ -161,7 +161,7 @@ sub mailmanLists {
my ($domain) = @_;
opendir(LISTS, "$libdir/$domain/lists") or
die "Can't open directory $libdir/$domain/lists for reading: $!";
my @lists = grep ( { !/^\@/ && !/^\./ && -d "$libdir/$domain/lists/$_" }
my @lists = grep ( { !/^\@/ && !/^\./ && -d "$libdir/$domain/lists/$_" }
readdir(LISTS) );
closedir(LISTS);
return @lists;
@@ -75,7 +75,7 @@ case $what in
;;
FAN)
echo 'graph_title Motherboard Fans'
echo 'graph_category sensors'
echo 'graph_category sensors'
echo 'graph_order FAN0 FAN1 FAN2'
echo 'graph_vlabel rpm'
echo 'FAN0.label Fan 1'
@@ -32,17 +32,17 @@
#%# family=contrib
#%# capabilities=noautoconf
use strict;
my $ret = undef;
my $ret = undef;
if (! eval "require Cache::Memcached;") {
$ret = "Cache::Memcached not found";
}
}
my $HOST = exists $ENV{'host'} ? $ENV{'host'} : "127.0.0.1";
my $PORT = exists $ENV{'port'} ? $ENV{'port'} : 11211;
my $PORT = exists $ENV{'port'} ? $ENV{'port'} : 11211;
if ( exists $ARGV[0] and $ARGV[0] eq "autoconf" ) {
if ($ret) {
print "no ($ret)\n";
exit 0;
}
}
# Todo: we can always connect to a memcache server without any errors so I cannot really
# find a way to detect the presence of a memcache instance. Maybe a forced write/read/delete
# but there should be a better way somewhere...
@@ -53,7 +53,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "autoconf" ) {
if($ret) {
print "no ($ret)\n";
exit 1;
}
}

# We do everything by this array
my %all_vars = (
@@ -227,7 +227,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) {
}
}
exit 0;
}
}
my $mc = new Cache::Memcached { 'servers' => [ "$HOST:$PORT" ] };
my $stats = $mc->stats ('misc');

@@ -75,7 +75,7 @@ if [ "$1" = "config" ]; then
exit 0
fi

for hosts in $host
for hosts in $host
do
export site=$((site + 1))
# shellcheck disable=SC2086
@@ -138,7 +138,7 @@ for name in $names; do
fieldname="$(clean_fieldname "$name")"

ps -eo "$monitor,comm" | gawk '
BEGIN { total = "U"; } # U = Unknown.
BEGIN { total = "U"; } # U = Unknown.
/grep/ { next; }
$2 ~ /^'"$name"'$/ { total = total + ($1*1024); }
END { print "'"$fieldname"'.value", total; }'
@@ -48,7 +48,7 @@ sub uses_graph_cron {


if ($ARGV[0] and $ARGV[0] eq 'autoconf') {
my $munin_update_location =
my $munin_update_location =
"$Munin::Common::Defaults::MUNIN_LIBDIR/munin-update";

if (! -e $munin_update_location) {
@@ -59,7 +59,7 @@ if ($ARGV[0] and $ARGV[0] eq 'autoconf') {
if (! -x $munin_update_location) {
print "no ($munin_update_location was found, but is not executable)\n";
exit 0;
}
}
else {
print "yes\n";
exit 0;
@@ -84,7 +84,7 @@ MUNIN_UPDATE_LOCATION=${MUNIN_UPDATE_LOCATION:-$MUNIN_LIBDIR/munin-update}
if [ "$1" = "autoconf" ]; then
if [ -e "$MUNIN_UPDATE_LOCATION" ] ; then
echo "yes";
else
else
echo "no ($MUNIN_UPDATE_LOCATION is not present so this is not a munin-master)"
fi
exit 0
@@ -111,7 +111,7 @@ graph_total total\n");
);
$num++;
}

}


@@ -64,7 +64,7 @@ if [ "$1" = "config" ]; then
echo 'graph_vlabel threads'
echo 'graph_category mysql'
echo 'graph_info Note that this is a old plugin which is no longer installed by default. It is retained for compatability with old installations.'

echo 'threads.label mysql threads'
echo 'graph_args --base 1000'
exit 0
@@ -74,11 +74,11 @@ munin-node.

if [ -n "${logfile:-}" ]; then
SYSLOGFILE=$logfile
else
else
if [ -f /var/adm/messages ]; then
SYSLOGFILE=/var/adm/messages
SYSLOGFILE=/var/adm/messages
else
SYSLOGFILE=/var/log/daemon.log
SYSLOGFILE=/var/log/daemon.log
fi
fi

@@ -87,7 +87,7 @@ fi
pick_stat () {
ret=$(echo "$2" | sed 's/.* *'"$1"'=\([0-9]*\).*/\1/')
if [ ! "$ret" ]; then
echo 0;
echo 0
else
echo "$ret"
fi
@@ -107,7 +107,7 @@ do_stats () {
# We concentrate on what clients communicate with us about
# and counters that we suspect can indicate abuse or error conditions

# Received Queries: Total volume of queries received.
# Received Queries: Total volume of queries received.
# This should be nice and smooth.
echo "queries.value $(pick_stat RQ "$XSTATS")"

@@ -121,15 +121,15 @@ do_stats () {

# Received Zone Transfer queries - should be low. High value could
# indicate some odd error or some kind of abuse
echo "axfr.value $(pick_stat RAXFR "$XSTATS")" # Received AXFR Qs
echo "axfr.value $(pick_stat RAXFR "$XSTATS")" # Received AXFR Qs

# Received TCP connections: These are used for zone transfers or
# oversized (>512 byte) answers. A high value here could indicate
# that you need to trim down the size of your answers somehow (Do you
# have a ton of MXes or NSes that gets reported back?), or this could
# be due to an error. Or it could be due to abuse.
echo "tcp.value $(pick_stat RTCP "$XSTATS")"

# Get a total of errors
local error_value
error_value=$(( $(pick_stat RNXD "$XSTATS")
@@ -143,7 +143,7 @@ do_stats () {

case $1 in
config)
cat <<'EOF'
cat <<'EOF'
graph_title BIND DNS Query statistics
graph_vlabel Queries / ${graph_period}
graph_scale no
@@ -166,8 +166,8 @@ errors.label Errors
errors.type DERIVE
errors.min 0
EOF
exit 0
;;
exit 0
;;
esac

do_stats
@@ -6,18 +6,18 @@ hostname="$(hostname)"

if [ "$1" = "config" ]; then
echo "host_name $hostname"
echo "graph_order down up"
echo "graph_order down up"
echo "graph_title ADSL Traffic"
echo 'graph_args --base 1000'
# shellcheck disable=SC2016
# shellcheck disable=SC2016
echo 'graph_vlabel bits in (-) / out (+) per ${graph_period}'
echo 'down.label received'
echo 'down.type DERIVE'
echo 'down.graph no'
echo 'down.cdef down,8,*'
echo 'down.type DERIVE'
echo 'down.graph no'
echo 'down.cdef down,8,*'
echo "down.max $DOWNMAX"
echo "down.min 0"
echo 'up.label bps'
echo 'up.label bps'
echo 'up.type DERIVE'
echo 'up.negative down'
echo 'up.cdef up,8,*'
@@ -74,7 +74,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "autoconf" )
print "no ($ret)\n";
exit 0;
}

my $ua = LWP::UserAgent->new(timeout => 30,
agent => sprintf("munin/%s (libwww-perl/%s)", $Munin::Common::Defaults::MUNIN_VERSION, $LWP::VERSION));
my $response = $ua->request(HTTP::Request->new('GET',$URL));
@@ -101,7 +101,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" )
print "request.min 0\n";
print "request.label requests port $port\n";
print "request.draw LINE\n";

exit 0;
}

@@ -120,10 +120,10 @@ my $ua = LWP::UserAgent->new(timeout => 30,

my $response = $ua->request(HTTP::Request->new('GET',$URL));

#Active connections: 1845
#Active connections: 1845
#server accepts handled requests
# 4566318 4566318 84218236
# Reading: 2 Writing: 278 Waiting: 1565
# 4566318 4566318 84218236
# Reading: 2 Writing: 278 Waiting: 1565
if ($response->content =~ /Active connections:\s+(\d+).*Reading:\s+(\d+).*Writing:\s+(\d+).*Waiting:\s+(\d+)/s) {
print "total.value $1\n";
print "reading.value $2\n";
@@ -97,7 +97,7 @@ if($ARGV[0] and $ARGV[0] eq "config") {
# Checking if snmpwalk is found and executable
if(! -x ${snmpwalk}){
${status}=2;
print STDERR "Error: " . ${snmpwalk} . " not found.\n";
print STDERR "Error: " . ${snmpwalk} . " not found.\n";
if(${debug}){
print "Exit code: " . ${status} . "\n";
}
@@ -81,13 +81,13 @@ open (OUT, ">" . $pop{'statefile'}) or exit 4;
print OUT "$pos:$logons\n";
close OUT;

sub parsePopfile
{
sub parsePopfile
{
my ($fname, $start, $stop) = @_;
open (LOGFILE, $fname) or exit 3;
seek (LOGFILE, $start, 0) or exit 2;

while (tell (LOGFILE) < $stop)
while (tell (LOGFILE) < $stop)
{
my $line =<LOGFILE>;
chomp ($line);
@@ -97,7 +97,7 @@ sub parsePopfile
$logons++;
}
}
close(LOGFILE);
close(LOGFILE);
}


@@ -1,4 +1,4 @@
#!@@GOODSH@@
#!@@GOODSH@@
# -*- sh -*-

: << =cut
@@ -41,7 +41,7 @@ if [ "$1" = "autoconf" ]; then
if [ -n "$MAILSTATS" ] && [ -x "$MAILSTATS" ]
then echo yes
else echo "no (no mailstats command)"
fi
fi
exit 0
fi

@@ -33,7 +33,7 @@ if (! eval "require Net::LDAP;") {
}

use vars qw ( $config $param $act $scope $descr $cn $vlabel
$info $title $label);
$info $title $label);

# Change these to reflect your LDAP ACL. The given DN must have
# read access to the Monitor branch.
@@ -54,7 +54,7 @@ my %ops =
'label' => 'Bytes',
'title' => "Number of bytes sent",
'info' => "The graph shows the number of bytes sent",
'scope' => "base"
'scope' => "base"
},
'statistics_pdu'
=> {
@@ -64,18 +64,18 @@ my %ops =
'label' => 'PDUs',
'title' => "Number of PDUs sent",
'info' => "The graph shows the number of PDUs sent",
'scope' => "base"
'scope' => "base"
},
# Referrals
'statistics_referrals'
'statistics_referrals'
=> {
'search' => "cn=Referrals,cn=Statistics",
'desc' => "The number of Referrals sent by the LDAP server.",
'vlabel' => 'Referrals pr ${graph_period}',
'label' => 'Referrals',
'title' => "Number of LDAP Referrals",
'info' => "The graph shows the number of referrals sent",
'scope' => "base"
'scope' => "base"
},
# Entries
'statistics_entries'
@@ -86,10 +86,10 @@ my %ops =
'label' => 'Entries',
'title' => "Number of LDAP Entries",
'info' => "The graph shows the number of entries sent",
'scope' => "base"
'scope' => "base"
},
# Only read Total
'connections'
'connections'
=> {
'search' => 'cn=Total,cn=Connections',
'desc' => 'The number of connections',
@@ -101,7 +101,7 @@ my %ops =
},
# dn: cn=Write,cn=Waiters,cn=Monitor
# dn: cn=Read,cn=Waiters,cn=Monitor
'waiters'
'waiters'
=> {
'search' => 'cn=Waiters',
'filter' => '(|(cn=Write)(cn=Read))',
@@ -142,7 +142,7 @@ graph_title $ops{$action}->{'title'}
graph_category OpenLDAP
graph_info $ops{$action}->{'info'}
EOF

if ($ops{$action}->{'label2'}) {
while (my ($key, $val) = each (%{$ops{$action}->{'label2'}})) {
my $name = $action . "_" . $key;
@@ -174,7 +174,7 @@ EOF
'cn'],
);
$mesg->code && die $mesg->error;

my $max = $mesg->count;
for (my $i = 0 ; $i < $max ; $i++) {
my $entry = $mesg->entry ($i);
@@ -189,7 +189,7 @@ EOF
print "$name.info The difference between Initiated ";
print "and Completed operations (should be 0)\n";
print "$name.warning 1\n";
}
}
}

$ldap->unbind;
@@ -206,10 +206,10 @@ EOF
if ($ARGV[0]) {
if ($ARGV[0] eq 'autoconf') {
# Check for Net::LDAP
if ($ret) {
print "no ($ret)\n";
exit 0;
}
if ($ret) {
print "no ($ret)\n";
exit 0;
}

# Check for LDAP version 3
my $ldap = Net::LDAP->new ($server, version => 3)
@@ -315,27 +315,24 @@ for (my $i = 0 ; $i < $max ; $i++) {
my $entry = $mesg->entry ($i);
my $cn = $entry->get_value('cn');
if ($action =~ /operations(_diff)?$/) {
if ($1) {
my $opsInit =
$entry->get_value('monitorOpInitiated');
my $opsComp =
$entry->get_value('monitorOpCompleted');
print lc ("operations_diff_${cn}.value ");
print ($opsInit - $opsComp);
print "\n";
} else {
print lc ("operations_${cn}.value ");
print $entry->get_value('monitorOpCompleted'),
"\n";
}
if ($1) {
my $opsInit = $entry->get_value('monitorOpInitiated');
my $opsComp = $entry->get_value('monitorOpCompleted');
print lc ("operations_diff_${cn}.value ");
print ($opsInit - $opsComp);
print "\n";
} else {
print lc ("operations_${cn}.value ");
print $entry->get_value('monitorOpCompleted'), "\n";
}
} else {
# Hotfix, must do for now
if ($action =~ /_/ || $action eq 'connections') {
print lc ("${action}.value ");
} else {
print lc ("${action}_${cn}.value ");
}
print $entry->get_value('monitorCounter'), "\n";
# Hotfix, must do for now
if ($action =~ /_/ || $action eq 'connections') {
print lc ("${action}.value ");
} else {
print lc ("${action}_${cn}.value ");
}
print $entry->get_value('monitorCounter'), "\n";
}
}
$ldap->unbind;
@@ -2,7 +2,7 @@
# -*- perl -*-
#
# Plugin copyright Bjorn Ruberg <bjorn@ruberg.no> 2005-2009
#
#
# Licensed under GPLv2. Be nice.
#
# Environment variables:
@@ -17,7 +17,7 @@
# - title (Optional) The plugin's title. Useful if you
# have more than one DIT installed.
# - warning (Optional) A threshold integer value. Triggers
# plugin to send warnings if cache percentage
# plugin to send warnings if cache percentage
# drops below the given value.
#
# Limitations:
@@ -87,7 +87,7 @@ if ($arg && $arg eq "config") {
print "percent\n";
exit 0;
}


if ($config) {
print <<EOF;
@@ -91,8 +91,8 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") {
print <<'EOC';
graph_title CPU usage in percent
graph_category system
graph_args --upper-limit 100 -l 0
graph_vlabel %
graph_args --upper-limit 100 -l 0
graph_vlabel %
graph_info This graph shows the CPU load on the system.
EOC
foreach my $cpu (keys %cpus) {
@@ -19,7 +19,7 @@ The following environment variables are used

Copyright (C) 2011 Erik Inge Bolsø, Redpill Linpro AS for OSL

Based on snmp__df (C) 2004 Jimmy Olsen
Based on snmp__df (C) 2004 Jimmy Olsen

=head1 LICENSE

@@ -115,7 +115,7 @@ my @keep = ();

foreach my $id (keys %$correct_capacity)
{
if (exists $correct_type->{$id} and
if (exists $correct_type->{$id} and
exists $correct_removable->{$id})
{
push (@keep, $id);
@@ -162,7 +162,7 @@ if ($foundpartitions == 0 or defined $partitions{""})
$partitions{$spart}{extinfo} = $part;
$stor_id->{$id} = $spart;
}
} else
} else
{ # Get the ones we're sure about

$stor_id = get_by_regex ($session, $hrStorageDesc, '(^'.join('$|^',keys(%partitions)).'$)');
@@ -80,7 +80,7 @@ elsif (!defined($host))
die "# Error: couldn't understand what I'm supposed to monitor.";
}

my $fcEntryDescr = "1.3.6.1.2.1.8888.1.1.6.1.16.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.$iface";
my $fcEntryDescr = "1.3.6.1.2.1.8888.1.1.6.1.16.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.$iface";
my $fcEntrySpeed = "1.3.6.1.2.1.8888.1.1.6.1.14.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.$iface";
my $fcEntryStatus = "1.3.6.1.2.1.8888.1.1.6.1.6.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.$iface";
my $fcEntryInOctets = "1.3.6.1.2.1.8888.1.3.1.1.6.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.$iface";
@@ -137,7 +137,7 @@ if ($ARGV[0] and $ARGV[0] eq "config")
print "send.cdef send,8,*\n";
print "send.max 4000000000\n";
print "send.warning $warn\n" if defined $warn;
exit 0;
exit 0;
}

my $status = 1;
@@ -58,7 +58,7 @@ elsif (!defined($host))
die "# Error: couldn't understand what I'm supposed to monitor.";
}

my $fcEntryDescr = "1.3.6.1.2.1.8888.1.1.6.1.16.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.$iface";
my $fcEntryDescr = "1.3.6.1.2.1.8888.1.1.6.1.16.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.$iface";
my $fcEntrySpeed = "1.3.6.1.2.1.8888.1.1.6.1.14.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.$iface";
my $fcEntryStatus = "1.3.6.1.2.1.8888.1.1.6.1.6.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.$iface";
my $fcEntryErrs = "1.3.6.1.2.1.8888.1.3.1.1.2.16.0.8.0.136.3.52.64.0.0.0.0.0.0.0.0.$iface";
@@ -99,7 +99,7 @@ if ($ARGV[0] and $ARGV[0] eq "config")
print "errs.type DERIVE\n";
print "errs.min 0\n";
print "errs.max 4000000000\n";
exit 0;
exit 0;
}

my $status = 1;
@@ -529,7 +529,7 @@ sub do_preprocess {
my @mediatypes = split(/[ ,]+/,$mediatypes);

# Hash of numerical media types the user finds interesting.
my $mediatype={};
my $mediatype={};

if ($mediatypes eq 'ALL') {
$mediatype = undef;
@@ -82,7 +82,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") {
print "host_name $host\n" unless $host eq 'localhost';
print <<"EOC";
graph_title Load average
graph_args --base 1000 -l 0
graph_args --base 1000 -l 0
graph_vlabel load
graph_category system
graph_info This graph shows the load average on the host. Load average is a rough way of estimating how hard the machine works. Optimally, a load average should be equal to or lower than the number of CPUs on the machine.
@@ -78,18 +78,18 @@ if (defined $ARGV[0] and $ARGV[0] eq "config")
# some devices reports negative memtotal value
print "# Total memsize reported $memsize..." if $Munin::Plugin::SNMP::DEBUG;

if ($memsize > 0)
if ($memsize > 0)
{
print "graph_args --base 1024 -l 0 --upper-limit $memsize\n";
print "graph_args --base 1024 -l 0 --upper-limit $memsize\n";
}
else
{
print "graph_args --base 1024 -l 0\n";
print "graph_args --base 1024 -l 0\n";
}

print "memory.draw AREA\n";
print "memory.label memory\n";

exit 0;
}

@@ -15,7 +15,7 @@ appliance with SNMP agent daemon activated. See na_snmp(8) for details.

Unfortunately, SNMPv3 is not fully supported on all NetApp equipments.
For this reason, this plugin will use SNMPv2 by default, which is
insecure because it doesn't encrypt the community string.
insecure because it doesn't encrypt the community string.

The following parameters will help you get this plugin working :

@@ -15,7 +15,7 @@ with SNMP agent daemon activated. See na_snmp(8) for details.

Unfortunately, SNMPv3 is not fully supported on all NetApp equipments.
For this reason, this plugin will use SNMPv2 by default, which is
insecure because it doesn't encrypt the community string.
insecure because it doesn't encrypt the community string.

The following parameters will help you get this plugin working :

@@ -35,7 +35,7 @@ detailed information on the graph page for the meaning of each state.

=head1 MIB INFORMATION

This plugin requires support for the TCP-MIB (RFC 4022). It reports
This plugin requires support for the TCP-MIB (RFC 4022). It reports
the contents of the tcpConnState column of tcpConnTable.

=head1 MAGIC MARKERS
@@ -3,15 +3,15 @@

=head1 NAME

snmp__print_supplies - SNMP plugin to monitor pages printed on
printers adhering to RFC1759.
snmp__print_supplies - SNMP plugin to monitor pages printed on
printers adhering to RFC1759.

=head1 APPLICABLE SYSTEMS

Any SNMP capable printer adhering to RFC1759. Using a command such
as "munin-node-configure --snmp xerox.skillingstad.no --snmpversion 2c
--snmpcommunity public | sh -x" should auto-detect all applicable
interfaces.
interfaces.

=head1 CONFIGURATION

@@ -21,7 +21,7 @@ configuration (shown here) will only work on insecure sites/devices:
[snmp_*]
env.version 2
env.community public

In general SNMP is not very secure at all unless you use SNMP version
3 which supports authentication and privacy (encryption). But in any
case the community string for your devices should not be "public".
@@ -33,13 +33,13 @@ information.

#%# family=snmpauto
#%# capabilities=snmpconf

=head1 VERSION

$Id: $

=head1 BUGS

For printers having duplex module: pages != number of sheets

=head1 AUTHOR
@@ -75,10 +75,10 @@ if(!defined ($session)) {

if(defined $ARGV[0] and $ARGV[0] eq "config") {
my ($host,undef,$version) = Munin::Plugin::SNMP->config_session();

print "host_name $host\n" unless $host eq 'localhost';
print "graph_title Pages
graph_args --base 1000 -l 0
graph_args --base 1000 -l 0
graph_vlabel Printed pages pr minute
graph_scale no
graph_category print
@@ -4,15 +4,15 @@

=head1 NAME

snmp__print_supplies - SNMP plugin to monitor supplies levels on
snmp__print_supplies - SNMP plugin to monitor supplies levels on
printers adhering to RFC1759

=head1 APPLICABLE SYSTEMS

Any SNMP capable printer adhering to RFC1759. Using a command such
as "munin-node-configure --snmp xerox.skillingstad.no --snmpversion 2c
--snmpcommunity public | sh -x" should auto-detect all applicable
interfaces.
interfaces.

=head1 CONFIGURATION

@@ -39,13 +39,13 @@ information.

#%# family=snmpauto
#%# capabilities=snmpconf

=head1 VERSION

$Id: $

=head1 BUGS

None known.

=head1 AUTHOR
@@ -77,7 +77,7 @@ if(defined $ARGV[0] and $ARGV[0] eq "snmpconf") {
}


my ($session, $error);
my ($session, $error);

# SNMP needed for both config and fetch.
$session = Munin::Plugin::SNMP->session();
@@ -94,25 +94,25 @@ if(!defined ($session)) {
# Configure
if(defined $ARGV[0] and $ARGV[0] eq "config") {
my ($host,undef,$version) = Munin::Plugin::SNMP->config_session();

print "host_name $host\n" unless $host eq 'localhost';
print "graph_title Supply Level\n";
print "graph_args --base 1000 -l 0 --upper-limit 100\n";
print "graph_vlabel %\n";
print "graph_scale no\n";
print "graph_category print\n";
print "graph_info This graph represents supplies level\n";

foreach my $supply (keys(%supplies)) {
print "supply$supply.label ".(length($supplies{$supply}{desc})<=$MAXLABEL ?
print "supply$supply.label ".(length($supplies{$supply}{desc})<=$MAXLABEL ?
$supplies{$supply}{desc} : substr($supplies{$supply}{desc},0,($MAXLABEL-3))."...");
print "\n";
print "supply$supply.draw LINE1\n";
print "supply$supply.info ".$supplies{$supply}{desc}."\n";
print "supply$supply.warning $warning:100\n";
print "supply$supply.critical $critical:100\n";
}

exit 0;
}

@@ -128,9 +128,9 @@ sub get_multiple {
my $session = shift;
my $oid = shift;
my $type = shift;

print "# Getting table $oid...\n" if $Munin::Plugin::SNMP::DEBUG;

my $response = $session->get_table($oid);

if(!defined($response)) {
@@ -81,7 +81,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") {
print "host_name $host\n" unless ($host eq 'localhost');
print <<'EOC';
graph_title Number of Processes
graph_args --base 1000 -l 0
graph_args --base 1000 -l 0
graph_vlabel number of processes
graph_category system
graph_info This graph shows the number of processes running on the system.
@@ -83,7 +83,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") {
print "host_name $host\n" unless $host eq 'localhost';
print <<"EOC";
graph_title Number of RDP users
graph_args --base 1000 -l 0
graph_args --base 1000 -l 0
graph_vlabel number of RDP users
graph_scale no
graph_category system
@@ -98,7 +98,7 @@ EOM
print 'graph_order ', join(' ', map { get_id($_) } oid_lex_sort keys %$fans), "\n";
print 'host_name ', $session->hostname(), "\n"
unless $session->hostname eq 'localhost';

for my $fan (keys %$fans) {
my $id = get_id($fan);
for my $key (qw(label warning)) {
@@ -117,7 +117,7 @@ EOM
print 'graph_order ', join(' ', map { get_id($_) } oid_lex_sort keys %$temps), "\n";
print 'host_name ', $session->hostname(), "\n"
unless $session->hostname eq 'localhost';

for my $sensor (keys %$temps) {
my $id = get_id($sensor);
for my $key (qw(label warning critical info)) {
@@ -93,7 +93,7 @@ EOM
print 'graph_order ', join(' ', map { get_id($_) } oid_lex_sort keys %$fans), "\n";
print 'host_name ', $session->hostname(), "\n"
unless $session->hostname eq 'localhost';

for my $fan (keys %$fans) {
my $id = get_id($fan);
for my $key (qw(label info)) {
@@ -95,7 +95,7 @@ EOM
print 'graph_order ', join(' ', map { get_id($_) } oid_lex_sort keys %$temps), "\n";
print 'host_name ', $session->hostname(), "\n"
unless $session->hostname eq 'localhost';

for my $sensor (keys %$temps) {
my $id = get_id($sensor);
for my $key (qw(label warning critical info)) {
@@ -33,9 +33,9 @@ use Munin::Plugin::SNMP;
my $response;

if (defined $ARGV[0] and $ARGV[0] eq "snmpconf") {
# HOST-RESOURCES-MIB::hrStorageType
# HOST-RESOURCES-MIB::hrStorageType
# HOST-RESOURCES-TYPES::hrStorageVirtualMemory
print "require 1.3.6.1.2.1.25.2.3.1.2. 1.3.6.1.2.1.25.2.1.3\n";
print "require 1.3.6.1.2.1.25.2.3.1.2. 1.3.6.1.2.1.25.2.1.3\n";
exit 0;
}

@@ -80,7 +80,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") {
print "host_name $host\n" unless $host eq 'localhost';
print <<"EOC";
graph_title Number of users
graph_args --base 1000 -l 0
graph_args --base 1000 -l 0
graph_vlabel number of users
graph_scale no
graph_category system
@@ -94,4 +94,3 @@ EOC

my $session = Munin::Plugin::SNMP->session();
print "users.value ", $session->get_single('1.3.6.1.2.1.25.1.5.0'), "\n";

@@ -38,7 +38,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") {
my ($host) = Munin::Plugin::SNMP->config_session();
print "host_name $host\n" unless $host eq 'localhost';
print "graph_title Windows CPU load
graph_args --base 1000 -l 0
graph_args --base 1000 -l 0
graph_vlabel Load
graph_scale no
graph_category System
@@ -5,7 +5,7 @@

=head1 NAME

snort_pattmatch - Plugin to monitor percent of data received that
snort_pattmatch - Plugin to monitor percent of data received that
Snort processes in pattern matching.

=head1 CONFIGURATION
@@ -5,7 +5,7 @@

=head1 NAME

snort_pktsec - Plugin to monitor the number of packets per second
snort_pktsec - Plugin to monitor the number of packets per second
passed through Snort filters

=head1 CONFIGURATION
@@ -128,25 +128,25 @@ open (OUT, ">$statefile") or exit 4;
print OUT "$pos:$ham:$spam\n";
close OUT;

sub parselogfile
{
sub parselogfile
{
my ($fname, $start, $stop) = @_;
open (LOGFILE, $fname) or exit 3;
seek (LOGFILE, $start, 0) or exit 2;

while (tell (LOGFILE) < $stop)
while (tell (LOGFILE) < $stop)
{
my $line =<LOGFILE>;
chomp ($line);

if ($line =~ m/clean message/)
if ($line =~ m/clean message/)
{
$ham++;
}
}
elsif ($line =~ m/identified spam/)
{
$spam++;
}
}
close(LOGFILE);
close(LOGFILE);
}
@@ -92,7 +92,7 @@ sub autoconf {
"Accept: */*\r\n" .
&make_auth_header($user, $passwd) .
"\r\n";

$cachemgr->syswrite($request, length($request));
my @lines = $cachemgr->getlines();

@@ -120,13 +120,13 @@ sub query_squid {
PeerPort => $port,
Proto => 'tcp') or die($!);



my $request = "GET cache_object://$host/storedir HTTP/1.0\r\n" .
"Accept: */*\r\n" .
&make_auth_header($user, $passwd) .
"\r\n";

$cachemgr->syswrite($request, length($request));
my @lines = $cachemgr->getlines();
my %outs = ('Maximum' => 0, 'Current' => 0);
@@ -101,7 +101,7 @@ sub autoconf {
"Accept: */*\r\n" .
&make_auth_header($user, $passwd) .
"\r\n";

$cachemgr->syswrite($request, length($request));
my @lines = $cachemgr->getlines();

@@ -130,13 +130,13 @@ sub query_squid {
PeerPort => $port,
Proto => 'tcp') or die($!);



my $request = "GET cache_object://$host/server_list HTTP/1.0\r\n" .
"Accept: */*\r\n" .
&make_auth_header($user, $passwd) .
"\r\n";

$cachemgr->syswrite($request, length($request));
my @lines = $cachemgr->getlines();
my $id = "";
@@ -73,27 +73,27 @@ sub autoconf {
my $cachemgr = IO::Socket::INET->new (PeerAddr => $host,
PeerPort => $port,
Proto => 'tcp');

if (!$cachemgr) {
print "no (could not connect: $!)\n";
exit 0;
}

my $request = "GET cache_object://$host/info HTTP/1.0\r\n" .
"Accept: */*\r\n" .
&make_auth_header ($user, $passwd) .
"\r\n";

$cachemgr->syswrite ($request, length($request));
my @lines = $cachemgr->getlines();

print "yes\n";
exit 0;
}

sub make_auth_header {
my ($user, $passwd) = @_;

if (!defined $passwd || $passwd eq "") {
return "";
} else {
@@ -108,12 +108,12 @@ sub query_squid {
my $cachemgr = IO::Socket::INET->new (PeerAddr => $host,
PeerPort => $port,
Proto => 'tcp') or die($!);

my $request = "GET cache_object://$host/info HTTP/1.0\r\n" .
"Accept: */*\r\n" .
&make_auth_header ($user, $passwd) .
"\r\n";

$cachemgr->syswrite ($request, length($request));
my @lines = grep (/Mean Object Size/, $cachemgr->getlines());
my $line = pop @lines;
@@ -86,7 +86,7 @@ sub autoconf {
"Accept: */*\r\n" .
&make_auth_header($user, $passwd) .
"\r\n";

$cachemgr->syswrite($request, length($request));
my @lines = $cachemgr->getlines();

@@ -114,13 +114,13 @@ sub query_squid {
PeerPort => $port,
Proto => 'tcp') or die($!);



my $request = "GET cache_object://$host/counters HTTP/1.0\r\n" .
"Accept: */*\r\n" .
&make_auth_header($user, $passwd) .
"\r\n";

$cachemgr->syswrite($request, length($request));
my @lines = $cachemgr->getlines();
for(my $i = 0; $i <= $#lines; $i++) {
@@ -87,7 +87,7 @@ sub autoconf {
"Accept: */*\r\n" .
&make_auth_header($user, $passwd) .
"\r\n";

$cachemgr->syswrite($request, length($request));
my @lines = $cachemgr->getlines();

@@ -116,13 +116,13 @@ sub query_squid {
PeerPort => $port,
Proto => 'tcp') or die($!);



my $request = "GET cache_object://$host/counters HTTP/1.0\r\n" .
"Accept: */*\r\n" .
&make_auth_header($user, $passwd) .
"\r\n";

$cachemgr->syswrite($request, length($request));
my @lines = $cachemgr->getlines();
for(my $i = 0; $i <= $#lines; $i++) {
@@ -148,10 +148,10 @@ if($ARGV[0] and $ARGV[0] eq "config") {
print "kbytes_out.type DERIVE\n";
print "kbytes_out.min 0\n";
print "kbytes_out.max 500000\n";
print "hit_kbytes_out.label from cache\n";
print "hit_kbytes_out.label from cache\n";
print "hit_kbytes_out.cdef hit_kbytes_out,8096,*\n";
print "hit_kbytes_out.type DERIVE\n";
print "hit_kbytes_out.min 0\n";
print "hit_kbytes_out.type DERIVE\n";
print "hit_kbytes_out.min 0\n";
print "hit_kbytes_out.max 500000\n";
exit 0;
}
@@ -67,7 +67,7 @@ if ($ARGV[0] eq "autoconf")
exit 0;
}

if (!$dbh)
if (!$dbh)
{
die "Could not run DBI::connect\n";
}
@@ -11,7 +11,7 @@ Tomcat 5.0 or higher with the default tomcat manager webapp.

=head1 USAGE

Needs access to http://<user>:<password>@localhost:8080/manager/status?XML=true (or modify the address for another host).
Needs access to http://<user>:<password>@localhost:8080/manager/status?XML=true (or modify the address for another host).

A munin-user in $CATALINA_HOME/conf/tomcat-users.xml should be set up for this to work.

@@ -45,11 +45,11 @@ Override default status-url

=item user

Manager username
Manager username

=item password

Manager password
Manager password

=item connector

@@ -36,7 +36,7 @@ Manager password

=head1 USAGE

Needs access to http://<user>:<password>@localhost:8080/manager/status?XML=true (or modify the address for another host).
Needs access to http://<user>:<password>@localhost:8080/manager/status?XML=true (or modify the address for another host).

Tomcat 5.0 or higher.

@@ -122,13 +122,13 @@ my $xs = new XML::Simple;
my $response = $ua->request(HTTP::Request->new('GET',$url));
my $xml = $xs->XMLin($response->content);

if($xml->{'jvm'}->{'memory'}->{'free'} &&
if($xml->{'jvm'}->{'memory'}->{'free'} &&
$xml->{'jvm'}->{'memory'}->{'total'} &&
$xml->{'jvm'}->{'memory'}->{'max'}) {
print "free.value " . $xml->{'jvm'}->{'memory'}->{'free'} . "\n";
print "used.value " .
($xml->{'jvm'}->{'memory'}->{'total'} -
$xml->{'jvm'}->{'memory'}->{'free'}) . "\n";
print "used.value " .
($xml->{'jvm'}->{'memory'}->{'total'} -
$xml->{'jvm'}->{'memory'}->{'free'}) . "\n";
print "max.value " . $xml->{'jvm'}->{'memory'}->{'max'} . "\n";
} else {
print "free.value U\n";
@@ -68,7 +68,7 @@ redistribute it and/or modify it under the terms of the GNU General
Public License as published by the Free Software Foundation; version 2
dated June, 1991.

=head1 VERSION
=head1 VERSION

$Id$

@@ -892,7 +892,7 @@ foreach my $field ( @$tmpfield )
my @csvfields = $csv->fields();
my $csvindex = 0; $csvindex++ until $csvindex > $#csvfields or $csvfields[$csvindex] eq $field->{'csvfield'};
if ($csvindex > $#csvfields) { $error = 1; goto FIELDERR; }

my $csvindex2;
if (exists $field->{'csvfield2'})
{
@@ -43,7 +43,7 @@ get_warning () {
}


# Usage:
# Usage:
# warning=${warning:-92}
# print_warning "$name"

@@ -88,7 +88,7 @@ print_critical () {
# the threshold string adjusted for percentages if percent sizes are present.
# If not, the threshold is left unchanged.
# Usage:
# adjust_threshold "50%:50%" 200
# adjust_threshold "50%:50%" 200
# Returns:
# 100:100
#
@@ -319,7 +319,7 @@ use_ok('Munin::Plugin::SNMP');
eval { Munin::Plugin::SNMP->session(); };
like($@, qr/./, 'Unknown SNMP version causes an exception.');
}

# Unable to create session
{
no warnings;
@@ -50,13 +50,13 @@ sub check_munindoc
# FIXME: check for POD errors?

my @headings;

foreach my $section (@$root) {
# ignore any inapplicable headings
next unless 'ARRAY' eq ref $section;
next unless $section->[0] eq 'head1';
next unless grep { $_ eq $section->[2] } @sections;

push @headings, $section->[2];
}