pch0317 | 1 Mar 21:37 2009
Picon

Re: snmptrap

ok, I read this document but i don't understand it very well.
I write:
snmptrap -v 1 -c public 127.0.0.1 "a" "10.0.0.1" "c" "d"
I only know that I:
(-v 1)   use SNMPv1,
(-c public)   use password,
but I'm not sure this fields:
(127.0.0.1)   Send I trap to this host?
(a)   I don't know what is it
(10.0.0.1)   In this place must be adress. Hmmm???
(c)   ???
(d)   ???

I don't know ASN.1 so please explain me this fields.
Thanks

Alexander Bubnov wrote:
> i think this helps
>
> http://www.net-snmp.org/tutorial/tutorial-5/commands/snmptrap.html
>
> 2009/2/20 pch0317 <pawelcholewinski <at> wp.pl>
>
>     Hello,
>     I want to sent trap from my localhost to my localhost with snmptrap
>     command, but I don't know how.
>     I write:
>     snmptrap -v 1 -c public .. and don't know what next.
>
>     Help me.
(Continue reading)

Dave Shield | 2 Mar 09:26 2009
Picon

Re: Retrieve Value

    [ First - *please* don't mail me privately, without copying
     any responses to the mailing list.  I don't have the time
     or inclination to offer private, unpaid, SNMP consultancy.
     Keep discussions to the list, where others can both learn
     and offer advice.  Thanks.   ]

2009/2/27 anand chandragandhi <chandragandhi.anand <at> gmail.com>:
> I am wiriting a C code level interface.

That's what I suspected.

> I can't use NETSNMP_DS_LIB_PRINT_BARE_VALUE as parmaneter to (print_variable
> or print_value API's)

Correct.  That's not how this value is used.

But that isn't what I suggested you do:

>> see ...the option parsing code in snmplib/mib.c

>>   In particular, look at using the tokens
>> NETSNMP_DS_LIB_PRINT_BARE_VALUE and
>> NETSNMP_DS_LIB_QUICK_PRINT

The code in question is the following block:

char *
snmp_out_toggle_options(char *options)
{
    while (*options) {
(Continue reading)

Tanisha Kashyap | 2 Mar 09:35 2009

Send Trap

Hi,

 

Is there any function which I can use within my agent code to send a trap when a certain condition has occurred?

 

 

"If you think you can, or you think you can't...You are Right"   -- Henry Ford

 


"DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error,please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus."
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Dave Shield | 2 Mar 09:37 2009
Picon

Re: snmptrap Tru64 V4.0F

2009/2/27 Hoyle, Steven <steven.hoyle <at> logica.com>:
> I can also send a trap as below:
> # snmptrap –c public xx.xx.xx.xx “” “” 6 99 “”
> And receive the Specific Trap on the monitoring host

Good.
Altough that particular command does assume you have
defined an enterprise-specific trap #99.

> but when I try to add a message at the end it doesn’t work...
> all I want is:
> # snmptrap –c public xx.xx.xx.xx “” “” “” “/ is 98% full please contact another” “”

SNMP notifications don't work that way.

All information is transported as "varbinds" - an (OID,type,value) triplet.
You can't simply shove in a text string, and expect the trap receiver
to understand what to do with it.

   You need to add a suitable varbind to the end of the trap command:

# snmptrap –c public xx.xx.xx.xx “” “” 6 99 “”
               someOID s "/ is 98% full please contact another”

(where you have defined the someOID object in an appropriate MIB)

> Hopefully there is an easy solution and any assistance would be appreciated.

The easy solution is probably to use the DISMAN-EVENT-MIB, which was
designed to handle just this sort of monitoring, and includes a dedicated
notification for reporting a threshold being exceeded.

See 'snmpd.conf(5)' under "DisMan Event MIB"

Dave

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Dave Shield | 2 Mar 10:33 2009
Picon

Re: Send Trap

2009/3/2 Tanisha Kashyap <tanisha.kashyap <at> aricent.com>:
> Is there any function which I can use within my agent code to send a trap
> when a certain condition has occurred?

Please see the FAQ entry
    "How can I get the agent to generate a trap (or inform)?"

You may also wish to look at the DisMan Event MIB section of snmpd.conf(5)

Dave

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Tanisha Kashyap | 2 Mar 10:37 2009

RE: Send Trap

I am writing the agent in perl. Will the functions given in the FAQ be usable for the perl code as well.

"If you think you can, or you think you can't...You are Right"   -- Henry Ford

-----Original Message-----
From: dave.shield <at> googlemail.com [mailto:dave.shield <at> googlemail.com] On Behalf Of Dave Shield
Sent: Monday, March 02, 2009 3:03 PM
To: Tanisha Kashyap
Cc: net-snmp-users <at> lists.sourceforge.net
Subject: Re: Send Trap

2009/3/2 Tanisha Kashyap <tanisha.kashyap <at> aricent.com>:
> Is there any function which I can use within my agent code to send a trap
> when a certain condition has occurred?

Please see the FAQ entry
    "How can I get the agent to generate a trap (or inform)?"

You may also wish to look at the DisMan Event MIB section of snmpd.conf(5)

Dave

"DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to
whom it is addressed. It may contain privileged or confidential information and should not be circulated
or used for any purpose other than for what it is intended. If you have received this message in
error,please notify the originator immediately. If you are not the intended recipient, you are notified
that you are strictly prohibited from using, copying, altering, or disclosing the contents of this
message. Aricent accepts no responsibility for loss or damage arising from the use of the information
transmitted by this email including damage from virus."

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Dave Shield | 2 Mar 10:27 2009
Picon

Re: snmptrap

2009/3/1 pch0317 <pch0317 <at> gmail.com>:
> ok, I read this document but i don't understand it very well.
> I write:
> snmptrap -v 1 -c public 127.0.0.1 "a" "10.0.0.1" "c" "d"
> I only know that I:
> (-v 1)   use SNMPv1,
> (-c public)   use password,
> but I'm not sure this fields:
> (127.0.0.1)   Send I trap to this host?
> (a)   I don't know what is it
> (10.0.0.1)   In this place must be adress. Hmmm???
> (c)   ???
> (d)   ???
>
> I don't know ASN.1 so please explain me this fields.

   $ man snmptrap
      snmptrap  -v 1 [COMMON OPTIONS]
           enterprise-oid agent generic-trap specific-trap uptime

[COMMON OPTION] covers both "-c public" and the trap destination
(127.0.0.1 - i.e. localhost - i.e. the machine you are running the command on).

So:
     "a"  -  enterprise-oid
     "10.0.0.1"  -  agent
     "c"  -  generic-trap
     "d"  -  specific-trap

and you are missing the final parameter "e" - uptime

Let's leave "enterprise-oid" for a moment.

"agent" (10.0.0.1) is an indication of the host where the trap is
being sent from.
This will default to the IP address of the local host, so is typically
left empty - ""

"generic-trap" and "specific-trap" indicate what tryp of trap is being sent.
There are six standard traps, with "generic-trap" values of 0..5.
   (In each case, "specific-trap" will have the value 0)
For everything else, you have to use a private (or "enterprise-specific") trap,
   with a "generic-trap" value of 6, and the "specific-trap" value indicating
   which private trap is being sent.

The missing parameter - uptime - is an indication of how long the
"sending SNMP engine" has been running.   This is not really relevant
for traps sent using the snmptrap command, so is typically left empty.
The command will fill in a suitable value automatically.

But there's a problem with interpreting private traps.
Suppose I have a set of private traps where:
   1 = My house is on fire
   2 = I've just been asked a silly question
    etc

and you have a different set of private traps where:
   1 = You've just won the lottery
   2 = You've just received a sarcastic answer
    etc

How should the trap receiver know what "trap 1" means?
Is it good news or bad?
  That's where "enterprise oid" comes in.

If the trap is one of my private traps, then it will be sent using my
enterprise oid (1.2.3.4.5)
If it's one of yours, then it will be send using your enterprise oid (9.8.7.6.5)

So
    snmptrap .... 1.2.3.4.5 ""  6 1  ""
                       is bad news ("My house is on fire")
while
    snmptrap .... 9.8.7.6.5 ""  6 1  ""
                       is good news ("You've just won the lottery")

If you're not sending a private trap, then again you would typically leave this
field empty, and the snmptrap command will fill in a suitable value.

So a coldStart trap (generic-trap #0) would be sent using

    snmptrap ....  ""  ""  0 0  ""

Dave

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Dave Shield | 2 Mar 10:45 2009
Picon

Re: Send Trap

2009/3/2 Tanisha Kashyap <tanisha.kashyap <at> aricent.com>:
> I am writing the agent in perl. Will the functions given in the
> FAQ be usable for the perl code as well.

No idea.
Suck it and See.

A quick look at the perl agent documentation doesn't include
any mention of traps, and neither does a quick scan of the perl code.
So I suspect this may not be supported.
   But I'm no expert on the perl agent module.

Dave

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

malar vizhi | 2 Mar 12:44 2009
Picon

UCD-SNMP-MIB returns Empty

Hi,

    When I query with UCD-SNMP-MIB returns empty result.

My cmd::

snmpwalk -v 1 -c public 192.168.1.172 UCD-SNMP-MIB::.1.3.6.1.4.1.2021

What would be the problem?....Is there any configuration should I made?...{ UCD-SNMP-MIB is available under mib directory...}

Am using net-snmp 5.4.2 & OS is Windows 2000...And I checked with HP-UX machine also...but am getting same response...

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Sorrell, Al | 2 Mar 17:30 2009

Odd Perl error with Net-SNMP 5.4.2.1


Environment: Solaris 8, SNMP Version 5.04021 (built from tarball)
Perl: This is perl, v5.8.5 built for sun4-solaris

I have a problem with one of my existing programs which is based on the
bulkwalk.pl example from the Perl examples directory.

This had worked fine in the past using SNMP V5.1.1 but fails under
5.4.2.1. The bulkwalk.pl sample program also fails in the same fashion:

$ bulkwalk.pl
Not an ARRAY reference at bulkwalk.pl line 65.

The area around line 65 is:
resp = $sess->bulkwalk(2, 8, $vars);
die "Cannot do bulkwalk: $sess->{ErrorStr} ($sess->{ErrorNum})\n"
                                                        if
$sess->{ErrorNum};
for $vbarr (  <at> resp ) {
    # Determine which OID this request queried.  This is kept in the
VarList
    # reference passed to bulkwalk().
    $oid = $$vars[$i++]->tag();

    # Count the number of responses to this query.  The count will be 1
for
    # non-repeaters, 1 or more for repeaters.
    $num = scalar  <at> $vbarr;				<<<<<<< This is
line 65
    print "$num responses for oid $oid: \n";

It appears that Perl is unhappy with the attempt to use vbarr as an
array.

Anyone have any ideas?

_________________________
Almon (Al) Sorrell
Corporate Network Services | Network Engineering Consultant
T. Rowe Price 
4515 Painters Mill Road, TE9008
Owings Mills, MD 21117
Phone: 410-345-3042 (508-3042)  Fax:410-345-3030
Email: Al_Sorrell <at> troweprice.com

T. Rowe Price (including T. Rowe Price Group, Inc. and its affiliates) and its associates do not provide
legal or tax advice.  Any tax-related discussion contained in this e-mail, including any attachments, is
not intended or written to be used, and cannot be used, for the purpose of (i) avoiding any tax penalties or
(ii) promoting, marketing, or recommending to any other party any transaction or matter addressed
herein.  Please consult your independent legal counsel and/or professional tax advisor regarding any
legal or tax issues raised in this e-mail.

The contents of this e-mail and any attachments are intended solely for the use of the named addressee(s)
and may contain confidential and/or privileged information. Any unauthorized use, copying,
disclosure, or distribution of the contents of this e-mail is strictly prohibited by the sender and may be
unlawful. If you are not the intended recipient, please notify the sender immediately and delete this e-mail.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Gmane