[Nagios-users] multi purpose VBSCript

2007-07-06 Thread riky . none
I think that in more and more scenari (windows world) one nagios-script must
(in NRPE mode) 
1)run one dos check command
2)read your output  
3)find string (default error) 
4)create output (state and description)
VBScript is the best way (is easy and work in ALL windows server sistem) but
i am vbscript's newbie  
Plase send me one basic multipurpose script
I modify this script to use my command
ONLY NOTE:
I must check status backup veritas
the command is ca_qmgr.exe -l

the output is :

  JOB# JOBIDSTATUSEXEC-TIME  JOB-TYPE   LAST-RESULT 
   OWNER DESCRIPTION
--

 3  1116  DONE  06/29/2007 23:30:29BACKUP CANCELLED 
carootexchange MORFEO SMAN004 (Makeup Job for Job No. 2 ID 1114)
 2  1121ACTIVE  07/02/2007 09:31:29BACKUP  ERROR
caroot exchange MORFEO SMAN004
 1  1120 READY  07/04/2007 18:00:00DB-PRUNING  FINISHED 
No Owner No Comments


grazie 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Puliziashop: tutto quello che cerchi a portata di click, vieni a vedere
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6758d=20070706



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


[Nagios-users] check_snmp_printer.pl

2007-06-27 Thread riky . none
i very problem to use this script
http://www.koders.com/perl/fid631F219FF353175BA5F08985533642B5F8B427FD.aspx

#!/usr/local/bin/perl -w

# check_snmp_printer - check for printer status via snmp
#  Supports both standard PRINT-MIB (RFC-1759) and HP Enterprise print-mib
#  that is supported by some of the older JetDirect interfaces

# Acknowledgements:
# the JetDirect code is taken from check_hpjd.c by Ethan Galstad
#   
#   The idea for the plugin (as well as some code) were taken from Jim
#   Trocki's pinter alert script in his mon utility, found at
#   http://www.kernel.org/software/mon
#

# Notes:
# 'JetDirect' is copyrighted by Hewlett-Packard
#
#
# License Information:
# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
#

#
# TODO: Query HOST-RESOURCE MIB for a quick status
#
# hrPrinterStatus = .1.3.6.1.2.1.25.3.5.1;
# hrPrinterDetectedErrorState = .1.3.6.1.2.1.25.3.5.1.2
#
# hrPrinterStatus OBJECT-TYPE
#SYNTAX INTEGER {
#   other(1),
#   unknown(2),
#   idle(3),
#   printing(4),
#   warmup(5)
#   }
#
# hrPrinterDetectedErrorState OBJECT-TYPE
#SYNTAX OCTET STRING
#MAX-ACCESS read-only
#STATUS current
#DESCRIPTION
#This object represents any error conditions detected
#by the printer.  The error conditions are encoded as
#bits in an octet string, with the following
#definitions:
#
# Condition Bit #
#
# lowPaper  0
#
# noPaper   1
# lowToner  2
# noToner   3
# doorOpen  4
# jammed5
# offline   6
# serviceRequested  7
# inputTrayMissing  8
# outputTrayMissing 9
# markerSupplyMissing  10
# outputNearFull   11
# outputFull   12
# inputTrayEmpty   13
# overduePreventMaint  14
#
#  
#
use strict;
use Getopt::Long;
use vars qw($opt_V $opt_h $opt_H $opt_P $opt_t $opt_d $session $error
$answer 
$key
   $response $PROGNAME $port $hostname );
use lib  utils.pm;
use utils qw(%ERRORS print_revision support usage );
use Net::SNMP;

sub print_help ();
sub print_usage ();

$ENV{'PATH'}='';
$ENV{'BASH_ENV'}=''; 
$ENV{'ENV'}='';

# defaults 
my $ptype = 1;  # to
standard 
RFC printer type
my $state = $ERRORS{'UNKNOWN'};
my $community = public;
my $snmp_version = 1;
my $port = 161;

Getopt::Long::Configure('bundling');
GetOptions
(d   = \$opt_d, debug  = \$opt_d,
 V   = \$opt_V, version= \$opt_V,
 P=s = \$opt_P, Printer=s  = \$opt_P,# printer type -
HP 
or RFC
 v=i = \$snmp_version, snmp_version=i  = \$snmp_version,
 p=i = \$port, port=i = \$port,
 C=s = \$community,community=s = \$community,
 h   = \$opt_h, help   = \$opt_h,
 H=s = \$opt_H, hostname=s = \$opt_H);



$PROGNAME = check_snmp_printer;

if ($opt_V) {
print_revision($PROGNAME,'$Revision: 1.1 $');
exit $ERRORS{'OK'};
}

if ($opt_h) {print_help(); exit $ERRORS{'OK'};}

unless (defined $opt_H) {
print No target hostname specified\n;
exit $ERRORS{UNKNOWN};
}
$hostname = $opt_H;
if (! utils::is_hostname($hostname)){
usage( $hostname did not match pattern\n);
exit $ERRORS{UNKNOWN};
}

if (defined $opt_P) {
if ($opt_P eq HP ) {
$ptype = 2;
}elsif ($opt_P eq RFC ) {
$ptype = 1;
}else{
print Only \HP\ and \RFC\ are supported as printer
options 
at this time.\n;
exit $ERRORS{UNKNOWN};
}
}


if ( $snmp_version =~ /[12]/ ) {

($session, $error) = Net::SNMP-session(
  -hostname  = $hostname,
  -community = $community,
  -port  = $port,
  -version  = $snmp_version
   );

if (!defined($session)) {
  $state='UNKNOWN';
  $answer=$error;
  print ($state: no session - 

[Nagios-users] NAGIOS SNMP

2007-06-06 Thread riky . none
hi
i have install nagios and plugin in ubuntu linux-box (work it)
knows you tutorial or howto to config nagios and snmp??? (step by step)

i install plugin but i not have /usr/local/nagios/libexec/check_snmp
i have only this plugin:
-rwxr-xr-x 1 root root  17746 Apr 13 16:13 check_snmp_cpfw
-rwxr-xr-x 1 root root   3032 Apr 13 16:18 check_snmp_openvz.sh

grazie

 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Fai squillare la PANTERA ROSA sul tuo cellulare: e' in REGALO
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6613d=20070606



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null