Summary: | ASTERISK-09805: Bad operator (OBJECT-IDENTIFIER): At line 739 in /usr/local/share/snmp/mibs/ASTERISK-MIB | ||
Reporter: | matti (matti) | Labels: | |
Date Opened: | 2007-07-05 04:09:53 | Date Closed: | 2007-08-23 12:09:05 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Resources/res_snmp |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) 10118-fix.patch | |
Description: | Net-SNMP 5.4 reports an error in ASTERISK-MIB. Linux lk10 2.6.22-rc7 #2 SMP PREEMPT Mon Jul 2 11:28:05 EEST 2007 i686 unknown unknown GNU/Linux ****** ADDITIONAL INFORMATION ****** lk10:/usr/local/share/snmp # /usr/local/bin/snmptable -v 3 localhost .1.3.6.1.4 .1.22736.1.5.2 Bad operator (OBJECT-IDENTIFIER): At line 739 in /usr/local/share/snmp/mibs/ASTE RISK-MIB Was that a table? DIGIUM-MIB::digium.1.5.2 | ||
Comments: | By: Jason Parker (jparker) 2007-07-06 12:33:24 jeffg, could you take a look at this when you get a chance? By: Jeff Gehlbach (jeffg) 2007-08-22 12:29:57 Attached file 10118-fix.patch, which fixes the typo in the MIB definition that caused the "Bad operator" message, and also fixes the SNMP agent code to correct the behavior of astNumChanBridged to be a Counter again. My new Mantis-based disclaimer is still pending, but I have a paper one on file, so pasting the short patch here as well. Index: doc/asterisk-mib.txt =================================================================== --- doc/asterisk-mib.txt (revision 80290) +++ doc/asterisk-mib.txt (working copy) @@ -736,7 +736,7 @@ "Number of active channels using the current technology." ::= { astChanTypeEntry 7 } -astChanScalars OBJECT-IDENTIFIER ::= { asteriskChannels 5 } +astChanScalars OBJECT IDENTIFIER ::= { asteriskChannels 5 } astNumChanBridge OBJECT-TYPE SYNTAX Gauge32 @@ -744,6 +744,6 @@ STATUS current DESCRIPTION "Number of channels currently in a bridged state." - ::= { asteriskChanScalars 1 } + ::= { astChanScalars 1 } END Index: res/snmp/agent.c =================================================================== --- res/snmp/agent.c (revision 80290) +++ res/snmp/agent.c (working copy) @@ -138,7 +138,8 @@ #define ASTCHANTYPETRANSFER 6 #define ASTCHANTYPECHANNELS 7 -#define ASTCHANBRIDGECOUNT 5 +#define ASTCHANSCALARS 5 +#define ASTCHANBRIDGECOUNT 1 void *agent_thread(void *arg) { @@ -546,9 +547,10 @@ static u_char *ast_var_channel_bridge(struct variable *vp, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method) { - static unsigned long long_ret = 0; + static unsigned long long_ret; struct ast_channel *chan = NULL; + long_ret = 0; if (header_generic(vp, name, length, exact, var_len, write_method)) return NULL; @@ -778,7 +780,7 @@ {ASTCHANTYPEINDICATIONS, ASN_INTEGER, RONLY, ast_var_channel_types_table, 4, {ASTCHANNELS, ASTCHANTYPETABLE, 1, ASTCHANTYPEINDICATIONS}}, {ASTCHANTYPETRANSFER, ASN_INTEGER, RONLY, ast_var_channel_types_table, 4, {ASTCHANNELS, ASTCHANTYPETABLE, 1, ASTCHANTYPETRANSFER}}, {ASTCHANTYPECHANNELS, ASN_GAUGE, RONLY, ast_var_channel_types_table, 4, {ASTCHANNELS, ASTCHANTYPETABLE, 1, ASTCHANTYPECHANNELS}}, - {ASTCHANBRIDGECOUNT, ASN_GAUGE, RONLY, ast_var_channel_bridge, 2, {ASTCHANNELS, ASTCHANBRIDGECOUNT}}, + {ASTCHANBRIDGECOUNT, ASN_GAUGE, RONLY, ast_var_channel_bridge, 3, {ASTCHANNELS, ASTCHANSCALARS, ASTCHANBRIDGECOUNT}}, }; register_sysORTable(asterisk_oid, OID_LENGTH(asterisk_oid), By: Digium Subversion (svnbot) 2007-08-23 12:09:05 Repository: asterisk Revision: 80510 ------------------------------------------------------------------------ r80510 | russell | 2007-08-23 12:09:04 -0500 (Thu, 23 Aug 2007) | 3 lines Fix a typo in the Asterisk MIB and fix astNumChanBridged so it acts as a counter again (closes issue ASTERISK-9805, patch by jeffg) ------------------------------------------------------------------------ |