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

Reply via email to