Re: [Synalist] RE : RE : SNMPGetTable error?

2011-07-15 Thread John Repucci
For my application, I do not need or want the entire set of
information in .ipRouteTable
returned; I just want .ipRouteTable.ipRouteDest and .ipRouteTable.ipRouteMask.
Using SNMPGetTable as it was intended is too slow (as the code mentions) and
would cause too much post-processing on my part.  However, I liked the array
feature of SNMPGetTable.

My solution was to clone SNMPGetTable as SNMPWalk and remove the
concatenation feature of SNMPGetTable.  I'm also considering removing the
quotes from SNMPWalk, as I just remove them anyhow before I convert the IP
addresses to a Int64.  This later change would be inconsistent with every
other bit of data return, so I'm still pondering it.  However, when I have
to start importing multiple set of  routing tables with > 5000 entries each,
I will probably start looking for every time savings I can get.

If a function already exists similar to SNMPWalk, please let me know.  I
would prefer to stay with unmodified code.

Thanks.
--
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev___
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public


[Synalist] RE : RE : SNMPGetTable error?

2011-07-15 Thread Ludo Brands
SNMPGetTable get's the entries in the table pointed to by OID. In our case
OID= .iso.org.dod.internet.mgmt.mib-2.ip.ipRouteTable. The entries are
ipRouteTable.ipRouteEntry  and elements are
ipRouteTable.ipRouteEntry.ipRouteDest, etc. To group elements in an
entry you drop the ipRouteDest,etc which is what fetch(row, '.') does. 
If you want one line per route you'll need to a SNMPGetTable of
1.3.6.1.2.1.4.21.1 instead of 1.3.6.1.2.1.4.21.1.1. You'll get all the
elements per line (next hop, mask, etc.)  but that is similar to the
"Routing table" tab in Getif. In other words: the ipRouteTable is made up of
ipRouteEntry's, not of ipRouteDest's.
 
So, SNMPGetTable gets you the table at OID (ie. entries below OID). What you
are looking for is a filter on replies starting with OID.
 
Ludo
 
 

-Message d'origine-
De : John Repucci [mailto:john.repu...@gmail.com] 
Envoyé : vendredi 15 juillet 2011 03:36
À : Ararat Synapse
Objet : Re: [Synalist] RE : SNMPGetTable error?


I'm now using v4 and I have the same issue.

I added two routes to my test router: 10.0.0.0/32 & 12.0.0.0/8 and
SNMPGetTable returns both of them on one line as "10.0.0.0","12.0.0.0".  

The above routes are clearly not default routes and they should not be
combined.

This appears to happen because SNMPGetList sets the index variable x to 0
for any route whose 2,3 & 4 octet's = '0.0.0'  and the following code
combines routes thus identified into row 0.

The function   row := separateright(oid, baseoid + '.');does return the
correct and full IP address, but after col := fetch(row, '.');   row only
contains the last three octets.  Fetch appears to remove the 1st octet from
the string contained in "row".
"col" does not appear to be used. 

If I comment out the col := fetch(row, '.');  line, SNMPGetTable works as
expected.

What is that line doing and does it need to be there?


Variable values for the 12.0.0.0 route 
BASEOID:  0x5f0704 '1.3.6.1.2.1.4.21.1.1'
OID:   0x5b2f0 '1.3.6.1.2.1.4.21.1.1.12.0.0.0'

ROW  0x3b14b20 '0.0.0'

Network/MaskProtoAge Slot Cost  NextHop Address AS
--- -- -  -  -
10.0.0.0/32 Static401 1 192.168.170.254
12.0.0.0/8  Static 41 1 192.168.170.254
192.168.170.128/25  Direct 125621 0 192.168.170.254
192.168.255.78/32   Direct 125621 0 192.168.255.78





--
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev___
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public