about nlmLogVariableTable and nlmLogVariable*Val OIDs
Raphaël 'SurcouF' Bordet <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I've successfully set snmpd and snmptrapd to work together using
NOTIFICATION-LOG-MIB support :
$ snmptrap -e 0x8000000001020304 localhost 0 linkUp.0 ifIndex i 4
ifAdminStatus i 1 ifOperStatus i 2
/----( /var/log/syslog )----
...
Sep 30 16:03:04 localhost snmptrapd[26264]: 2009-09-30 16:03:04
localhost [UDP: [127.0.0.1]:60500]: DISMAN-EVENT-MIB::sysUpTimeInstance
= Timeticks: (0) 0:00:00.00^ISNMPv2-MIB::snmpTrapOID.0 = OID:
IF-MIB::linkUp.0^IIF-MIB::ifIndex = INTEGER: 4^IIF-MIB::ifAdminStatus =
INTEGER: up(1)^IIF-MIB::ifOperStatus = INTEGER: down(2)
...
\---8<---8<---8<---8<---8<---
And when I'm walking nlmLogTable :
$ snmpwalk -n snmptrapd localhost nlmLogTable
NOTIFICATION-LOG-MIB::nlmLogTime."default".1 = Timeticks: (417)
0:00:04.17
NOTIFICATION-LOG-MIB::nlmLogDateAndTime."default".1 = STRING:
2009-9-30,16:3:4.0,+2:0
NOTIFICATION-LOG-MIB::nlmLogEngineID."default".1 = Hex-STRING: 80 00 00
00 01 02 03 04
NOTIFICATION-LOG-MIB::nlmLogEngineTAddress."default".1 = Hex-STRING: 01
00 00 7F 54 EC
NOTIFICATION-LOG-MIB::nlmLogEngineTDomain."default".1 = OID:
SNMPv2-TM::snmpUDPDomain
NOTIFICATION-LOG-MIB::nlmLogContextEngineID."default".1 = Hex-STRING: 80
00 1F 88 80 9C 94 EA 40 18 65 C3 4A
NOTIFICATION-LOG-MIB::nlmLogContextName."default".1 = STRING:
NOTIFICATION-LOG-MIB::nlmLogNotificationID."default".1 = OID:
IF-MIB::linkUp.0
nlmLogVariableIndex is defined as an index then as a colum.
This attached patch remove the second declaration.
After applying this patch :
$ snmpwalk -n snmptrapd localhost nlmLog
NOTIFICATION-LOG-MIB::nlmLogTime."default".1 = Timeticks: (5896)
0:00:58.96
NOTIFICATION-LOG-MIB::nlmLogDateAndTime."default".1 = STRING:
2009-9-30,18:30:54.0,+2:0
NOTIFICATION-LOG-MIB::nlmLogEngineID."default".1 = Hex-STRING: 80 00 1F
88 80 43 D4 05 45 76 36 C2 4A
NOTIFICATION-LOG-MIB::nlmLogEngineTAddress."default".1 = Hex-STRING: 01
00 00 7F 45 92
NOTIFICATION-LOG-MIB::nlmLogEngineTDomain."default".1 = OID:
SNMPv2-TM::snmpUDPDomain
NOTIFICATION-LOG-MIB::nlmLogContextEngineID."default".1 = Hex-STRING: 80
00 1F 88 80 43 D4 05 45 76 36 C2 4A
NOTIFICATION-LOG-MIB::nlmLogContextName."default".1 = STRING:
NOTIFICATION-LOG-MIB::nlmLogNotificationID."default".1 = OID:
IF-MIB::linkUp.0
NOTIFICATION-LOG-MIB::nlmLogVariableID."default".1.1 = OID:
DISMAN-EVENT-MIB::sysUpTimeInstance
NOTIFICATION-LOG-MIB::nlmLogVariableID."default".1.2 = OID:
IF-MIB::ifIndex
NOTIFICATION-LOG-MIB::nlmLogVariableID."default".1.3 = OID:
IF-MIB::ifAdminStatus
NOTIFICATION-LOG-MIB::nlmLogVariableID."default".1.4 = OID:
IF-MIB::ifOperStatus
NOTIFICATION-LOG-MIB::nlmLogVariableValueType."default".1.1 = INTEGER:
timeTicks(3)
NOTIFICATION-LOG-MIB::nlmLogVariableValueType."default".1.2 = INTEGER:
integer32(4)
NOTIFICATION-LOG-MIB::nlmLogVariableValueType."default".1.3 = INTEGER:
integer32(4)
NOTIFICATION-LOG-MIB::nlmLogVariableValueType."default".1.4 = INTEGER:
integer32(4)
I'm getting more OID in nlmLogVariableTable :
- nlmLogVariableID ;
- nlmLogVariableValueType.
But, no OID like :
- nlmLogVariableTimeTicksVal (6) ;
- nlmLogVariableInteger32Val (7) ;
- nlmLogVariableOctetStringVal (8).
Be enabling DEBUG mode using notification_mog, I'm getting theses
following messages whan receiving incoming INFORM :
Oct 22 09:39:28 admin4 snmptrapd[3288]: 2009-10-22 09:39:28 localhost
[UDP: [127.0.0.1]:52894]: DISMAN-EVENT-MIB::sysUpTimeInstance =
Timeticks: (0) 0:00:00.00^ISNMPv2-MIB::snmpTrapOID.0 = OID:
IF-MIB::linkUp.0^IIF-MIB::ifIndex = INTEGER: 4^IIF-MIB::ifDescr =
STRING: eth0^IIF-MIB::ifOperStatus = INTEGER: testing(3)
notification_log: logging something
notification_log: adding a row to the variables table. Name: 6. Type:
67. Value: 165287512. Len: 4
notification_log: adding a row to the variables table. Name: 7. Type: 2.
Value: 165288696. Len: 4
notification_log: adding a row to the variables table. Name: 8. Type: 4.
Value: 165289288. Len: 4
notification_log: adding a row to the variables table. Name: 7. Type: 2.
Value: 165289880. Len: 4
You need to modify again notification_log.c :
---
net-snmp-5.4.1.orig/agent/mibgroup/notification-log-mib/notification_log.c 2009-10-06 10:56:34.000000000 +0200
+++
net-snmp-5.4.1/agent/mibgroup/notification-log-mib/notification_log.c
2009-10-21 15:27:22.000000000 +0200
@@ -697,7 +688,8 @@
netsnmp_set_row_column(myrow, col, vptr->type,
vptr->val.string, vptr->val_len);
DEBUGMSGTL(("notification_log",
- "adding a row to the variables table\n"));
+ "adding a row to the variables table. Name: %d.
Type: %d. Value: %d. Len: %d\n",
+ col, vptr->type, vptr->val.string, vptr->val_len));
netsnmp_table_dataset_add_row(nlmLogVarTable, myrow);
}
}
Why any nlmLogVariable*Val OIDs are empty ?
Regards,
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
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
notification_log-nlmLogVariableIndexcolumn.patch
(text/x-patch, 886 B)
--- net-snmp-5.4.1.orig/agent/mibgroup/notification-log-mib/notification_log.c 2007-03-13 00:09:39.000000000 +0100
+++ net-snmp-5.4.1/agent/mibgroup/notification-log-mib/notification_log.c 2009-09-30 18:01:36.000000000 +0200
@@ -188,15 +188,6 @@
netsnmp_table_dataset_add_index(table_set, ASN_UNSIGNED);
/*
- * adding column nlmLogVariableIndex of type ASN_UNSIGNED and access
- * of NoAccess
- */
- DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
- "adding column nlmLogVariableIndex (#1) of type ASN_UNSIGNED to table nlmLogVariableTable\n"));
- netsnmp_table_set_add_default_row(table_set,
- COLUMN_NLMLOGVARIABLEINDEX,
- ASN_UNSIGNED, 0, NULL, 0);
- /*
* adding column nlmLogVariableID of type ASN_OBJECT_ID and access of
* ReadOnly
*/