FW: Nagios behaviour problem

Ed Smith Edward.Smith at demandtec.com
Wed Mar 30 00:47:55 CEST 2005




I have it setup to return 0, 1, and 2 for OK, Warn, and critical resp. and I have verified that it works.  However, I stil get no output. 

-={nagios at thumper}=- pts -={14:41/29-Mar-05}=-
-={$:/opt/nagios}=-/opt/nagios/disk_check.pl 50 60
WARNING - Filesystem /dev/sda5 has capacity 56%
WARNING - Filesystem /dev/sda8 has capacity 53%
1

-={nagios at thumper}=- pts -={14:41/29-Mar-05}=-

The above output is from the nagios user running the script.  I have my exit status set to return the same number printed at the end.


------------------------
Edward Smith
Systems Application Engineer
Demandtec, Inc
esmith at demandtec.com
650-226-4609


-----Original Message-----
From: Nathan Oyler [mailto:noyler at khimetrics.com]
Sent: Tuesday, March 29, 2005 2:12 PM
To: Ed Smith
Subject: RE: [Nagios-users] Nagios behaviour problem


Aren't you required to return the correct number that equates to the
correct output.

I.E Critical = Return 3, or whatever.

It's in the plugin guidelines, I don't have time to really look at this
right now, but off the top I'd assume you'd need that as all my plugins
have.

> -----Original Message-----
> From: Ed Smith [mailto:Edward.Smith at demandtec.com]
> Sent: Tuesday, March 29, 2005 3:00 PM
> To: Nathan Oyler
> Subject: RE: [Nagios-users] Nagios behaviour problem
>
>
> I tried attaching it, but it didn't get through.
> I have a few customer libraries we use, but they don't affect the
output.
>
>
>
> ****#!/usr/bin/perl -w -I/opt/admincenter2
>
> use strict;
>
> use lib qw(../);
> use Mod::Global ;
> use Data::Dumper ;
> use Net::SSH::Perl;
>
> my $DEBUG=0;
> my $state='OK';
> #my $hostname = $ARGV[0];
> my $warn = $ARGV[0];
> my $critical = $ARGV[1];
>
> #$hostname = "sfodti".$hostname;
>
> my $hash = {};
> my $remote_cmd = "df -k";
> #my %params = () ;
> my @values;
>
> #$params{'identity_files'} = ['/home/nagios/.ssh/id_rsa'];
>
> #my $ssh= undef;
>
> #eval '$ssh = Net::SSH::Perl->new($hostname,%params) ' ;
> #        if ( ! defined $ssh || $ssh == 0 ) {
> #                print "failed to establish ssh connection with
> $hostname\n";
> #                exit(1) ;
> #        }
> #$ssh->login();
>
> my ($stdout,$stderr,$exit) ;
> #eval ' ($stdout, $stderr, $exit) = $ssh->cmd($remote_cmd) ';
> $stdout = `$remote_cmd`;
> print Dumper($stdout) if $DEBUG;
>
> my @output = split /\n/, $stdout;
>
> print "$output[1]\n" if $DEBUG;
> print "$output[2]\n" if $DEBUG;
>
> shift(@output);
>
> foreach my $fs (@output) {
>    if ($fs =~ /dev/) {
>       @values = split /\s+/, $fs;
>       my $capacity = $values[4];
>       my $filesys = $values[0];
>       chop ($capacity);
>
>       if ($capacity >= $warn) {
>          $state='WARNING';
>
>          if ($capacity >= $critical){
>             $state='CRITICAL';
>          }
>          print "$state - Filesystem $filesys has capacity
$capacity%\n";
>
>       }
>
>       if ($filesys =~ /none/) {
>       } else {
>          $hash->{$filesys} = $capacity;
>       }
>    }
> }
>
> if ($state eq "OK") {
>    print "$state\n";
> }
>
> exit;***************************************
>
>
> ------------------------
> Edward Smith
> Systems Application Engineer
> Demandtec, Inc
> esmith at demandtec.com
> 650-226-4609
>
>
> -----Original Message-----
> From: Nathan Oyler [mailto:noyler at khimetrics.com]
> Sent: Tuesday, March 29, 2005 1:34 PM
> To: Ed Smith
> Subject: RE: [Nagios-users] Nagios behaviour problem
>
>
> Can you send a copy of the perl script?
>
> > -----Original Message-----
> > From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> > admin at lists.sourceforge.net] On Behalf Of Ed Smith
> > Sent: Tuesday, March 29, 2005 2:07 PM
> > To: nagios-users at lists.sourceforge.net
> > Subject: [Nagios-users] Nagios behaviour problem
> >
>
> >
>
> > Hello,
> >
>
> > Since I can't find a way to use check_disk to ignore nfs mounted
file
> > systems, I have written my own perl script to do so, and it is quite
> > useful.  However, when I try to use it with nagios, nagios always
> comes
> > back with (no  output!).  It works fine on the command line as the
> nagios
> > user.  Any ideas what could be causing this and what I could do to
fix
> it?
> > I have the path fully qualfied.  Any help is appreciated.
> >
>
> > Ed
> >
>
> >
>
> >
>
> > ------------------------
> > Edward Smith
> > Systems Application Engineer
> > Demandtec, Inc
> > esmith at demandtec.com
> > 650-226-4609
> >
>
> >
>
> > <html>
> > <body>
> >   <span
> style="font-size:8.0pt;font-family:Arial">------------------------
> >
>
------------------------------------------------------------------------
> --
> > -------------------------------------------</span>
> >   <span style="font-size:8.0pt;font-family:Arial">DEMANDTEC EMAIL
> > NOTICE:</span>
> >   <p><span style="font-size:8.0pt;font-family:Arial">NOTICE: This
> email
> > transmission and all attached files contain information intended for
> the
> > designated individual or entity to whom it is addressed and may
> contain
> > information that is proprietary, privileged and/or exempt from
> disclosure
> > under applicable law.  If you are not the intended recipient or an
> > employee or agent responsible for delivering this message to the
> intended
> > recipient, you are hereby notified that any dissemination,
> distribution,
> > copying,  or other use of this email or its attachments is strictly
> > prohibited.  If you have received this email in error, please notify
> the
> > sender immediately by replying to this message and please delete the
> > original message without making any copies.</span>
> >   <p><span style="font-size:8.0pt;font-family:Arial">WARNING:
Computer
> > viruses can be transmitted via email.  The recipient should check
this
> > email and any attachments for the presence of viruses.  Although we
> have
> > taken reasonable precautions to ensure that this email and all
> attachments
> > are free from viruses, we accept no liability for any loss or damage
> > arising from the use of this email or its attachments.</span>
> > </body>
> > </html>
> >
>
> >
>
> > -------------------------------------------------------
> > SF email is sponsored by - The IT Product Guide
> > Read honest & candid reviews on hundreds of IT Products from real
> users.
> > Discover which products truly live up to the hype. Start reading
now.
> > http://ads.osdn.com/?ad_ide95&alloc_id396&op=ick
> > _______________________________________________
> > Nagios-users mailing list
> > Nagios-users at 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
>
>
>
> <html>
> <body>
>   <span
style="font-size:8.0pt;font-family:Arial">------------------------
>
------------------------------------------------------------------------
--
> -------------------------------------------</span>
>   <span style="font-size:8.0pt;font-family:Arial">DEMANDTEC EMAIL
> NOTICE:</span>
>   <p><span style="font-size:8.0pt;font-family:Arial">NOTICE: This
email
> transmission and all attached files contain information intended for
the
> designated individual or entity to whom it is addressed and may
contain
> information that is proprietary, privileged and/or exempt from
disclosure
> under applicable law.  If you are not the intended recipient or an
> employee or agent responsible for delivering this message to the
intended
> recipient, you are hereby notified that any dissemination,
distribution,
> copying,  or other use of this email or its attachments is strictly
> prohibited.  If you have received this email in error, please notify
the
> sender immediately by replying to this message and please delete the
> original message without making any copies.</span>
>   <p><span style="font-size:8.0pt;font-family:Arial">WARNING: Computer
> viruses can be transmitted via email.  The recipient should check this
> email and any attachments for the presence of viruses.  Although we
have
> taken reasonable precautions to ensure that this email and all
attachments
> are free from viruses, we accept no liability for any loss or damage
> arising from the use of this email or its attachments.</span>
> </body>
> </html>



<html>
<body>
  <span style="font-size:8.0pt;font-family:Arial">---------------------------------------------------------------------------------------------------------------------------------------------</span>
  <span style="font-size:8.0pt;font-family:Arial">DEMANDTEC EMAIL NOTICE:</span>
  <p><span style="font-size:8.0pt;font-family:Arial">NOTICE: This email transmission and all attached files contain information intended for the designated individual or entity to whom it is addressed and may contain information that is proprietary, privileged and/or exempt from disclosure under applicable law.  If you are not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, copying,  or other use of this email or its attachments is strictly prohibited.  If you have received this email in error, please notify the sender immediately by replying to this message and please delete the original message without making any copies.</span>
  <p><span style="font-size:8.0pt;font-family:Arial">WARNING: Computer viruses can be transmitted via email.  The recipient should check this email and any attachments for the presence of viruses.  Although we have taken reasonable precautions to ensure that this email and all attachments are free from viruses, we accept no liability for any loss or damage arising from the use of this email or its attachments.</span>
</body>
</html>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at 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





More information about the Users mailing list