RE: send a trap and location the specify column in multiple rows(the sametable)

2010-04-23 Thread Mike Ayers
> From: Alexander King [mailto:chenyapu1...@qq.com]
> Sent: Friday, April 23, 2010 3:06 AM

> 1.where I can fill with the warning information when the trap send?

It depends - see below.

> 2.If the trap OBJECTS is a scalar,I can configure snmpd.conf,use DisMan
> monitor the value,and send trap,The NOTIFICATION-TYPE defination is not
> necessary,is it right?

Correct - it is already defined as part of DisMan.

> But how do I implement this method if I want to monitor the value that
> is a column in one table?

I believe the DisMan table can only moitor scalars.

> 3.How can I exactly location the column in multiple rows(the same
> table)when I send a trap?
> just a example,a piece of my mib file:
> HostInterfaceFCEntry ::=
> SEQUENCE {
>  fcConnections
>   Integer32,
>  fcPort
>   DisplayString,
>  fcStatus
>   INTEGER,
>  fcWWN
>   DisplayString,
>  fcSpeed
>   Counter32,
>  fcTopology
>   Unsigned32
> }
> 
> and my trap:
> fcTrap NOTIFICATION-TYPE
> OBJECTS {
>   fcPort,
>   fcStatus
>   }
> STATUS current
> DESCRIPTION "This is just a demo"
> ::= { trapTestingTrapTwoPrefix 1 }
> 
> 
> Here I want to the trapd routine can tell the receiver which fcport's
> status changed,so I put two column values in OBJECTS domain,but in my
> prototype implement,I failed.
> Who can tell me how to implement this?

The same way you would implement a get for the same object.   If you 
want to emit the notification for certain values of the object, or just 
whenever it changes, put the check in the commit phase of your set handler.


HTH,

Mike

--
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: send a trap and location the specify column in multiple rows(the sametable)

2010-04-24 Thread Dave Shield
On 23 April 2010 22:07, Mike Ayers  wrote:
>> But how do I implement this method if I want to monitor the value that
>> is a column in one table?
>
>        I believe the DisMan table can only moitor scalars.

Nonsense!

The DisMan Event MIB can monitor both scalars and table
elements quite happily.   *All* the examples discussed in
the documentation are table-based monitors - both the
linkUp/Down processing (monitoring elements from the ifTable),
and the UCD-specific "defaultMonitors" configuration
(monitoring elements from the various UCD tables).

Please re-read the descriptions in RFC 2981 of how the Event
MIB works, paying particular attention to the discussion of
objects vs instances.

Dave

--
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


RE: send a trap and location the specify column in multiple rows(the sametable)

2010-04-26 Thread Mike Ayers

> From: dave.shi...@googlemail.com [mailto:dave.shi...@googlemail.com] On
> Behalf Of Dave Shield
> Sent: Saturday, April 24, 2010 1:52 AM

> >        I believe the DisMan table can only moitor scalars.
> 
> Nonsense!

Whoops!  My rust is showing.  Time for some serious farting around with 
no particular objective...


Sorry,

Mike

--
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: send a trap and location the specify column in multiple rows(the sametable)

2010-07-02 Thread Alexander King
-- Original --
  From:  "Dave Shield";
 Date:  Sat, Apr 24, 2010 04:52 PM
 To:  "Alexander King"; "Mike 
Ayers"; 
 Cc:  "net-snmp-users"; 
 Subject:  Re: send a trap and location the specify column in multiple rows(the 
sametable)

  
 On 23 April 2010 22:07, Mike Ayers  wrote:
>> But how do I implement this method if I want to monitor the value that
>> is a column in one table?
>
>I believe the DisMan table can only moitor scalars.
Nonsense!
 
The DisMan Event MIB can monitor both scalars and table
elements quite happily.   *All* the examples discussed in
the documentation are table-based monitors - both the
linkUp/Down processing (monitoring elements from the ifTable),
and the UCD-specific "defaultMonitors" configuration
(monitoring elements from the various UCD tables).
Please re-read the descriptions in RFC 2981 of how the Event
MIB works, paying particular attention to the discussion of
objects vs instances.
  
 >> Your meaning is the DisMan can deal with the table objects monitor,can you 
 >> give me a example?
 and how the sentv2trap deal with when the monitor object is one column of the 
row?
  
 That is to say,How I can mapping the data in the send_uitUPSTraps_trap( void ) 
function,especially the 
 upsXID,upsStatus are the columns in the table?
  
 Should I just do the thing use DisMan way and config the snmpd.conf?

  
 int
send_uitUPSTraps_trap( void )
{
netsnmp_variable_list  *var_list = NULL;
oid uitUPSTraps_oid[] = { 1,3,6,1,4,1,30901,2090,7000,5,0,22 };
oid upsXID_oid[] = { 1,3,6,1,4,1,30901,2090,7000,2,2,4,1,1,2, /* insert 
tableindex here */ };
oid upsStatus_oid[] = { 1,3,6,1,4,1,30901,2090,7000,2,2,4,1,1,8, /* insert 
tableindex here */ };
 /*
 * Set the snmpTrapOid.0 value
 */
snmp_varlist_add_variable(&var_list,
snmptrap_oid, OID_LENGTH(snmptrap_oid),
ASN_OBJECT_ID,
uitUPSTraps_oid, sizeof(uitUPSTraps_oid));
 /*
 * Add any objects from the trap definition
 */
snmp_varlist_add_variable(&var_list,
upsXID_oid, OID_LENGTH(upsXID_oid),
ASN_OCTET_STR,
/* Set an appropriate value for upsXID */
NULL, 0);
snmp_varlist_add_variable(&var_list,
upsStatus_oid, OID_LENGTH(upsStatus_oid),
ASN_INTEGER,
/* Set an appropriate value for upsStatus */
NULL, 0);
 /*
 * Add any extra (optional) objects here
 */
 /*
 * Send the trap to the list of configured destinations
 *  and clean up
 */
send_v2trap( var_list );
snmp_free_varbind( var_list );
 return SNMP_ERR_NOERROR;
}--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users