I'm trying to create a pass-through script (in Perl) to retrieve Bacula (backup system - http://bacula.org) using indexed (with two indexed tables) information.
All the statistics information for Bacula is in an SQL server, which my script retrieves (correctly)... I've managed to follow and understand (? :) the 'Inter-Table Indexing in SNMP MIBs' at http://www.snmpinfo.com/tables.pdf and came up with this (subpart) MIB (The full MIB goes through 'smilint' without warnings and errors): ----- s n i p ----- OID_BASE +--baculaStats(3) | +-- r-n Integer32 baculaTotalClients(1) +-- r-n Integer32 baculaTotalTypes(2) +-- r-n Integer32 baculaTotalStats(3) | +--baculaClientsTable(4) | | | +--baculaClientsEntry(1) [baculaIndexClients] | | | +-- --- CounterIndex baculaIndexClients(1) | +-- r-n DisplayString baculaClientName(2) | +-- r-n DisplayString baculaJobName(3) | +--baculaStatsTable(5) | +--baculaStatsEntry(1) [baculaIndexClients,baculaIndexStats] | +-- --- CounterIndex baculaIndexStats(1) +-- r-n DisplayString baculaCounterName(2) +-- r-n DisplayString baculaJobID(3) +-- r-n DisplayString baculaDateStart(4) +-- r-n DisplayString baculaDateEnd(5) +-- r-n Integer32 baculaCompletionDuration(6) +-- r-n Integer32 baculaCompletionFiles(7) +-- r-n Integer32 baculaCompletionBytes(8) ----- s n i p ----- The idea was to create these two columns (sorry if it linewraps): ----- s n i p ----- ClientsTable: client1 client2 client3 client4 ==================================================== Client1Job1 Client2Job1 Client3Job1 Client4Job1 Client1Job2 Client1Job3 Client1Job4 StatusTable: JobID StartDate EndDate Duration Files Bytes ============================================================================================== Client1Job1.2005-09-10_03.00.00 20050910132844Z 20050911012917Z 43233 0 0 Client1Job1.2005-09-12_03.00.00 20050912132925Z 00000000000000Z -1 0 0 Client1Job1.2005-09-15_03.00.01 20050915075630Z 20050915101658Z 8428 97646 2749710101 ----- s n i p ----- I'm not absolutely sure about the ClientsTable, but this was the only one that made ANY sence... The only client that have more than one job name is 'client1'. The other only have one job name. The reason it looks like this is that Bacula use the following 'tree' to describe it's statistic in the SQL database (yes, duration is missing - I calculate that in my script): client name +-- job name +-- job id +-- start date +-- end date +-- files +-- bytes The 'job name' can (is for me) for example 'ClientX_System', 'ClientX_Catalog', 'ClientX_Mail', 'ClientX_Web' etc, etc... This so that it's easier to find the correct (tape) volume etc when/if a restore needs to be made... The problem I'm having is how to join these tables in/from the Perl script... This is what I've come up with so far (this is naturally not what is sent to the agent but from my debug logs with some lead text to simplify for me to read it): ----- s n i p ----- => OID_BASE.totalClients.0 OID_BASE.1.0 4 => OID_BASE.totalTypes.0 OID_BASE.2.0 5 => OID_BASE.totalStats.0 OID_BASE.3.0 136 => OID_BASE.clientTable.clientEntry.IndexClients OID_BASE.4.1.1.1 1 OID_BASE.4.1.1.2 2 OID_BASE.4.1.1.3 3 OID_BASE.4.1.1.4 4 => OID_BASE.clientTable.clientEntry.clientName OID_BASE.4.1.2.1 client1 OID_BASE.4.1.2.2 client2 OID_BASE.4.1.2.3 client3 OID_BASE.4.1.2.4 client4 => OID_BASE.clientTable.clientEntry.jobName OID_BASE.4.1.3.1 Client1Job1 OID_BASE.4.1.3.2 Client1Job2 OID_BASE.4.1.3.3 Client1Job3 OID_BASE.4.1.3.4 Client1Job4 OID_BASE.4.1.3.5 Client1Job5 OID_BASE.4.1.3.6 Client1Job6 OID_BASE.4.1.3.7 Client1Job7 OID_BASE.4.1.3.8 Client1Job8 OID_BASE.4.1.3.9 Client1Job9 OID_BASE.4.1.4.1 Client2Job1 OID_BASE.4.1.5.1 Client3Job1 OID_BASE.4.1.6.1 Client4Job1 ----- s n i p ----- So far so good I think. This first table seems like it would work ok. But then the second table (the one with the actual statistics): ----- s n i p ----- => OID_BASE.statsTable.statsEntry.IndexStats OID_BASE.5.1.1 1 OID_BASE.5.1.2 2 OID_BASE.5.1.3 3 OID_BASE.5.1.4 4 OID_BASE.5.1.5 5 => OID_BASE.statsTable.statsEntry.statsTypeName OID_BASE.5.2.1 start_date OID_BASE.5.2.2 end_date OID_BASE.5.2.3 duration OID_BASE.5.2.4 files OID_BASE.5.2.5 bytes => OID_BASE.statsTable.statsEntry.clientId.jobNr.start_date OID_BASE.5.3.1.1 20050910132844Z OID_BASE.5.3.1.2 20050912132925Z OID_BASE.5.3.1.3 20050915075630Z => OID_BASE.statsTable.statsEntry.clientId.jobNr.end_date OID_BASE.5.3.2.1 20050911012917Z OID_BASE.5.3.2.3 00000000000000Z OID_BASE.5.3.2.4 20050915101658Z => OID_BASE.statsTable.statsEntry.clientId.jobNr.duration OID_BASE.5.3.3.1 43233 OID_BASE.5.3.3.3 -1 OID_BASE.5.3.3.4 8428 => OID_BASE.statsTable.statsEntry.clientId.jobNr.duration OID_BASE.5.3.3.1 43233 OID_BASE.5.3.3.3 -1 OID_BASE.5.3.3.4 8428 => OID_BASE.statsTable.statsEntry.clientId.jobNr.files OID_BASE.5.3.4.1 0 OID_BASE.5.3.4.3 0 OID_BASE.5.3.4.4 97646 => OID_BASE.statsTable.statsEntry.clientId.jobNr.bytes OID_BASE.5.3.5.1 0 OID_BASE.5.3.5.3 0 OID_BASE.5.3.5.4 2749710101 ----- s n i p ----- This just don't seem correct. Where/how do I use the OID's from the first table in the second? Do I need to? Is the second table OK, even though it look strange (to me :)? Is there any information out there that explain SNMP/MIB tables (other than the very advanced 'Inter-Table Indexing in SNMP MIBs' I already managed to find) so I can read up on tables in SNMP MIBs? I've been working with SQL and LDAP for many years, but so far I've not been able to draw any direct parallels between the two (SQL and SNMP MIBs)... -- Waco, Texas FBI Legion of Doom counter-intelligence 767 colonel [Hello to all my fans in domestic surveillance] subway explosion toluene Ortega domestic disruption spy SDI SEAL Team 6 [See http://www.aclu.org/echelonwatch/index.html for more about this] [Or http://www.europarl.eu.int/tempcom/echelon/pdf/rapport_echelon_en.pdf] If neither of these works, try http://www.aclu.org and search for echelon. ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ 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