------------------ Original ------------------
From: "Dave Shield"<d.t.shi...@liverpool.ac.uk>;
Date: Sat, Apr 24, 2010 04:52 PM
To: "Alexander King"<chenyapu1...@qq.com>; "Mike
Ayers"<mike_ay...@tva.tvworks.com>;
Cc: "net-snmp-users"<net-snmp-users@lists.sourceforge.net>;
Subject: Re: send a trap and location the specify column in multiple rows(the
sametable)
On 23 April 2010 22:07, Mike Ayers <mike_ay...@tva.tvworks.com> 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