Re: ALTERNATIVES TO (?): RE: How do I get the DISMAN-TRACEROUTE-MIB "into" my SNMP Agent?
Wes Hardaker <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Organization | Sparta |
| Message-ID | <[email protected]> |
MPP> If you, or someone, could even tell me that what I am trying to do isn't MPP> possible, I'll just slog along with individual entries. This method, MPP> however, offers no flexibility to me if a route changes, even though the MPP> scripts collecting the traceroute data will shift and produce new route MPP> lists if the route changes. In that case, I would not know that I was MPP> missing those hops until I checked. Then, I would have to build MPP> additional OID's for them. *If* I understand the problem :-/ you're trying to solve, then it is possible to construct the solution you want using code of some-kind. But you're not going to be able to do it using the simple snmpd.conf directives. You'll need either a C-implementation or a perl implementation or a pass_through script of some kind to handle the complexity of the table you're talking about. -- Wes Hardaker Cobham Analytic Solutions From: "PEOPLES, MICHAEL P (ATTSI)" <[email protected]> Subject: Complex Arbitrary Command Extension using SNMP To: <[email protected]> Content-class: urn:content-classes:message X-Sent: 1 week, 6 days, 21 hours, 31 minutes, 29 seconds ago X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: Complex Arbitrary Command Extension using SNMP I have learned how to execute arbitrary commands, invoked by a pre-defined OID that I create using an "exec" command in the snmpd.conf file. Example: exec .1.3.6.1.4.1.2001.65.1.101.1.1 hoplist_1 /usr/bin/cat /export/home/hopuser/traceroute.host_1.hoplist This would produce a list of the traceroute hops between the host and a remote host. However, it is effectively "hard-coded" for every host and producing a single hop time requires yet more hard-coded OID's. What I am trying to do is, create a "dynamic" set of extensions that function similar to IF-MIB. I have a pre-defined list of hosts that I want to do a traceroute to. I have created an OID like the one above that produces a list of these targets when an snmpwalk is issued against it. Example: snmpwalk -O n -c public -v 2c myhost.att.com .1.3.6.1.4.1.2001.65.1.101 Produces: .1.3.6.1.4.1.2001.65.1.1.101.1 = STRING: "remote.host_1.att.com" .1.3.6.1.4.1.2001.65.1.1.101.2 = STRING: "remote.host_2.att.com" .1.3.6.1.4.1.2001.65.1.1.101.3 = STRING: "remote.host_3.att.com" .1.3.6.1.4.1.2001.65.1.1.101.4 = STRING: "remote.host_4.att.com" .1.3.6.1.4.1.2001.65.1.1.101.5 = STRING: "remote.host_5.att.com" .1.3.6.1.4.1.2001.65.1.1.101.6 = STRING: "remote.host_6.att.com" .1.3.6.1.4.1.2001.65.1.1.101.7 = STRING: "remote.host_7.att.com" .1.3.6.1.4.1.2001.65.1.1.101.8 = STRING: "remote.host_8.att.com" Now, I can create an entry that will "enumerate" the preceding (this is where things are getting a bit fuzzy for me). Example: exec .1.3.6.1.4.1.2001.65.1.101.1.3 targetCount /export/home/hopuser/countHopTargets.ksh Using an snmpwalk against this OID produces an "index" of the of all the hosts I want to trace. Example snmpwalk -O n -c public -v 2c myhost.att.com .1.3.6.1.4.1.2001.65.1.3.101 Produces: .1.3.6.1.4.1.2001.65.1.1.101.1.3.101.1 = STRING: "1" .1.3.6.1.4.1.2001.65.1.1.101.1.3.101.2 = STRING: "2" .1.3.6.1.4.1.2001.65.1.1.101.1.3.101.3 = STRING: "3" .1.3.6.1.4.1.2001.65.1.1.101.1.3.101.4 = STRING: "4" .1.3.6.1.4.1.2001.65.1.1.101.1.3.101.5 = STRING: "5" .1.3.6.1.4.1.2001.65.1.1.101.1.3.101.6 = STRING: "6" .1.3.6.1.4.1.2001.65.1.1.101.1.3.101.7 = STRING: "7" .1.3.6.1.4.1.2001.65.1.1.101.1.3.101.8 = STRING: "8" Furthermore, I have an OID that will produce a count of the number of trace targets. exec .1.3.6.1.4.1.2001.65.1.101.1.1 numberOfTargets /export/home/hopuser/numberOfTargets.ksh Using an snmpget on the above displays a count of the trace targets. snmpget -O n -c public -v 2c myhost.att.com .1.3.6.1.4.1.2001.65.1.1.101.1 Produces: .1.3.6.1.4.1.2001.65.1.1.101.1 = STRING: "11" So, I have in place the elements that will provide a list of the trace targets, enumerate each, and provide a count of the total number of targets. I have a script, run periodically by cron, that performs the traceroute, then places the hop time into files named specifically for that hop and located in a directory named for the trace target. For example, traceroute www.ibm.com would produce the following files (incomplete list): /export/home/hopuser/www.ibm.com/135.294.13.5 /export/home/hopuser/www.ibm.com/4.69.145.243 /export/home/hopuser/www.ibm.com/4.68.132.104 /export/home/hopuser/www.ibm.com/4.53.0.90 Each file contains the hop times in milliseconds for each host traced. So, to the crux of my question, what I want to be able to is walk an OID (child of the root OID, assumedly .1.3.6.1.4.1.2001.65.1.1.101.1 from above) in a manner that will allow me to bring back all data for all traced hosts in a "structured" manner, such that an external program can read and display it. In this case, I'm using Cacti. I have looked at the IF-MIB and related files in Cacti. It seems to do what I want in that it dynamically determines all of the interfaces on the server, then from that can display interface-specific information for each. From the above, the equivalent "child" on IF-MIB would be: My OID From Above (walk or get) IF-MIB OID ============================ ========================================= .1.3.6.1.4.1.2001.65.1.101 .1.3.6.1.2.1.2.2.1.2 (IF-MIB::ifDescr.X) .1.3.6.1.4.1.2001.65.1.1.101.1 .1.3.6.1.2.1.2.1.0 (IF-MIB::ifNumber.0) .1.3.6.1.4.1.2001.65.1.3.101 .1.3.6.1.2.1.2.2.1.1 (IF-MIB::ifIndex.X) The interfaces referenced by IF-MIB would be equivalent to my "traced host" name. Each would provide a "branch" off the root OID that could be queried for a list of hops, which in turn would have their individual hop times. I realize that the above structure is wrong, so that's why I'm coming to the experts. I want to be able to do this for other functions, without having to write an agent or build MIB's. I see it structured something like this: <Number Of Traced Hosts> | --<Trace Host Enumeration> | --<Trace Host Name (Descr)> | --<Number Of Hops> | --<Hop Enumeration> | --<Hop Name (Descr)> | --<Hops Time> Cacti allows me to provide it structured index (or indices), and it will go and get the appropriate "terminal" OID's for all branches. What I need is the "OID structure" that will allow me to treat my hop times as IF-MIB treats such things like ifInsOctets. I'm aware that what I may be asking cannot be done using the "exec" functions in snmpd.conf. If it does work, then it would make lots of structured data available via this universally supported protocol. Thanks for wading through all of this and for any help you can offer. Michael ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ---------- -- Wes Hardaker Cobham Analytic Solutions ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ 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