Re: exec problem with 5.1

Mike Lipsey <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Here is the info; Sorry I didn't include it to begin with. I know better than that...
   
  snmpd.conf:
  rocommunity  <community>
syscontact  [email protected]
disk /boot
disk /
disk /home
disk /usr
disk /var
disk /tmp
exec .1.3.6.1.4.1.2021.51 pingscript.pl /path/pingscript.pl server1
exec .1.3.6.1.4.1.2021.52 pingscript.pl /path/pingscript.pl server2
exec .1.3.6.1.4.1.2021.53 pingscript.pl /path/pingscript.pl server3
exec .1.3.6.1.4.1.2021.54 pingscript.pl /path/pingscript.pl server4
exec .1.3.6.1.4.1.2021.55 pingscript.pl /path/pingscript.pl server5
...
exec .1.3.6.1.4.1.2021.55 pingscript.pl /path/pingscript.pl server20
  
Pingscript:
  #!/usr/bin/perl -w
#use strict;
use POSIX qw(strftime);
@hosts = $ARGV[0];
my $hostname = `hostname -s`;
chomp $hostname;
my $timenow = strftime "%m/%d/%y-%H:%M:%S", localtime;
foreach my $host (@hosts)
{
        my @cssh = `ping -c 100 -f $host`;
          foreach my $pricegrabber (@cssh)
        {
                if($pricegrabber =~ /^(\d+) packets transmitted, (\d+) received, (\d+)% packet loss, time (\d+)ms/)
                {
                        if($1 == $2)
                        {
                                print "$hostname->$host: OK\n";
                                next;
                        } else {
                                print "$timenow $hostname->$host: sent: $1 -- recvd: $2 -- packet loss: $3% -- time: $4ms\n";
                        }
                }
          }
}#ENDOFSCRIPT
   
  That's what I've got, every time I run an snmpget against the oids however  once I get to the server #4 I get the response expected and then server 5 and on times out.
  If I upgrade to 5.3 and use extend however it does work and I don't have the problem but sometimes the agent does crash.
  What can I do to enable debugging of the agent to syslog? I tried to rtfm but wasn't able to see it readily.
  Thanks!

Thomas Anders <[email protected]> wrote:
  Mikester wrote:
> I've got an exec configuration that runs a simple ping script to a few 
> hosts.
> 
> I have tested the 5.3 version extend config and don't have this problem 
> but upgrading hundreds of machine's version of snmp is a task that won't 
> happen quickly and I do still have some problems that are similar.
> 
> The problem that I have is that after a few returns the agent stops 
> responding entirely and requires a shutdown and a restart to get 
> responding again.

We'd need to know the exact details of your setup (including the ping 
script itself) to be able to help. If the agent hangs, what are the last 
couple of lines of "snmpd -f -Le -DALL" output?

In case this turns out to be a problem with your existing net-snmp 5.1 
installation, however, upgrading is likely to be the suggested option.


+Thomas

-- 
Thomas Anders (thomas.anders at blue-cable.de)


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


		
---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.