Upgrade to Pro — share decks privately, control downloads, hide ads and more …

新卒でもできることはある! 〜OCX自動化奮闘記〜 /newcommer working with ocx automation in bbsakura

新卒でもできることはある! 〜OCX自動化奮闘記〜 /newcommer working with ocx automation in bbsakura

2023-02-16 BBSakura公開社内勉強会 Vol. 1 で発表の資料共有です。
新卒として自動化業務に携わった時のお話です。

BBSakura Networks, Inc

February 21, 2023
Tweet

More Decks by BBSakura Networks, Inc

Other Decks in Technology

Transcript

  1. かつては開通を支える妖精さんがいた PhysicalPort ID: 1  Status: 開通待ち  ポート: Ethernet1 ID: 2  Status:

    開通待ち  ポート: Ethernet3 ID: 5  Status: 開通待ち  ポート: Ethernet7 # show interface Ethernet1 # show interface Ethernet3 # show interface Ethernet7 まだLinkupしてないな...
  2. PhysicalPort自動開通化 スイッチ用に提供されたライブラリでバッチからCLI実行、 返答を文字列で受け取れる! 楽さ優先で強引に改行(¥n)でparse #show interfaces eth1 Ethernet1 is up,

    line protocol is up (connected) Hardware is Ethernet, address is … Description: ********** Ethernet MTU 1504 bytes , BW 10000000 kbit Full-duplex, 10Gb/s, auto negotiation: off, uni-link: n/a Up 127 days, 8 hours, 37 minutes, 54 seconds Loopback Mode : None … 文字列 CLIコマンド バッチ処理 PhysicalPortとして利用可能 になるように設定 文字列をこねて投稿
  3. Tranceiver情報の取得 tranceiver情報も必要だがparseでは欲しい値が取れなさそう #show interfaces Ethernet1 transceiver If device is externally

    calibrated, only calibrated values are printed. N/A: not applicable, Tx: transmit, Rx: receive. mA: milliamperes, dBm: decibels (milliwatts). Bias Optical Optical Temp Voltage Current Tx Power Rx Power Port (Celsius) (Volts) (mA) (dBm) (dBm) Last Update ----- --------- -------- -------- -------- -------- ------------------- Et1 30.02 3.32 7.19 -2.33 -2.49 0:00:01 ago CLIコマンド 文字列 文字列をこねて投稿 バッチ処理 PhysicalPortとして利用可能 になるように設定
  4. ありがたいサポート tranceiver情報がcsv出力可能だったので、あとは強引に改行(,)でparse string配列のインデックス指定 #show interfaces Ethernet1 transceiver csv Last Update,Port

    (Interface Name),Xcvr Serial Number,Media type,Temperature (Celsius),Voltage (Volts),Current (mA),Tx Power (dBm),Rx Power (dBm) 0:00:00 ago,Et1,XHN194604118,10GBASE-SR,30.27,3.32,7.19,-2.33,-2.49 文字列 CLIコマンド 文字列をこねて投稿 バッチ処理 PhysicalPortとして利用可能 になるように設定