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

"Alexander King" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
------------------ Original ------------------
  From:  "Dave Shield"<[email protected]>;
 Date:  Sat, Apr 24, 2010 04:52 PM
 To:  "Alexander King"<[email protected]>; "Mike Ayers"<[email protected]>; 
 Cc:  "net-snmp-users"<[email protected]>; 
 Subject:  Re: send a trap and location the specify column in multiple rows(the sametable)

  
 On 23 April 2010 22:07, Mike Ayers <[email protected]> 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
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
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.