PDU (Power Distribution Unit) 機櫃式電源分配器.
我參考了使用手冊 MLAN-9F8QVU_R7_EN.pdf,該文件有 172 頁,整理一下怎麼快速入門使用它.
首先須將序列埠與網路先連接上.
- RJ-12 Serial Port Port(10) – 預設為 9600 bps, 8 data bits, no parity, 1 stop bit, 以及 no flow control.
- 10/100 Base-T Connector(11) – 預設為 DHCP.
要如何確認目前 PDU 的 IP ,可以透過以下的方式.
- PDU 顯示器(1)
在選單選擇 Network / IPV4 Address (預設使用 DHCP 來獲取 IP),如果沒有可以透過 RJ-12 Serial Port Port 來檢查一下. - RJ-12 Serial Port Port(10)
預設的 super user 帳號,密碼為 apc , pacUser Name : apc Password : xxx Schneider Electric Network Management Card AOS vx.x.x (c) Copyright 2018 All Rights Reserved RPDU 2g vx.x.x -------------------------------------------------------------------------- Name : xxxxxxxx Date : 5/30/2018 Contact : xxxxxxxxx Time : 5:58:30 Location : xxxxxxxxxx User : Administrator Up Time : 0 Days, 21 Hours, 21 Minutes Stat : P+ N4+ N6+ A+ Type ? For command listing Use tcpip for IP address (-i), subnet (-s), and gateway (-g) apc> tcpip E000: Success Active IPv4 Settings --------------------- Active IP Address: 172.16.0.96 Active Subnet Mask: 255.255.255.0 Active Gateway: 172.16.0.254 Manually Configured IPv4 Settings --------------------------------- IPv4: enabled Manual Settings: disabled IP Address: 0.0.0.0 Subnet Mask: 0.0.0.0 Gateway: 0.0.0.0 MAC Address: XX XX XX XX XX XX Domain Name: example.com Host Name: HostName
可以修改成為設定固定 (Static) IP ,設定好需要重啟 PDU (指令 Bye) 才會生效.
apc> tcpip -i 172.16.0.6 E002: Success Reboot required for change to take effect. *Reboot required for change to take effect. apc> tcpip -s 255.255.255.0 E002: Success Reboot required for change to take effect. *Reboot required for change to take effect. apc> tcpip -g 172.16.0.254 E002: Success Reboot required for change to take effect. *Reboot required for change to take effect. apc>exit Bye.
User Name : apc Password : xxx Schneider Electric Network Management Card AOS vx.x.x (c) Copyright 2018 All Rights Reserved RPDU 2g vx.x.x -------------------------------------------------------------------------- Name : xxxxxxxx Date : 5/30/2018 Contact : xxxxxxxxx Time : 5:58:30 Location : xxxxxxxxxx User : Administrator Up Time : 0 Days, 0 Hours, 2 Minutes Stat : P+ N4+ N6+ A+ Type ? For command listing Use tcpip for IP address (-i), subnet (-s), and gateway (-g) apc> tcpip E000: Success Active IPv4 Settings --------------------- Active IP Address: 172.16.0.6 Active Subnet Mask: 255.255.255.0 Active Gateway: 172.16.0.254 Manually Configured IPv4 Settings --------------------------------- IPv4: enabled Manual Settings: enabled IP Address: 172.16.0.6 Subnet Mask: 255.255.255.0 Gateway: 172.16.0.254 MAC Address: XX XX XX XX XX XX Domain Name: example.com Host Name: HostName
可以利用 ping 來確認使否跟網路其他 IP 互通.
apc> ping 172.16.0.2 Replay from 172.16.0.2: time(ms)= <10 Replay from 172.16.0.2: time(ms)= <10 Replay from 172.16.0.2: time(ms)= <10 Replay from 172.16.0.2: time(ms)= <10
IP 確認後就可以透過 web 的方式來檢視 APC 狀態,http 預設是開啟的,可以在 CLI (Command Line) 下可用指令 web 來確認.
apc> web E000: Success HttP: enabled Https: disabled Http Port: 80 Https Port: 443 Minimum Protocol: TLS1.1
或是透過 telnet(開啟) 或是 SSH(關閉) ,需要透過 console 指令來設定
apc> console E000: Success Telnet: enabled SSH: disabled Telnet Port: 23 SSH Port: 22 Baud Rate: 9600
可以把 SSH 連線功能打開,PDU 需重新開機才會生效.
apc> console -s enable E002: Success Reboot required for change to take effect. *Reboot required for change to take effect. apc>exit
怎麼透過遠端將連接到 APC PDU 機櫃式電源分配器的伺服器關閉(立即或是延遲)呢!可以透過下面幾種方式.
- RJ-12 Serial Port Port , Telnet , SSH
與電源相關指令,有分 立即或是延遲 兩種
立即- olOn – Turn on an outlet or group of outlets without any delay.
- olOff – Turn off an outlet or group of outlets without any delay.
- olReboot – Cycle power to an outlet or group of outlets without any delays.
延遲
須先設定延遲 (Delay) 時間.- olOffDelay – Set or view the time delay for the Off Delayed command
- olOnDelay – Set or view the time delay for the On Delayed command
設定完延遲時間後,下面的指令會依據指定的時間來開關機.
- olDlyOff – Turns off an outlet or group of outlets after the Power Off Delay
- olDlyOn – Turns on an outlet or group of outlets after the Power On Delay
- olDlyReboot – Cycles power to an outlet or a group of outlets. The specified outlets will be turned off based on the configured Power Off Delay (指令 olOffDelay). After the longest Reboot Duration of the selected outlets, the outlets will then begin to turn on based on the configured Power On Delays (指令 olOnDelay) set for the specified outlets.
更多指令參考請搜尋 MLAN-9F8QVU_R7_EN.pdf 說明.
- 10/100 Base-T Connector (Web)
透過 Web 介面在 Control / RPDU / Outlet ,就可以針對不同的 Outlet 來開關機. - 10/100 Base-T Connector(SNMP)
APC 有支援 SNMP ,至於要怎麼透過 SNMP 控制 PDU ,可以先了解一下什麼是 SNMP – http://benjr.tw/8266預設 SNMP 唯讀 (Read) community (功能類似 user id 或是 password 之類的意思) 為 public,可供讀寫 (read/write) community 為 private .
APC 的 OIDs 定義如下.iso(1).org(3).dod(6).internet(1).private(4).enterprises(1).apc(318).products(1).hardware(1).rPDU2(26)
可以透過 指令 snmpwalk 做查詢,後面接的字串可以是不完整的,如果是空的會透過 GETNEXT 把設備上的資訊一一輪詢出來.
[root@localhost ~]# snmpwalk -Of -v 2c -c public 192.168.95.137
參數說明:
- -Os : 顯示方式(Output) MIB object name (plus any instance 或 other subidentifiers),其它方式請 man snmpcmd 查詢.或是
- -Of : Include the full list of MIB objects.
- -On : Displays the OID numerically.
- -v: SNMP 版本,從 1 , 2c 到 3 .
- -c community : SNMPv1/v2c 傳輸時需要設定 community string (類似 user id 或是 password 之類的意思) , 很多設備預設為 public.
詳細使用請參考 – http://www.serverspace.co.uk/blog/using-snmp-control-remote-apc-pdus
部分 APC OID 資料 – http://www.apc.com/us/en/faqs/FA156179/ - -Os : 顯示方式(Output) MIB object name (plus any instance 或 other subidentifiers),其它方式請 man snmpcmd 查詢.或是