Re: Adding traps

2004-09-10 Thread Gary Clark
Hello,

By turning on the debug trace on the trace:

snmptrapd -f -D -Lf dummy

I can capture all the dump.

I could then view the trace and saw that indeed the token "traphandler" did
get registered and a call was being made to my
handler. My perl script was handling the trap handler call incorrectly. But
of course.

Thanks,
Garyc

- Original Message -
From: "Gary Clark" <[EMAIL PROTECTED]>
To: "Dave Shield" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, September 10, 2004 12:48 PM
Subject: Re: Adding traps


> Hello,
>
> The problem I'm seeing is that the snmptrapd.conf I dont think is being
> accessed due to the script not being ran.
>
> The snmptrapd.conf: now contains the following which Dave recommended:
>
>traphandle .1.3.6.1.6.3.1.1.5.1 /usr/bin/perl
> /usr/local/share/snmp/cold.pl
>
> I then used the following "cold.pl" perl script:
>
> #!/usr/bin/perl -w
>
> print "At last the coldStart handler is alive!!\n";
>
> sub getline()
> {
> while ()
>  {
>   my $line =$_;
>   chomp ($line);
>   print $line;
>   }
> }
> sub main()
> {
>   getline();
> }
> main();
>
> Simple. It accepts lines from STDIN and prints them out. This looks ok?
> So if I dont see any output line I dont think the configuration is being
> accessed.
> Can somebody enlighten me on this? Is it an environment issue, if so how
can
> I determine this?
> The snmptrapd.conf is located in /usr/local/share/snmp.
>
> I'm running the trapd and it does receive the coldStart trap I just dont
see
> my script being ran.
>
> Cheers,
> Garyc
> - Original Message -
> From: "Dave Shield" <[EMAIL PROTECTED]>
> To: "Gary Clark" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, September 10, 2004 9:26 AM
> Subject: Re: Adding traps
>
>
> >
> > > I can see the coldStart trap being received but my script is not run.
> > >
> > > Within the snmptrapd.conf file I added the following line:
> > >
> > > traphandle .1.3.6.1.6.3.1.5.1 /usr/bin/perl
> /usr/local/share/snmp/cold.pl
> >
> > Try
> >   traphandle .1.3.6.1.6.3.1.1.5.1 /usr/bin/perl
> /usr/local/share/snmp/cold.pl
> >
> >
> > Dave
>
>
>
> ---
> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> Project Admins to receive an Apple iPod Mini FREE for your judgement on
> who ports your project to Linux PPC the best. Sponsored by IBM.
> Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
> ___
> 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



---
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. 
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
___
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


Re: Adding traps

2004-09-10 Thread Gary Clark
Hello,

I correct the perl script to dump to a text file and everything works fine.

Thanks,
garyc

- Original Message -
From: "Gary Clark" <[EMAIL PROTECTED]>
To: "Gary Clark" <[EMAIL PROTECTED]>; "Dave Shield"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, September 10, 2004 3:36 PM
Subject: Re: Adding traps


> Hello,
>
> By turning on the debug trace on the trace:
>
> snmptrapd -f -D -Lf dummy
>
> I can capture all the dump.
>
> I could then view the trace and saw that indeed the token "traphandler"
did
> get registered and a call was being made to my
> handler. My perl script was handling the trap handler call incorrectly.
But
> of course.
>
> Thanks,
> Garyc
>
> - Original Message -
> From: "Gary Clark" <[EMAIL PROTECTED]>
> To: "Dave Shield" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, September 10, 2004 12:48 PM
> Subject: Re: Adding traps
>
>
> > Hello,
> >
> > The problem I'm seeing is that the snmptrapd.conf I dont think is being
> > accessed due to the script not being ran.
> >
> > The snmptrapd.conf: now contains the following which Dave recommended:
> >
> >traphandle .1.3.6.1.6.3.1.1.5.1 /usr/bin/perl
> > /usr/local/share/snmp/cold.pl
> >
> > I then used the following "cold.pl" perl script:
> >
> > #!/usr/bin/perl -w
> >
> > print "At last the coldStart handler is alive!!\n";
> >
> > sub getline()
> > {
> > while ()
> >  {
> >   my $line =$_;
> >   chomp ($line);
> >   print $line;
> >   }
> > }
> > sub main()
> > {
> >   getline();
> > }
> > main();
> >
> > Simple. It accepts lines from STDIN and prints them out. This looks ok?
> > So if I dont see any output line I dont think the configuration is being
> > accessed.
> > Can somebody enlighten me on this? Is it an environment issue, if so how
> can
> > I determine this?
> > The snmptrapd.conf is located in /usr/local/share/snmp.
> >
> > I'm running the trapd and it does receive the coldStart trap I just dont
> see
> > my script being ran.
> >
> > Cheers,
> > Garyc
> > - Original Message -
> > From: "Dave Shield" <[EMAIL PROTECTED]>
> > To: "Gary Clark" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Friday, September 10, 2004 9:26 AM
> > Subject: Re: Adding traps
> >
> >
> > >
> > > > I can see the coldStart trap being received but my script is not
run.
> > > >
> > > > Within the snmptrapd.conf file I added the following line:
> > > >
> > > > traphandle .1.3.6.1.6.3.1.5.1 /usr/bin/perl
> > /usr/local/share/snmp/cold.pl
> > >
> > > Try
> > >   traphandle .1.3.6.1.6.3.1.1.5.1 /usr/bin/perl
> > /usr/local/share/snmp/cold.pl
> > >
> > >
> > > Dave
> >
> >
> >
> > ---
> > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> > Project Admins to receive an Apple iPod Mini FREE for your judgement on
> > who ports your project to Linux PPC the best. Sponsored by IBM.
> > Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
> > ___
> > 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



---
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. 
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
___
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


Re: Adding traps

2004-09-10 Thread Gary Clark
Hello,

The problem I'm seeing is that the snmptrapd.conf I dont think is being
accessed due to the script not being ran.

The snmptrapd.conf: now contains the following which Dave recommended:

   traphandle .1.3.6.1.6.3.1.1.5.1 /usr/bin/perl
/usr/local/share/snmp/cold.pl

I then used the following "cold.pl" perl script:

#!/usr/bin/perl -w

print "At last the coldStart handler is alive!!\n";

sub getline()
{
while ()
 {
  my $line =$_;
  chomp ($line);
  print $line;
  }
}
sub main()
{
  getline();
}
main();

Simple. It accepts lines from STDIN and prints them out. This looks ok?
So if I dont see any output line I dont think the configuration is being
accessed.
Can somebody enlighten me on this? Is it an environment issue, if so how can
I determine this?
The snmptrapd.conf is located in /usr/local/share/snmp.

I'm running the trapd and it does receive the coldStart trap I just dont see
my script being ran.

Cheers,
Garyc
- Original Message -
From: "Dave Shield" <[EMAIL PROTECTED]>
To: "Gary Clark" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, September 10, 2004 9:26 AM
Subject: Re: Adding traps


>
> > I can see the coldStart trap being received but my script is not run.
> >
> > Within the snmptrapd.conf file I added the following line:
> >
> > traphandle .1.3.6.1.6.3.1.5.1 /usr/bin/perl
/usr/local/share/snmp/cold.pl
>
> Try
>   traphandle .1.3.6.1.6.3.1.1.5.1 /usr/bin/perl
/usr/local/share/snmp/cold.pl
>
>
> Dave



---
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. 
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
___
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


Re: Adding traps

2004-09-10 Thread Gary Clark
Hi Dave,

Yep did that. Its looks like its doing something different.

I see it crashing with a "broken pipe"? Any ideas?

Cheers,
Garyc

- Original Message -
From: "Dave Shield" <[EMAIL PROTECTED]>
To: "Gary Clark" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, September 10, 2004 9:26 AM
Subject: Re: Adding traps


>
> > I can see the coldStart trap being received but my script is not run.
> >
> > Within the snmptrapd.conf file I added the following line:
> >
> > traphandle .1.3.6.1.6.3.1.5.1 /usr/bin/perl
/usr/local/share/snmp/cold.pl
>
> Try
>   traphandle .1.3.6.1.6.3.1.1.5.1 /usr/bin/perl
/usr/local/share/snmp/cold.pl
>
>
> Dave
>
>
>
> ---
> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> Project Admins to receive an Apple iPod Mini FREE for your judgement on
> who ports your project to Linux PPC the best. Sponsored by IBM.
> Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
> ___
> 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



---
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. 
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
___
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


Re: Adding traps

2004-09-10 Thread Dave Shield

> I can see the coldStart trap being received but my script is not run.
> 
> Within the snmptrapd.conf file I added the following line:
> 
> traphandle .1.3.6.1.6.3.1.5.1 /usr/bin/perl /usr/local/share/snmp/cold.pl

Try
  traphandle .1.3.6.1.6.3.1.1.5.1 /usr/bin/perl /usr/local/share/snmp/cold.pl


Dave



---
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. 
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
___
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


Adding traps

2004-09-10 Thread Gary Clark
Hello,

I cannot at present get the traphandle to call the traphandle script.

At present I can run the snmptrapd and I have configured the snmp.conf to
receive traps.
I can see the coldStart trap being received but my script is not run.

Within the snmptrapd.conf file I added the following line:

traphandle .1.3.6.1.6.3.1.5.1 /usr/bin/perl /usr/local/share/snmp/cold.pl

The perl script runs fine by itself.

I have placed the snmptrapd.conf within the directory /usr/local/share/snmp.

I cannot see the cold.pl script being ran since no output from the script is
seen.

Have I got to set some environment variable? I am running the trapd using:

./snmptrapd -f -Le

Any ideas? I know this should be obvious? Just missing something

Cheers,
Garyc



---
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. 
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
___
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