APC
APC copied to clipboard
Status fails on AP7902 and AP7930 PDUs
This is a great utility. I use it on 3 types of PDUs, the AP7901, AP7902, and AP7930.
Control works fine on all units - I can turn outlets on and off just fine. However the status command errors on all but the AP7901.
On the 7902, I get this error:
Acquiring lock /tmp/apc.lock
Connecting to APC @ 10.1.80.181
Logged in as user apc, version 3.9.2
DISCONNECTED from 10.1.80.181
Traceback (most recent call last):
File "/usr/local/bin/apc", line 10, in
On the AP7930s, I get this:
Acquiring lock /tmp/apc.lock Connecting to APC @ 10.1.1.222 Logged in as user apc, version 3.9.2 DISCONNECTED from 10.1.1.222 APC failed! Pexpect result: Timeout exceeded. <pexpect.pty_spawn.spawn object at 0x766b4970> command: /usr/bin/telnet args: ['/usr/bin/telnet', '10.1.1.222'] buffer (last 100 chars): 'let 21 ON\r\n 22- Outlet 22 ON\r\n\r Press <ENTER> to continue...' before (last 100 chars): 'let 21 ON\r\n 22- Outlet 22 ON\r\n\r Press <ENTER> to continue...' after: <class 'pexpect.exceptions.TIMEOUT'> match: None match_index: None exitstatus: None flag_eof: False pid: 24668 child_fd: 5 closed: False timeout: 10 delimiter: <class 'pexpect.exceptions.EOF'> logfile: None logfile_read: None logfile_send: None maxread: 2000 ignorecase: False searchwindowsize: None delaybeforesend: 0.05 delayafterclose: 0.1 delayafterterminate: 0.1 searcher: searcher_re: 0: re.compile('<ESC>')
apc is running on a raspberry pi, but this error doesn't seem related to that.
i get the same error with my ap7922 as you get with your ap7902
It helped me to adjust the APC_OUTLET_ROW_PATTERN and APC_OUTLET_ROW_PATTERN2 in outlet.py
APC_OUTLET_ROW_PATTERN = re.compile(r'Outlet (\d{,2}) (.*) (OFF\*?|ON\*?)')
APC_OUTLET_ROW_PATTERN2 = re.compile(r'(\d{,2})- (.*) (OFF\*?|ON\*?)')