From mm@elabnet.de Mon Nov 18 09:59:04 2002
Date: Mon, 18 Nov 2002 12:19:04 +0100
From: Michael Markstaller <mm@elabnet.de>
To: nagiosplug-devel@lists.sourceforge.net
Subject: [Nagiosplug-devel] Submission: check_insight / checking Compaq
Insight Agent status
Hi,
I've been looking to check the status/health of Compaq Insight Agents on
servers and found a spong plugin
(http://spong.sourceforge.net/downloads/plugins/spong-network/check_insi
ght) which I've slightly changed to work with Nagios.
I have pretty no idea of perl at all, just wanted to make it work for
me, so please don't shoot me for this copy-paste-code. I've tested some
basic things, it seems to work at least to report a warning if smthg is
degraded and OK of xcourse ;)
I'm also quite unsure if this is the right way to submit, so I'll just
try ;)
There're some "unknown" components on all servers I've checked so far,
if anybody has a documentation of what's exactly returned when getting
the OID 1.3.6.1.4.1.232.11.2.10.1.0 (CPQHOST_MIB isn't very descriptive)
I'd be happy to fix this.
--- cut ---
#!/usr/bin/perl
#
# (c)2002 Michael Markstaller, Elaborated Networks GmbH
# send bug reports to <mm@elabnet.de>
#
# 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 (or with Nagios); if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA
#
#
# Check Comapq Insight Management Agents Systems Status by SNMP
# based on the spong-plugin check_insight from:
#
http://spong.sourceforge.net/downloads/plugins/spong-network/check_insig
ht
#
# Usage:
# check_insight -H <host> -C community
#
use Net::SNMP;
use Getopt::Long;
Getopt::Long::Configure('bundling');
$version=0.01;
my %ERRORS = ('UNKNOWN' , '-1',
'OK' , '0',
'WARNING', '1',
'CRITICAL', '2');
#
# some default values
#
$TIMEOUT=15;
#
# get command line options the regular way
#
GetOptions
("V" => \$opt_V, "version" => \$opt_V,
"h" => \$opt_h, "help" => \$opt_h,
"v" => \$verbose, "verbose" => \$verbose,
"H=s" => \$opt_H, "hostname=s" => \$opt_H,
"C=s" => \$opt_C, "community=s" => \$opt_C);
#
# handle the verbose stuff first
#
if ($opt_V) {
print "\n";
print "check_insight nagios plugin version $version\n";
print "\n";
print "The nagios plugins come with ABSOLUTELY NO WARRANTY. You
may redistribute\n";
print "copies of the plugins under the terms of the GNU General
Public License.\n";
print "For more information about these matters, see the file
named COPYING.\n";
print "\n";
print "(c)2002 Michael Markstaller, Elaborated Networks GmbH\n";
print "\n";
print "\n";
=1= |