<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    afunms

    My Software,My Dream—Forge a more perfect NMS product.

    PSAX Trap 翻譯(1)

         今天終于實現把朗訊PSAX ATM交換機的SNMP Trap翻譯成明文的功能。前后花了四天的時間。

         開始,我想用mibble把acmib完全解析出來,但折騰了一整天,都沒有結果,至少最重要的OID是終始出不來,可能是我不會用mibble吧。

         接著換種思路,用SolarWinds(一個很好用的mib browser)把acmib copy成純文本。

           文本如下:
     

    acMIB     1.3.6.1.4.1.1751.2.18

    connectionConfig   1.3.6.1.4.1.1751.2.18.6

    atmAtmSpvcVccTable   1.3.6.1.4.1.1751.2.18.6.33

    atmAtmSpvcVccEntry   1.3.6.1.4.1.1751.2.18.6.33.1

    atmAtmSpvcVccStatsInOdometerCellCountHiB   1.3.6.1.4.1.1751.2.18.6.33.1.50

    atmAtmSpvcVccStatsInOdometerCellCountLoA 1.3.6.1.4.1.1751.2.18.6.33.1.47

    atmAtmSpvcVccStatsInOdometerCellCountLoB 1.3.6.1.4.1.1751.2.18.6.33.1.51

    atmAtmSpvcVccStatsOdometerReset   1.3.6.1.4.1.1751.2.18.6.33.1.55

    atmAtmSpvcVccStatsOdometerTimer 1.3.6.1.4.1.1751.2.18.6.33.1.54

    atmAtmSpvcVccStatsOutCellCountHiA1.3.6.1.4.1.1751.2.18.6.33.1.37

    atmAtmSpvcVccStatsOutCellCountHiB1.3.6.1.4.1.1751.2.18.6.33.1.41

    atmAtmSpvcVccStatsOutCellCountLoA       1.3.6.1.4.1.1751.2.18.6.33.1.38

    atmAtmSpvcVccStatsOutCellCountLoB       1.3.6.1.4.1.1751.2.18.6.33.1.42

    atmAtmSpvcVccStatsOutOdometerCellCountHiA1.3.6.1.4.1.1751.2.18.6.33.1.48

    atmAtmSpvcVccStatsOutOdometerCellCountHiB1.3.6.1.4.1.1751.2.18.6.33.1.52

    atmAtmSpvcVccStatsOutOdometerCellCountLoA       1.3.6.1.4.1.1751.2.18.6.33.1.49

    atmAtmSpvcVccStatsOutOdometerCellCountLoB       1.3.6.1.4.1.1751.2.18.6.33.1.53

    atmAtmSpvcVccStatsTimer 1.3.6.1.4.1.1751.2.18.6.33.1.43

    atmAtmSpvcVccSusCellRateA2B 1.3.6.1.4.1.1751.2.18.6.33.1.10

    atmAtmSpvcVccSusCellRateB2A 1.3.6.1.4.1.1751.2.18.6.33.1.16

    atmAtmSpvcVccTfcDescModify 1.3.6.1.4.1.1751.2.18.6.33.1.70

    atmAtmSpvcVccTrafficShapingA2B     1.3.6.1.4.1.1751.2.18.6.33.1.64

    atmAtmSpvcVccTrafficShapingB2A     1.3.6.1.4.1.1751.2.18.6.33.1.65

    atmAtmSpvcVccType    1.3.6.1.4.1.1751.2.18.6.33.1.20

    atmAtmSpvcVccVciA    1.3.6.1.4.1.1751.2.18.6.33.1.2

    atmAtmSpvcVccVciB    1.3.6.1.4.1.1751.2.18.6.33.1.6

    atmAtmSpvcVccViA      1.3.6.1.4.1.1751.2.18.6.33.1.56

    ……
     

    把這個文本導入數據庫:

    /**
         * acmib.mib有兩個版本,此方法把兩個版本中數據都導入數據庫.
         * 但保證不會有重復的oid
         
    */

        
    public void importOid(){
            Connection conn 
    =
     ConnectionManager.getConnection();
            
    try
    {            
                Statement stat 
    =
     conn.createStatement();
                BufferedReader in1 
    = new BufferedReader(new FileReader("e:/acmib.txt"
    ));
                String row 
    = null
    ;
                
    int id = 1
    ;
                
    while((row=in1.readLine())!=null)
    {
                    
    int loc = row.indexOf("1.3.6."
    );
                    String symbol 
    = row.substring(0, loc - 1
    ).trim();
                    String oid 
    =
     row.substring(loc).trim();
                    stat.addBatch(
    "insert into acmib_oid(id,oid,symbol)values(" + id + ",'" + oid + "','" + symbol + "')"
    );
                    id
    ++
    ;
                    
    if( id % 100 == 0
    )
                        stat.executeBatch();
                }

                stat.executeBatch();
                
                ResultSet rs 
    = stat.executeQuery("select oid from acmib_oid order by oid");
                List
    <String> oids = new ArrayList<String>
    ();
                
    while
    (rs.next())
                    oids.add(rs.getString(
    1
    ));
                
                BufferedReader in2 
    = new BufferedReader(new FileReader("e:/acmib2.txt"
    ));
                
    while((row=in2.readLine())!=null)
    {
                    String[] rowCols 
    = row.split(" "
    );
                    
    if(oids.contains(rowCols[2])) continue
    ;

                    stat.addBatch(
    "insert into acmib_oid(id,oid,symbol)values(" + id + ",'" + rowCols[2+ "','" + rowCols[1+ "')"
    );
                    id
    ++
    ;
                    
    if( id % 100 == 0
    )
                        stat.executeBatch();
                }

                stat.executeBatch();            
            }
    catch(Exception e){
                e.printStackTrace();
            }

        }
    結果如下:


    posted on 2009-10-21 10:47 afunms 閱讀(245) 評論(0)  編輯  收藏


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     

    My Links

    News

    留言簿(18)

    隨筆檔案

    相冊

    搜索

    最新評論

    閱讀排行榜

    主站蜘蛛池模板: 中文字幕一区二区免费| 免费看污成人午夜网站| 中文字幕看片在线a免费| 国产大片91精品免费观看男同 | 亚洲成A人片在线观看中文| 亚洲色丰满少妇高潮18p| 57PAO成人国产永久免费视频| 免费视频淫片aa毛片| 成熟女人特级毛片www免费| 亚洲一区二区成人| 亚洲а∨精品天堂在线| 一本无码人妻在中文字幕免费 | 亚洲综合伊人久久综合| 九九免费久久这里有精品23| 一级毛片免费观看| 青青青青青青久久久免费观看| 亚洲另类视频在线观看| 色吊丝免费观看网站| 亚洲高清最新av网站| WWW国产成人免费观看视频| 国产亚洲婷婷香蕉久久精品| 春暖花开亚洲性无区一区二区| 免费一级黄色毛片| 亚洲一级高清在线中文字幕| 成人特级毛片69免费观看| 久久亚洲国产成人影院网站| 久久久精品免费国产四虎| 日产国产精品亚洲系列| 国产亚洲sss在线播放| 久久国产免费一区二区三区 | 亚洲色大成网站www尤物| 天天干在线免费视频| 麻豆亚洲av熟女国产一区二| 我的小后妈韩剧在线看免费高清版| 中文字幕在线日亚洲9| 亚洲AV无码乱码在线观看性色扶 | 亚洲另类激情综合偷自拍图| 在线美女免费观看网站h| 亚洲综合熟女久久久30p| 日本免费在线观看| 67194在线午夜亚洲|