mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Plugin-Gallery: Get better 2nd level headings
Review of category "system"
This commit is contained in:
parent
54a91c13a4
commit
7fdb4741fe
27 changed files with 18 additions and 12 deletions
|
@ -106,7 +106,7 @@ $oid = $ENV{snmp_oid} || $defaults{oid};
|
|||
%known_oids = ('1.3.6.1.2.1.43.10.2.1.4.1.1' =>
|
||||
{ title => 'Pages',
|
||||
vlabel => 'Printed pages',
|
||||
category => 'Printer',
|
||||
category => 'printing',
|
||||
info => 'Returns the total number of printed pages per defined printer',
|
||||
total => 'Total',
|
||||
units => 'pages'
|
||||
|
@ -114,7 +114,7 @@ $oid = $ENV{snmp_oid} || $defaults{oid};
|
|||
'1.3.6.1.2.1.43.11.1.1.8.1.1' =>
|
||||
{ title => 'Total projected capacity of this cartridge',
|
||||
vlabel => 'Total capacity',
|
||||
category => 'Printer',
|
||||
category => 'printing',
|
||||
info => 'Returns the total projected capacity (in pages) of '.
|
||||
'the currently installed cartridge',
|
||||
total => 'Total',
|
||||
|
@ -123,7 +123,7 @@ $oid = $ENV{snmp_oid} || $defaults{oid};
|
|||
'1.3.6.1.2.1.43.11.1.1.9.1.1' =>
|
||||
{ title => 'Pages printed with this cartridge',
|
||||
vlabel => 'Printed pages',
|
||||
category => 'Printer',
|
||||
category => 'printing',
|
||||
info => 'Returns the total number of printed pages per ' .
|
||||
'defined printer with the current cartridge',
|
||||
total => 'Total',
|
||||
|
@ -239,3 +239,6 @@ sub host_label_for {
|
|||
$addr =~ s/\./_/g; # Periods not allowed in variable names
|
||||
return $addr;
|
||||
}
|
||||
|
||||
# for Munin Plugin Gallery
|
||||
# graph_category printing
|
||||
|
|
|
@ -1,180 +0,0 @@
|
|||
#!/usr/bin/perl -w
|
||||
#
|
||||
# File: snmp__gwia_bytes__
|
||||
# Copyright (C) 2007 Gabriele Pohl
|
||||
#
|
||||
# Derived from plugin snmp__load
|
||||
# Copyright (C) 2004 Jimmy Olsen, Dagfinn Ilmari Mannsaaker
|
||||
#
|
||||
# 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; version 2 dated June,
|
||||
# 1991.
|
||||
#
|
||||
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# ------------------------------------------------------------
|
||||
# Plugin to monitor Novell Groupwise Internet Agent (GWIA)
|
||||
# ------------------------------------------------------------
|
||||
#
|
||||
# Management Information Base (MIB) GWIAMIB
|
||||
#
|
||||
# Naming Tree: 1.3.6.1.4.1.23
|
||||
# iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) novell(23)
|
||||
#
|
||||
# To see all values available for your GWIA, type
|
||||
# snmpwalk -v1 -c public -m GWIAMIB <HOST> gwia
|
||||
#
|
||||
# This plugin fetches:
|
||||
#
|
||||
# * gwiaGatewayName - 1.3.6.1.4.1.23.2.70.1.1.
|
||||
# * gwiaStatBytesIn - 1.3.6.1.4.1.23.2.70.1.6.
|
||||
# * gwiaStatBytesOut - 1.3.6.1.4.1.23.2.70.1.5.
|
||||
#
|
||||
# Usage:
|
||||
# --------------
|
||||
# Link this file snmp__gwia_bytes_ to your nodes servicedir [/etc/munin/plugins]
|
||||
#
|
||||
# as:
|
||||
# snmp_<host>_gwia_bytes_<pos>
|
||||
#
|
||||
# with:
|
||||
# <host> = Name or IP-Number of host
|
||||
# <pos> = table index of the GWIA Object
|
||||
#
|
||||
# E.g.
|
||||
# ln -s /usr/share/munin/plugins/snmp__gwia_bytes_ \
|
||||
# /etc/munin/plugins/snmp_foo.example.com_gwia_bytes_0
|
||||
# ...will monitor a single GWIA object on host foo.example.com.
|
||||
#
|
||||
# Parameters
|
||||
# community - Specify wich community string to use (Default: public)
|
||||
# port - Specify which port to read from (Default: 161)
|
||||
# host - Specify which host to monitor (Default: Read from link in servicedir)
|
||||
# pos - Specify which table Object to read (Default: Read from link in servicedir,
|
||||
#
|
||||
# You may adjust settings to your need via configuration in plugin-conf.d/munin-node:
|
||||
# [snmp_*_gwia_bytes_*]
|
||||
# env.port <your_port_number>
|
||||
# env.community <your SNMP community string>
|
||||
# env.pos <your objects table position. Values: 0,1,2,..>
|
||||
# env.host <name or IP of your host>
|
||||
#
|
||||
# Parameters can also be specified on a per GWIA basis, eg:
|
||||
# [snmp_example.com_gwia_bytes_1]
|
||||
# env.port 166
|
||||
# env.community example
|
||||
#
|
||||
# $Log$
|
||||
# Revision 1.0 2007/09/06 16:49 gap
|
||||
# Created by gap
|
||||
#
|
||||
#%# family=snmpauto
|
||||
#%# capabilities=snmpconf
|
||||
|
||||
use strict;
|
||||
use Net::SNMP;
|
||||
|
||||
my $DEBUG = 0;
|
||||
|
||||
my $host = $ENV{host} || undef;
|
||||
my $port = $ENV{port} || 161;
|
||||
my $community = $ENV{community} || "public";
|
||||
my $pos = $ENV{pos} || 0;
|
||||
|
||||
my $response;
|
||||
|
||||
my $GRAPH_PERIOD = "minute";
|
||||
my $GRAPH_VLABEL = "bytes per $GRAPH_PERIOD in(-) / out(+)";
|
||||
my $BYTES_LABEL='Bytes';
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "snmpconf")
|
||||
{
|
||||
print "require 1.3.6.1.4.1.23.2.70.1.1. [.*]\n"; # gwiaGatewayName
|
||||
print "require 1.3.6.1.4.1.23.2.70.1.6. [\\d*]\n"; # gwiaStatBytesIn
|
||||
print "require 1.3.6.1.4.1.23.2.70.1.5. [\\d*]\n"; # gwiaStatBytesOut
|
||||
|
||||
exit 0;
|
||||
}
|
||||
|
||||
if ($0 =~ /^(?:|.*\/)snmp_([^_]+)_gwia_bytes_(\d+)*$/)
|
||||
{
|
||||
$host = $1;
|
||||
$pos = $2;
|
||||
}
|
||||
elsif (!defined($host))
|
||||
{
|
||||
print "# Debug: $0 -- $1\n" if $DEBUG;
|
||||
die "# Error: couldn't understand what I'm supposed to monitor.";
|
||||
}
|
||||
|
||||
my ($session, $error) = Net::SNMP->session(
|
||||
-hostname => $host,
|
||||
-community => $community,
|
||||
-port => $port
|
||||
);
|
||||
|
||||
if (!defined ($session))
|
||||
{
|
||||
die "Croaking: $error";
|
||||
}
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "config")
|
||||
{
|
||||
|
||||
# get name of Internet Agent
|
||||
my $gwname = &get_single ($session, "1.3.6.1.4.1.23.2.70.1.1.$pos"); # gwiaGatewayName
|
||||
# output to munin
|
||||
print "host_name $host
|
||||
graph_category mail
|
||||
graph_args --base 1000
|
||||
graph_period $GRAPH_PERIOD
|
||||
graph_title GWIA byte load ($gwname)
|
||||
graph_info Shows per minute activity of the Groupwise Internet Agent (GWIA), here: $gwname.<br />Outgoing data will be reported as positive value, incoming as negative value.<br />The plugin fetches the following values (GWIAMIB):<br />gwiaStatBytesOut - Size of outgoing messages in bytes.<br />gwiaStatBytesIn - Size of incoming messages in bytes.
|
||||
graph_vlabel $GRAPH_VLABEL
|
||||
bytes_in.label $BYTES_LABEL
|
||||
bytes_in.info gwiaStatBytesIn (1.3.6.1.4.1.23.2.70.1.6.)
|
||||
bytes_in.type DERIVE
|
||||
bytes_in.min 0
|
||||
bytes_in.draw AREA
|
||||
bytes_in.graph no
|
||||
bytes_out.label $BYTES_LABEL
|
||||
bytes_out.info gwiaStatBytesOut (1.3.1.4.1.23.2.70.1.5.)
|
||||
bytes_out.type DERIVE
|
||||
bytes_out.min 0
|
||||
bytes_out.draw AREA
|
||||
bytes_out.negative bytes_in";
|
||||
|
||||
exit 0;
|
||||
}
|
||||
# fetch the data and print
|
||||
print "bytes_in.value ", &get_single ($session, "1.3.6.1.4.1.23.2.70.1.6.$pos"), "\n"; # gwiaStatBytesIn
|
||||
print "bytes_out.value ", &get_single ($session, "1.3.6.1.4.1.23.2.70.1.5.$pos"), "\n"; # gwiaStatBytesOut
|
||||
|
||||
|
||||
sub get_single
|
||||
{
|
||||
my $handle = shift;
|
||||
my $oid = shift;
|
||||
|
||||
print "# Getting single $oid...\n" if $DEBUG;
|
||||
|
||||
$response = $handle->get_request ($oid);
|
||||
|
||||
if (!defined $response->{$oid})
|
||||
{
|
||||
return undef;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $response->{$oid};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,225 +0,0 @@
|
|||
#!/usr/bin/perl -w
|
||||
#
|
||||
# File: snmp__gwia_msgs__
|
||||
# Copyright (C) 2007 Gabriele Pohl (contact@dipohl.de)
|
||||
#
|
||||
# Derived from plugin snmp__load
|
||||
# Copyright (C) 2004 Jimmy Olsen, Dagfinn Ilmari Mannsaaker
|
||||
#
|
||||
# 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; version 2 dated June,
|
||||
# 1991.
|
||||
#
|
||||
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# ------------------------------------------------------------
|
||||
# Plugin to monitor Novell Groupwise Internet Agent (GWIA)
|
||||
# ------------------------------------------------------------
|
||||
#
|
||||
# Management Information Base (MIB) GWIAMIB
|
||||
#
|
||||
# Naming Tree: 1.3.6.1.4.1.23
|
||||
# iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) novell(23)
|
||||
#
|
||||
# To see all values available for your GWIA, type
|
||||
# snmpwalk -v1 -c public -m GWIAMIB <HOST> gwia
|
||||
#
|
||||
# This plugin fetches:
|
||||
#
|
||||
# * gwiaGatewayName - 1.3.6.1.4.1.23.2.70.1.1.
|
||||
# * gwiaStatMsgsOut - 1.3.6.1.4.1.23.2.70.1.7.
|
||||
# * gwiaStatMsgsIn - 1.3.6.1.4.1.23.2.70.1.8.
|
||||
# * gwiaStatStatusesOut - 1.3.6.1.4.1.23.2.70.1.9.
|
||||
# * gwiaStatStatusesIn - 1.3.6.1.4.1.23.2.70.1.10.
|
||||
# * gwiaStatErrorsOut - 1.3.6.1.4.1.23.2.70.1.11.
|
||||
# * gwiaStatErrorsIn - 1.3.6.1.4.1.23.2.70.1.12.
|
||||
#
|
||||
# Usage:
|
||||
# --------------
|
||||
# Link this file snmp__gwia_msgs_ to your nodes servicedir [/etc/munin/plugins]
|
||||
#
|
||||
# as:
|
||||
# snmp_<host>_gwia_msgs_<pos>
|
||||
#
|
||||
# with:
|
||||
# <host> = Name or IP-Number of host
|
||||
# <pos> = table index of the GWIA Object
|
||||
#
|
||||
# E.g.
|
||||
# ln -s /usr/share/munin/plugins/snmp__gwia_msgs_ \
|
||||
# /etc/munin/plugins/snmp_foo.example.com_gwia_msgs_0
|
||||
# ...will monitor a single GWIA object on host foo.example.com.
|
||||
#
|
||||
# Parameters
|
||||
# community - Specify wich community string to use (Default: public)
|
||||
# port - Specify which port to read from (Default: 161)
|
||||
# host - Specify which host to monitor (Default: Read from link in servicedir)
|
||||
# pos - Specify which table Object to read (Default: Read from link in servicedir,
|
||||
#
|
||||
# You may adjust settings to your need via configuration in plugin-conf.d/munin-node:
|
||||
# [snmp_*_gwia_msgs_*]
|
||||
# env.port <your_port_number>
|
||||
# env.community <your SNMP community string>
|
||||
# env.pos <your objects table position. Values: 0,1,2,..>
|
||||
# env.host <name or IP of your host>
|
||||
#
|
||||
# Parameters can also be specified on a per GWIA basis, eg:
|
||||
# [snmp_foo.example.com_gwia_msgs_1]
|
||||
# env.port 166
|
||||
# env.community example
|
||||
#
|
||||
# $Log$
|
||||
# Revision 1.0 2007/09/08 16:08 gap
|
||||
# Created by gap
|
||||
#
|
||||
#%# family=snmpauto
|
||||
#%# capabilities=snmpconf
|
||||
|
||||
use strict;
|
||||
use Net::SNMP;
|
||||
|
||||
my $DEBUG = 0;
|
||||
|
||||
my $host = $ENV{host} || undef;
|
||||
my $port = $ENV{port} || 161;
|
||||
my $community = $ENV{community} || "public";
|
||||
my $pos = $ENV{pos} || 0;
|
||||
|
||||
my $response;
|
||||
|
||||
# fix values
|
||||
my $GRAPH_PERIOD = "minute";
|
||||
my $GRAPH_VLABEL = "messages per $GRAPH_PERIOD in(-) / out(+)";
|
||||
my $MSGS_LABEL='Messages';
|
||||
my $STATS_LABEL='Status-Msgs';
|
||||
my $ERRORS_LABEL='Errors';
|
||||
my $ERRORS_CRITICAL=10;
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "snmpconf")
|
||||
{
|
||||
print "require 1.3.6.1.4.1.23.2.70.1.1. [.*]\n"; # gwiaGatewayName
|
||||
print "require 1.3.6.1.4.1.23.2.70.1.7. [\\d*]\n"; # gwiaStatMsgsOut
|
||||
print "require 1.3.6.1.4.1.23.2.70.1.8. [\\d*]\n"; # gwiaStatMsgsIn
|
||||
print "require 1.3.6.1.4.1.23.2.70.1.11. [\\d*]\n"; # gwiaStatErrorsOut
|
||||
print "require 1.3.6.1.4.1.23.2.70.1.12. [\\d*]\n"; # gwiaStatErrorsIn
|
||||
print "require 1.3.6.1.4.1.23.2.70.1.9. [\\d*]\n"; # gwiaStatStatusesOut
|
||||
print "require 1.3.6.1.4.1.23.2.70.1.10. [\\d*]\n"; # gwiaStatStatusesIn
|
||||
|
||||
exit 0;
|
||||
}
|
||||
|
||||
if ($0 =~ /^(?:|.*\/)snmp_([^_]+)_gwia_msgs_(\d+)*$/)
|
||||
{
|
||||
$host = $1;
|
||||
$pos = $2;
|
||||
}
|
||||
elsif (!defined($host))
|
||||
{
|
||||
print "# Debug: $0 -- $1\n" if $DEBUG;
|
||||
die "# Error: couldn't understand what I'm supposed to monitor.";
|
||||
}
|
||||
|
||||
my ($session, $error) = Net::SNMP->session(
|
||||
-hostname => $host,
|
||||
-community => $community,
|
||||
-port => $port
|
||||
);
|
||||
|
||||
if (!defined ($session))
|
||||
{
|
||||
die "Croaking: $error";
|
||||
}
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "config")
|
||||
{
|
||||
|
||||
# get name of Internet Agent
|
||||
my $gwname = &get_single ($session, "1.3.6.1.4.1.23.2.70.1.1.$pos"); # gwiaGatewayName
|
||||
|
||||
# output to munin
|
||||
print "host_name $host
|
||||
graph_category mail
|
||||
graph_args --base 1000
|
||||
graph_period $GRAPH_PERIOD
|
||||
graph_title GWIA msg load ($gwname)
|
||||
graph_info Shows per minute activity of the Groupwise Internet Agent (GWIA), here: $gwname.<br />Outgoing data will be reported as positive value, incoming as negative value.
|
||||
graph_vlabel $GRAPH_VLABEL
|
||||
msgs_in.label $MSGS_LABEL
|
||||
msgs_in.info gwiaStatMsgsIn (1.3.6.1.4.1.23.2.70.1.8.)
|
||||
msgs_in.type DERIVE
|
||||
msgs_in.min 0
|
||||
msgs_in.draw AREA
|
||||
msgs_in.graph no
|
||||
msgs_out.label $MSGS_LABEL
|
||||
msgs_out.info gwiaStatMsgsOut (1.3.6.1.4.1.23.2.70.1.7.)
|
||||
msgs_out.type DERIVE
|
||||
msgs_out.min 0
|
||||
msgs_out.draw AREA
|
||||
msgs_out.negative msgs_in
|
||||
msgs_out.graph yes
|
||||
stats_in.label $STATS_LABEL
|
||||
stats_in.info gwiaStatStatusesIn (1.3.6.1.4.1.23.2.70.1.10.)
|
||||
stats_in.type DERIVE
|
||||
stats_in.min 0
|
||||
stats_in.draw LINE1
|
||||
stats_in.graph no
|
||||
stats_out.label $STATS_LABEL
|
||||
stats_out.info gwiaStatStatusesOut (1.3.6.1.4.1.23.2.70.1.9.)
|
||||
stats_out.type DERIVE
|
||||
stats_out.min 0
|
||||
stats_out.draw LINE1
|
||||
stats_out.negative stats_in
|
||||
stats_out.graph yes
|
||||
errors_in.label $ERRORS_LABEL
|
||||
errors_in.info gwiaStatErrorsIn (1.3.6.1.4.1.23.2.70.1.12.)
|
||||
errors_in.critical $ERRORS_CRITICAL
|
||||
errors_in.type DERIVE
|
||||
errors_in.min 0
|
||||
errors_in.draw LINE1
|
||||
errors_in.graph no
|
||||
errors_out.label $ERRORS_LABEL
|
||||
errors_out.info gwiaStatErrorsOut (1.3.6.1.4.1.23.2.70.1.11.)
|
||||
errors_out.critical $ERRORS_CRITICAL
|
||||
errors_out.type DERIVE
|
||||
errors_out.negative errors_in
|
||||
errors_out.min 0
|
||||
errors_out.draw LINE1
|
||||
errors_out.graph yes";
|
||||
|
||||
exit 0;
|
||||
}
|
||||
# fetch the data and print
|
||||
print "msgs_in.value ", &get_single ($session, "1.3.6.1.4.1.23.2.70.1.8.$pos"), "\n"; # gwiaStatMsgsIn
|
||||
print "msgs_out.value ", &get_single ($session, "1.3.6.1.4.1.23.2.70.1.7.$pos"), "\n"; # gwiaStatMsgsOut
|
||||
print "stats_in.value ", &get_single ($session, "1.3.6.1.4.1.23.2.70.1.10.$pos"), "\n"; # gwiaStatStatusesIn
|
||||
print "stats_out.value ", &get_single ($session, "1.3.6.1.4.1.23.2.70.1.9.$pos"), "\n"; # gwiaStatStatusesOut
|
||||
print "errors_in.value ", &get_single ($session, "1.3.6.1.4.1.23.2.70.1.12.$pos"), "\n"; # gwiaStatErrorsIn
|
||||
print "errors_out.value ", &get_single ($session, "1.3.6.1.4.1.23.2.70.1.11.$pos"), "\n"; # gwiaStatErrorsOut
|
||||
|
||||
sub get_single
|
||||
{
|
||||
my $handle = shift;
|
||||
my $oid = shift;
|
||||
|
||||
print "# Getting single $oid...\n" if $DEBUG;
|
||||
|
||||
$response = $handle->get_request ($oid);
|
||||
|
||||
if (!defined $response->{$oid})
|
||||
{
|
||||
return undef;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $response->{$oid};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,199 +0,0 @@
|
|||
#!/usr/bin/perl -w
|
||||
#
|
||||
# File: snmp__gwmta_msgs_
|
||||
# Copyright (C) 2007 Gabriele Pohl (contact@dipohl.de)
|
||||
#
|
||||
# Derived from plugin snmp__load
|
||||
# Copyright (C) 2004 Jimmy Olsen, Dagfinn Ilmari Mannsaaker
|
||||
#
|
||||
# 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; version 2 dated June,
|
||||
# 1991.
|
||||
#
|
||||
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# ------------------------------------------------------------
|
||||
# Plugin to monitor Novell Groupwise MTA (GWMTA)
|
||||
# ------------------------------------------------------------
|
||||
#
|
||||
# Management Information Base (MIB) GWMTA-MIB
|
||||
#
|
||||
# Naming Tree: 1.3.6.1.4.1.23
|
||||
# iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) novell(23)
|
||||
#
|
||||
# To see all values available for your GWMTA, type
|
||||
# snmpwalk -v1 -c public -m GWMTA-MIB <HOST> gwmta
|
||||
#
|
||||
# This plugin fetches:
|
||||
#
|
||||
# * mtaDomainName 1.3.6.1.4.1.23.2.37.1.1.1.2.
|
||||
# * mtaTenMinuteRoutedMsgs - 1.3.6.1.4.1.23.2.37.1.1.1.10.
|
||||
# * mtaTenMinuteUndeliverableMsgs - 1.3.6.1.4.1.23.2.37.1.1.1.12.
|
||||
# * mtaTenMinuteErrorMsgs - 1.3.6.1.4.1.23.2.37.1.1.1.14.
|
||||
#
|
||||
# Usage:
|
||||
# --------------
|
||||
# Link this file snmp__gwmta_msgs_ to your nodes servicedir [/etc/munin/plugins]
|
||||
#
|
||||
# as:
|
||||
# snmp_<host>_gwmta_msgs_<pos>
|
||||
#
|
||||
# with:
|
||||
# <host> = Name or IP-Number of host
|
||||
# <pos> = table index of the GWMTA Object
|
||||
#
|
||||
# E.g.
|
||||
# ln -s /usr/share/munin/plugins/snmp__gwmta_msgs_ \
|
||||
# /etc/munin/plugins/snmp_foo.example.com_gwmta_msgs_0
|
||||
# ...will monitor a single GWMTA object on host foo.example.com.
|
||||
#
|
||||
# Parameters
|
||||
# community - Specify wich community string to use (Default: public)
|
||||
# port - Specify which port to read from (Default: 161)
|
||||
# host - Specify which host to monitor (Default: Read from link in servicedir)
|
||||
# pos - Specify which table Object to read (Default: Read from link in servicedir,
|
||||
#
|
||||
# You may adjust settings to your need via configuration in plugin-conf.d/munin-node:
|
||||
# [snmp_*_gwmta_msgs_*]
|
||||
# env.port <your_port_number>
|
||||
# env.community <your SNMP community string>
|
||||
# env.pos <your objects table position. Values: 0,1,2,..>
|
||||
# env.host <name or IP of your host>
|
||||
#
|
||||
# Parameters can also be specified on a per GWMTA basis, eg:
|
||||
# [snmp_example.com_gwmta_msgs_1]
|
||||
# env.port 166
|
||||
# env.community example
|
||||
#
|
||||
# $Log$
|
||||
# Revision 1.0 2007/09/08 19:44 gap
|
||||
# Created by gap
|
||||
#
|
||||
#%# family=snmpauto
|
||||
#%# capabilities=snmpconf
|
||||
|
||||
use strict;
|
||||
use Net::SNMP;
|
||||
|
||||
my $DEBUG = 0;
|
||||
|
||||
my $host = $ENV{host} || undef;
|
||||
my $port = $ENV{port} || 161;
|
||||
my $community = $ENV{community} || "public";
|
||||
my $pos = $ENV{pos} || 1;
|
||||
|
||||
my $response;
|
||||
|
||||
# fix values
|
||||
my $GRAPH_PERIOD = "minute";
|
||||
my $GRAPH_VLABEL = "number of messages / 10 min";
|
||||
my $ROUTED_LABEL="Routed";
|
||||
my $ROUTED_CRITICAL=500;
|
||||
my $UNDELIVERED_LABEL="Undeliverable";
|
||||
my $UNDELIVERED_CRITICAL=10;
|
||||
my $ERRORS_LABEL="Errors";
|
||||
my $ERRORS_CRITICAL=10;
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "snmpconf")
|
||||
{
|
||||
print "index 1.3.6.1.4.1.23.2.37.1.1.1.1.\n"; # mtaIndex
|
||||
print "require 1.3.6.1.4.1.23.2.37.1.1.1.2. \n"; # mtaDomainName
|
||||
print "require 1.3.6.1.4.1.23.2.37.1.1.1.10. [\\d+]\n"; # mtaTenMinuteRoutedMsgs
|
||||
print "require 1.3.6.1.4.1.23.2.37.1.1.1.12. [\\d+]\n"; # mtaTenMinuteUndeliverableMsgs
|
||||
print "require 1.3.6.1.4.1.23.2.37.1.1.1.14. [\\d+]\n"; # mtaTenMinuteErrorMsgs
|
||||
|
||||
exit 0;
|
||||
}
|
||||
|
||||
if ($0 =~ /^(?:|.*\/)snmp_([^_]+)_gwmta_msgs_(\d+)*$/)
|
||||
{
|
||||
$host = $1;
|
||||
$pos = $2;
|
||||
}
|
||||
elsif (!defined($host))
|
||||
{
|
||||
print "# Debug: $0 -- $1\n" if $DEBUG;
|
||||
die "# Error: couldn't understand what I'm supposed to monitor.";
|
||||
}
|
||||
|
||||
my ($session, $error) = Net::SNMP->session(
|
||||
-hostname => $host,
|
||||
-community => $community,
|
||||
-port => $port
|
||||
);
|
||||
|
||||
if (!defined ($session))
|
||||
{
|
||||
die "Croaking: $error";
|
||||
}
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "config")
|
||||
{
|
||||
# get name of domain
|
||||
my $domain = &get_single ($session, "1.3.6.1.4.1.23.2.37.1.1.1.2.$pos"); # mtaDomainName
|
||||
|
||||
# output to munin
|
||||
print "host_name $host
|
||||
graph_category mail
|
||||
graph_args --base 1000
|
||||
graph_period $GRAPH_PERIOD
|
||||
graph_title GWMTA load ($domain)
|
||||
graph_info Monitors status of Groupwise MTA, here: $domain. It reports values for the last 10 minutes.
|
||||
graph_vlabel $GRAPH_VLABEL
|
||||
graph_args -l 0
|
||||
routed.label $ROUTED_LABEL
|
||||
routed.info mtaTenMinuteRoutedMsgs (1.3.6.1.4.1.23.2.37.1.1.1.10.)
|
||||
routed.critical $ROUTED_CRITICAL
|
||||
routed.type GAUGE
|
||||
routed.min 0
|
||||
routed.draw AREA
|
||||
routed.graph yes
|
||||
undelivered.label $UNDELIVERED_LABEL
|
||||
undelivered.info mtaTenMinuteUndeliverableMsgs (1.3.6.1.4.1.23.2.37.1.1.1.12.)
|
||||
undelivered.critical $UNDELIVERED_CRITICAL
|
||||
undelivered.type GAUGE
|
||||
undelivered.min 0
|
||||
undelivered.draw STACK
|
||||
undelivered.graph yes
|
||||
errors.label $ERRORS_LABEL
|
||||
errors.info mtaTenMinuteErrorMsgs (1.3.6.1.4.1.23.2.37.1.1.1.14.)
|
||||
errors.critical $ERRORS_CRITICAL
|
||||
errors.type GAUGE
|
||||
errors.min 0
|
||||
errors.draw STACK
|
||||
errors.graph yes";
|
||||
|
||||
exit 0;
|
||||
}
|
||||
# fetch the data and print
|
||||
print "routed.value ", &get_single ($session, "1.3.6.1.4.1.23.2.37.1.1.1.10.$pos"), "\n"; # mtaTenMinuteRoutedMsgs
|
||||
print "undelivered.value ", &get_single ($session, "1.3.6.1.4.1.23.2.37.1.1.1.12.$pos"), "\n"; # mtaTenMinuteUndeliverableMsgs
|
||||
print "errors.value ", &get_single ($session, "1.3.6.1.4.1.23.2.37.1.1.1.14.$pos"), "\n"; # mtaTenMinuteErrorMsgs
|
||||
|
||||
sub get_single
|
||||
{
|
||||
my $handle = shift;
|
||||
my $oid = shift;
|
||||
|
||||
print "# Getting single $oid...\n" if $DEBUG;
|
||||
|
||||
$response = $handle->get_request ($oid);
|
||||
|
||||
if (!defined $response->{$oid})
|
||||
{
|
||||
return undef;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $response->{$oid};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,212 +0,0 @@
|
|||
#!/usr/bin/perl -w
|
||||
#
|
||||
# File: snmp__gwpoa_
|
||||
# Copyright (C) 2007 Gabriele Pohl (contact@dipohl.de)
|
||||
#
|
||||
# Derived from plugin snmp__load
|
||||
# Copyright (C) 2004 Jimmy Olsen, Dagfinn Ilmari Mannsaaker
|
||||
#
|
||||
# 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; version 2 dated June,
|
||||
# 1991.
|
||||
#
|
||||
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# ------------------------------------------------------------
|
||||
# Plugin to monitor Novell Groupwise Post Office Agent (POA)
|
||||
# ------------------------------------------------------------
|
||||
#
|
||||
# Management Information Base (MIB) GWPOA
|
||||
#
|
||||
# Naming Tree: 1.3.6.1.4.1.23
|
||||
# iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) novell(23)
|
||||
#
|
||||
# To see all values available for your GWPOA, type
|
||||
# snmpwalk -v1 -c public -m GWPOA-MIB <HOST> gwpoa
|
||||
#
|
||||
# This plugin fetches:
|
||||
#
|
||||
# * poaPostOfficeName - 1.3.6.1.4.1.23.2.38.1.1.1.2.
|
||||
# * poaTotalMsgs - 1.3.6.1.4.1.23.2.38.1.1.1.3.
|
||||
# * poaUndeliverableMsgs - 1.3.6.1.4.1.23.2.38.1.1.1.8.
|
||||
# * poaProblemMsgs - 1.3.6.1.4.1.23.2.38.1.1.1.4.
|
||||
# * poaAdmErrorMsg - 1.3.6.1.4.1.23.2.38.1.1.1.27.
|
||||
#
|
||||
# Usage:
|
||||
# --------------
|
||||
# Plugin needs to be linked to your servicedir [/etc/munin/plugins]
|
||||
# with the hostname (host) and the table index (pos) of the POA-Object
|
||||
# defined in the linkage.
|
||||
#
|
||||
# snmp_<host>_gwpoa_<pos>
|
||||
#
|
||||
# with:
|
||||
# <host> = Name or IP-Number of host
|
||||
# <pos> = Table index of the POA Object
|
||||
#
|
||||
#
|
||||
# E.g.
|
||||
# ln -s /usr/share/munin/plugins/snmp__gwpoa_ \
|
||||
# /etc/munin/plugins/snmp_foo.example.com_gwpoa_1
|
||||
#
|
||||
# ...will monitor the first POA-Object on host foo.example.com.
|
||||
#
|
||||
#
|
||||
# Configuration:
|
||||
# --------------
|
||||
# Parameters
|
||||
# community - Specify wich community string to use (Default: public)
|
||||
# port - Specify which port to read from (Default: 161)
|
||||
# host - Specify which host to monitor (Default: Read from link in servicedir)
|
||||
# pos - Specify which table Object to read (Default: Read from link in servicedir,
|
||||
#
|
||||
# You may adjust settings via configuration in plugin-conf.d/munin-node:
|
||||
# [snmp_*_gwpoa_*]
|
||||
# env.port <your_port_number>
|
||||
# env.community <your SNMP community string>
|
||||
# env.pos <your table position. Values: 0,1,2,..>
|
||||
# env.host <name or IP of your host>
|
||||
#
|
||||
# Parameters can also be specified on a per POA basis, eg:
|
||||
# [snmp_foo.example.com_gwpoa_2]
|
||||
# env.port 166
|
||||
# env.community example
|
||||
#
|
||||
# $Log$
|
||||
# Revision 1.0 2007/09/02 11:27 gap
|
||||
# Created by gap
|
||||
#
|
||||
#
|
||||
#%# family=snmpauto
|
||||
#%# capabilities=snmpconf
|
||||
|
||||
use strict;
|
||||
use Net::SNMP;
|
||||
|
||||
my $DEBUG = 0;
|
||||
|
||||
my $host = $ENV{host} || undef;
|
||||
my $port = $ENV{port} || 161;
|
||||
my $community = $ENV{community} || "public";
|
||||
my $pos = $ENV{pos} || 1;
|
||||
|
||||
my $response;
|
||||
|
||||
my $GRAPH_PERIOD = "minute";
|
||||
my $GRAPH_VLABEL = "messages per $GRAPH_PERIOD";
|
||||
my $TOTAL_LABEL = "TotalMsgs";
|
||||
my $UNDELIVERABLE_LABEL = "UndeliverableMsgs";
|
||||
my $PROBLEM_LABEL = "ProblemMsgs";
|
||||
my $ERRORS_LABEL = "AdmErrorMsgs";
|
||||
my $ERRORS_CRITICAL = 10;
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "snmpconf")
|
||||
{
|
||||
print "index 1.3.6.1.4.1.23.2.38.1.1.1.1.\n"; # gwpoa
|
||||
print "require 1.3.6.1.4.1.23.2.38.1.1.1.2. [.*]\n"; # poaPostOfficeName
|
||||
print "require 1.3.6.1.4.1.23.2.38.1.1.1.3. [\\d*]\n"; # poaTotalMsgs
|
||||
print "require 1.3.6.1.4.1.23.2.38.1.1.1.4. [\\d*]\n"; # poaProblemMsgs
|
||||
print "require 1.3.6.1.4.1.23.2.38.1.1.1.8. [\\d*]\n"; # poaUndeliverableMsgs
|
||||
print "require 1.3.6.1.4.1.23.2.38.1.1.1.27. [\\d*]\n"; # poaAdmErrorMsgs
|
||||
|
||||
exit 0;
|
||||
}
|
||||
if ($0 =~ /^(?:|.*\/)snmp_([^_]+)_gwpoa_(\d+)*$/)
|
||||
{
|
||||
$host = $1;
|
||||
# take default value for pos if not set in link
|
||||
if (defined($2)) { $pos = $2; }
|
||||
}
|
||||
elsif (!defined($host))
|
||||
{
|
||||
print "# Debug: $0 -- $1\n" if $DEBUG;
|
||||
die "# Error: couldn't understand what I'm supposed to monitor.";
|
||||
}
|
||||
|
||||
my ($session, $error) = Net::SNMP->session(
|
||||
-hostname => $host,
|
||||
-community => $community,
|
||||
-port => $port
|
||||
);
|
||||
|
||||
if (!defined ($session))
|
||||
{
|
||||
die "Croaking: $error";
|
||||
}
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "config")
|
||||
{
|
||||
|
||||
# get Post Office Name
|
||||
my $poname = &get_single ($session, "1.3.6.1.4.1.23.2.38.1.1.1.2.$pos"); # poaPostOfficeName
|
||||
|
||||
# output to munin
|
||||
print "host_name $host
|
||||
graph_category mail
|
||||
graph_args --base 1000
|
||||
graph_period $GRAPH_PERIOD
|
||||
graph_title GWPOA load ($poname)
|
||||
graph_info Shows per minute activity of the Groupwise PostOfficeAgent (GWPOA), here: $poname.<br />
|
||||
graph_vlabel $GRAPH_VLABEL
|
||||
total_msgs.label $TOTAL_LABEL
|
||||
total_msgs.info poaTotalMsgs
|
||||
total_msgs.type DERIVE
|
||||
total_msgs.min 0
|
||||
total_msgs.draw LINE2
|
||||
total_msgs.graph yes
|
||||
problem_msgs.label $PROBLEM_LABEL
|
||||
problem_msgs.info poaProblemMsgs
|
||||
problem_msgs.type DERIVE
|
||||
problem_msgs.min 0
|
||||
problem_msgs.draw LINE2
|
||||
problem_msgs.graph yes
|
||||
undeliverable_msgs.label $UNDELIVERABLE_LABEL
|
||||
undeliverable_msgs.info poaUndeliverableMsgs
|
||||
undeliverable_msgs.type DERIVE
|
||||
undeliverable_msgs.min 0
|
||||
undeliverable_msgs.draw LINE2
|
||||
undeliverable_msgs.graph yes
|
||||
errors.label $ERRORS_LABEL
|
||||
errors.info poaAdmErrorMsgs
|
||||
errors.critical $ERRORS_CRITICAL
|
||||
errors.type DERIVE
|
||||
errors.min 0
|
||||
errors.draw LINE2
|
||||
errors_out.graph yes";
|
||||
|
||||
exit 0;
|
||||
}
|
||||
# fetch the data and print
|
||||
print "total_msgs.value ", &get_single ($session, "1.3.6.1.4.1.23.2.38.1.1.1.3.$pos"), "\n"; # poaTotalMsgs
|
||||
print "problem_msgs.value ", &get_single ($session, "1.3.6.1.4.1.23.2.38.1.1.1.4.$pos"), "\n"; # poaProblemMsgs
|
||||
print "undeliverable_msgs.value ", &get_single ($session, "1.3.6.1.4.1.23.2.38.1.1.1.8.$pos"), "\n"; # poaUndeliverableMsgs
|
||||
print "errors.value ", &get_single ($session, "1.3.6.1.4.1.23.2.38.1.1.1.27.$pos"), "\n"; # poaAdmErrorMsgs
|
||||
|
||||
|
||||
sub get_single
|
||||
{
|
||||
my $handle = shift;
|
||||
my $oid = shift;
|
||||
|
||||
print "# Getting single $oid...\n" if $DEBUG;
|
||||
|
||||
$response = $handle->get_request ($oid);
|
||||
|
||||
if (!defined $response->{$oid})
|
||||
{
|
||||
return undef;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $response->{$oid};
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue