Porterhouse

Members
  • Posts

    72
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Porterhouse's Achievements

Rookie

Rookie (2/14)

0

Reputation

  1. @digitalfixer - I believe the Clinet/Server reference in the apcupsd manual is to APC's NIS service, where a server (any server) is physically connected to a UPS via a serial or modbus cable, but then also serves out the same status info to other devices (clients) OF THAT UPS. Which is not what I was trying to do. However the very next section is what I WAS looking for. See below for this slightly amended ver (to aid brevity): PowerChute Network Shutdown Driver (PCNET) As of 3.14, Apcupsd supports the PowerChute Network Shutdown protocol ... an alternative to SNMP for use with APC's AP9617 .. network .. modules. ## apcupsd.conf v1.1 ## UPSCABLE ether UPSTYPE pcnet LOCKFILE /var/lock DEVICE ipaddr:user:passphrase UPSCLASS standalone UPSMODE disable Note that the username and passphrase ARE NOT THE Web/SNMP login CREDENTIALS ... The default username on a new card is "apc" and the default passphrase is "admin user phrase". To change the passphrase, log in to the Web UI and go to the UPS tab, then to PowerChute -> Configuration ... The password must be a minimum of 15 characters long. The web UI will silently ignore shorter passwords and does not give an error message. There is no apparent way to change the username. HOWEVER - If you try entering the default pasphrase as 'Admin user phrase" even in quotes YOU WON'T SUCCEED, because note what happens (to /etc/apcupsd/apcupsd.conf) when the correct (default) phrase has been entered and then parsed by the apcupsd starting: Entered the DEVICE details c/w passphrase entered in "double quotes" in the UPS Settings page, then grep'd the apcupsd.conf file in /etc/apcupsd to check the change had been applied:- user@svr2:/etc/apcupsd# grep 0.129 apcupsd.conf DEVICE 192.168.0.129:apc:admin user phrase Note that the quotes have already been stripped out. THEN Started the apcupsd service and then grep'd the apcupsd.conf file again. NOTHING ELSE HAS CHANGED user@svr2:/etc/apcupsd# grep 0.129 apcupsd.conf DEVICE 192.168.0.129:apc:admin The 2nd and 3rd words of the passphrase following the first space have VANISHED. Notice that this will be reflected in the settings page also. So I set the passphrase to something with NO SPACES - in my case "test-admin-passphrase" Infact there is no need to use quotes now as there are no spaces anyway, resulting in this :- user@svr2:/etc/apcupsd# grep 0.129 apcupsd.conf DEVICE 192.168.0.129:apc:test-admin-passphrase FINALLY - you need to ADD your 'client's' IP address, also in the UPS>Powerchute> area ... but under another tab - 'Client'. OTHERWISE IT WON'T BE ALLOWED to connect to the Powerchute Web Interface. So my settings, for DIRECT NETWORK CONNECTION to an APC AP9617 from a unRAID server (v 6.2.0-beta21) are: UPS Cable Ether Custom UPS Cable < > Blank UPS Type PCnet Device <IP.of.my.AP9617.card>:apc:test--admin-passphrase Having also set "test--admin-passphrase" as the new password in the UPS>Powerchute>Configuration page accessed via the Web interface, AND setup my Client's IP address in UPS>Powerchute>Clients And hey presto, it started working !! ... and it doesn't require a server to serve the status of it's UPS out to it's clients ----------------------------- I should add that with regard to setting up of serial ports: 1. I am referring to using OLD APC SmartUPS (tested with 700's and 1000's) with a DB9 serial connector 2. The USB cable I use to get the serial port working was a Startech (but there appear to be other suppliers of this type of cable) - StarTech.com 1 Port FTDI USB to Serial RS232 Adapter Cable with COM Retention - USB to RS232 Serial Port Adapter. Available on Amazon in UK. 3. You need to pair this with an APC 940-0024c cable, OR lookup the pinout details (Google knows) and get yourself a DB9M-DB9F jumper adapter such as this: http://www.l-com.com/d-sub-plastic-pcb-jumper-box-db9-male-female 4. With settings on the UPS Settings page as: UPS Cable USB Custom UPS Cable < > Blank UPS Type APCsmart Device /dev/ttyUSB0 (or whatever yours is - see the start of this thread for how to discover this) All done !!
  2. I found these posts on how to configure for a NIS service, i.e. where a unRAID (or other) server is serving out status of the UPS that it's also physically connected to via a serial cable: https://lime-technology.com/forum/index.php?topic=31071.msg429068#msg429068 https://lime-technology.com/forum/index.php?topic=25710.msg223928#msg223928 But that's NOT what I'm trying to figure out here ... I found this un-answered Q from 'Slimer' on the same issue I have: https://lime-technology.com/forum/index.php?topic=46063.msg440388#msg440388 I also saw somewhere a passing comment from 'Joe.L' which suggests he may know how to edit apcupsd.conf to make this work, but no actual details were included. So .. does anyone know if it's possible to get APCUPSD to talk DIRECTLY to an APC UPS via it's AP9716 management card, using APC's proprietary protocol, using a Web port, using SNMP or other setup, and if so HOW ? I'll amend the topic heading to include a reference to AP9716 setup, to see if that gets a bit more input Cheers
  3. @Ashe - Thanks for the link ... but it doesn't work for me (on my sandbox ver 6.2.0-beta21) I've tried every combination of settings for - Ether/PCnet/IP-with-&-without: user/pwd/ports ... but I can't get even close to 'Refreshing' and ultimately I just get ... 'Communication Lost' coupled with 'No Information' at the bottom of the screen collected from the UPS. I should add that obviously the original question is solved, but it would be great to get this extra bit of functionality tested too, so as to have a complete picture/record of what's possible or not. There may be others with IP enabled UPS on key unRAID hardware, who would like to have the option of using IP signalling if/when the hardwired (USB-DB9) option is temporarily unavailable. So ... any other suggestions .. or ways to debug what's happening in my case ?
  4. OK - HOLD that question !!. I found some help in the 'Help' lines for the 'USP Settings' page. YES - you can point your unRAID UPS Settings page at an IP Address (of a UPS' Ethernet Mgmt Card), using these settings (but don't get too excited - it isn't working yet) : --------------------------------------------------------------- UPS Cable Ether Custom UPS cable: < > Blank UPS type: PCnet Device: 192.168.xx<username>:<passphrase>: PORT# --------------------------------------------------------------- BUT ... I'm not quite there yet. The default port for this is apparently 3052. According to Google, 3052 is specific to 'APC PowerChute Network'. Entering 3052 above doesn't get it working and nor does the telnet port (23) or SSH (22), SNMP (161-162) despite the fact that I can telnet do the UPS/Mgmt Card and get all the config info I need, so what, if any, available service on the APC UPS is handling the status updates. OR .. Do I need to be pointing unRAID to an instance of APC's Network Mgmt App .. to get this working ? Anyone got this working, if so, how? Thanks
  5. @digitalfixer - Thanks for clarifying that. Can anyone advise further - can the UPS Settings page be used to configure access/monitoring of an APC UPS via a telnet session to it's NIC - given that I can have the same admin dialogue with the UPS via either it's serial port or it's NIC. IE, can I replace '/dev/ttyUSB0' with '192.168.xx.yy:22' or whatever the telnet port happens to be set to and 'USB' with 'NET'... or can only the NUT plugin do this ? I did try a few combinations but it didn't seem to work ... but should it? ... or do I need to use NUT for that instead?
  6. BINGO !!! Thanks Ashe !! It looks like the key config detail which I was missing ... was the name of the device (/dev/ttyUSB0) in the device field of the UPS settings page. Having entered this the status immediately changed to (I think it was) .... Resuming .... followed by 'Online' It's now working fine !! I note that the setting 'UPS Cable' - doesn't seem to make a difference whether it's set to 'USB' or 'smart'. I haven't tried every other combo. However .. @Ashe - how/where do you get that sexy graphical interface to UPS Settings I have Beta 6.2.0-beta21 .. version but mine is just text based ... nothing fancy like your version Also .. @digitalfixer - what's a MODBUS cable ?? Is it a USB to RJ11 cable. If so, it won't fit legacy APC UPS' which had/have an RS232/DB9 connector, so to connect an old SmartUPS 700/800/900/1000 etc ... to a modern PC/server you need the setup I've spec'd (USB-DB25 + APC 940-0024C cable) I think .. Thanks !
  7. Thanks for all those pointers then ... Meanwhile, the following was useful APC serial config info which other may need & which helped me get Putty talking to my APC (vintage SmartUPS 700) on my W10 laptop via a USB port: From the APC/Schneider support forum: Make sure that there is no application that is using the serial port. For testing you can use Putty and set the port settings to 2400-8-None-1-XOn/XOff. Once you are on the Putty screen press "Shift+Y", this should return an SM on the screen. Press "Shift+A" after seeing SM and this should produce a beep and the LEDs in front should flash once. Also note: 1. The <Backspace> char should be set to Ctrl-H in 'Keyboard' settings on Putty. The default is/was something else. 2. I changed the Com port assigned to the USB on my laptop to Com1 to try and get APC's Powerchute Personal Ed (PCPEInstaller.exe) working, but even when I knew the APC was able to communicate via Com1, the PCPE app could never find an APC device on any port and failed to install. ---------------- So, over to my unRAID svr with the USB cable which I now know is (or can be made to) work. I found these commands detailed on unix.stackexchange.com to discover which tty a USB device is using: user@svr2:~# lsusb Bus 002 Device 002: ID 8087:8001 Intel Corp. Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 8087:8009 Intel Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 002: ID 18a5:0300 Verbatim, Ltd Bus 003 Device 004: ID 0403:6001 Future Technology Devices International, Ltd FT 232 USB-Serial (UART) IC Bus 003 Device 003: ID 8087:07dc Intel Corp. Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub user@svr2:~# dmesg|grep tty [ 0.000000] console [tty0] enabled [ 6.795125] 00:05: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 1655 0A [46725.791507] usb 3-3: FTDI USB Serial Device converter now attached to ttyUSB0 user@svr2:~# udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB0) ...produces a long list of hierarchical configs related to the 'dev' which may be of interest. user@svr2:~# stty -F /dev/ttyUSB0 -a speed 9600 baud; rows 0; columns 0; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0; ..... & more like this ........ user@svr2:~# stty -F /dev/ttyUSB0 2400 user@svr2:~# user@svr2:~# stty -F /dev/ttyUSB0 -a speed 2400 baud; rows 0; columns 0; line = 0; ... but I think/gather I still need to configure the UPSD to see this tty ...
  8. Despite lots of reading-up, trial and error I can't seem to get my v6.2.(or a v6.1.3) server to see an APC Smartups on a com port. I've connected it via a Startech USB-Serial adapter (ICUSB2321F) and a pukka APC black db9 cable (940-0024C). I've checked that the UPS is communication correctly by jacking into it via Putty (configured: 2400b/8/1/none/RTS) from a Windows 10 laptop (using the same cable combo), and this all works fine, viz: ------------------------------- User Name : apc Password : *** American Power Conversion Network Management Card AOS v2.6.4 © Copyright 2004 All Rights Reserved Smart-UPS & Matrix-UPS APP v2.6.1 ------------------------------------------------------------------------------- Name : SmartUPS-700-1B Date : 06/20/2016 Contact : Time : 14:18:27 Location : Here User : Administrator Up Time : 0 Days 0 Hours 5 Minutes Stat : P+ N+ A+ Searching for a Smart-UPS or a Matrix-UPS... ------- Control Console ------------------------------------------------------- 1- Device Manager 2- Network 3- System 4- Logout <ESC>- Main Menu, <ENTER>- Refresh, <CTRL-L>- Event Log > 1 ------- Smart-UPS 700 --------------------------------------------------------- Status of UPS : On Line Last Transfer : Detection of a line voltage notch or spike. ----------------------------------------------------------------------- Input Voltage : 248.3 VAC Operating Frequency : 50.00 Hz Output Voltage : 249.6 VAC Internal Temperature: 103.2 F Load Power : 014.0 % Watts Battery Voltage : 27.74 VDC Max Line Voltage : 253.5 VAC Battery Capacity : 100.0 % Min Line Voltage : 249.6 VAC Runtime Remaining : 0083 min ----------------------------------------------------------------------- Self-Test Result : Passed Calibration Result : Unknown Self-Test Date : 06/17/2016 Calibration Date : Unknown 1- Control 2- Diagnostics 3- Configuration 4- Detailed Status 5- About UPS ----------------------------------- Whatever I configure in UPS Settings, I just get 'Connection Lost' even though I never had 'Connected' to start with. I think I need to replicate the port config that I know works (2400/8/1/none/rts) onto the tty which the USB port is using ... but I don't know where to start - It's been a VERY long time since I plugged a VT onto a 'nix system Can anyone give me a steer please ? Thanks
  9. @binky: That worked perfectly thanks. ECDSA/SSH key no longer being challenged following a reboot of my SOURCE c/w target server's name/IP noted in: /boot/config/ssh/known_hosts due to this being re-created (as /root/.ssh/known_hosts) by the syntax added to: /boot/config/go @ken-ji Noted. Thanks Solved!
  10. I did't find anything on my issue in the wiki or posted earlier here, so here goes my question. How can I stop rsync flagging an ECDSA key error, which seems to come back after every reboot, so is presumably related to the non-persistence of / The error I'm seeing is something like (copied from a googled thread .. but with the specifics redacted by me): The authenticity of host '[servername]:portnum ([nn.nn.nn.nn]:portnum)' can't be established. ECDSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx. Are you sure you want to continue connecting (yes/no)? yes From what I've read elsewhere about ECDSA/SSH keys, they appear to be normally held in ~/ssh but in unRAID I gather they're in /boot/config/ssh. However, if they already exist in /boot/config/ssh, then why is rsync asking me for this info again, after every reboot. What do I need to do to make this persistent so that when I later run my script from cron, it won't fail after each reboot. Also given that after answering 'yes' to the above Q, rsync reports: Warning: Permanently added '[servername]:portnum ([nn.nn.nn.nn]:portnum' (ECDSA) to the list of known hosts. .... which clearly it isn't PERMANENTLY ADDED. I'm running my script as root, if that makes a difference. Source server is v6.1.3 and target is v6.2.0-beta21 Anyone have any advice/guidance on this config in unRAID ? Thanks
  11. I hope this is the right place to ask this ... I'm not new to scripting but definitely out of practice by about 20 years. I've written a half decent BASH script to rsync two unRAID 6 servers on a disk by disk basis. I can make this work for one disk or for all disks, using 'case' statements. However, I want to extend this to selecting multiple disks (thus permitting me to skip certain disks) using this line: #DEV version:- #for i in `ls -d /mnt/d*|grep -v disks|grep -E '$disknum'`; do find $i -maxdepth 1 -not -empty -type d|grep -vx $i;done > /boot/scripts/syncup.list I'm obviously passing 'disknum' via a $n Argument I can make this work on the command line using " grep -E 'a|b|c' " ... but I can't seem to get it working within my script. My issue seems to be my inability to pass this string < 'a|b|c' > via a variable into the grep syntax such as " grep -E $list ". Here's my simple test which replicates what I can/can't do: -------------------------------------- user@svr1:/boot/scripts/dev# cat testlist 1 2 3 4 5 6 7 8 9 10 11 12 user@svr1:/boot/scripts/dev# cat testlist|grep -E '2|8' 2 8 12 Success ! ... but if I try and pass it as a variable I get ... user@svr1:/boot/scripts/dev# list="'2|8'";echo $list;cat testlist|grep -E $list '2|8' -------------------------------------- The last line echo's the correct value ... but causes the above test script to just ends as shown. I've tried other combinations of parentheses but it generally error's out such as: -bash: 2|8: command not found Usage: grep [OPTION]... PATTERN [FILE]... Try 'grep --help' for more information. Any ideas/suggestions anyone ?
  12. Can anyone please explain why I can can no longer find the script and associated files which I've just spent 2 days developing and testing, as root, and which were stored in & off /root. I've been using putty to write a script, logged in as root, which was actually all done and tested, finito benito. I even had a backup, but not unfortunately a print-out or a remote copy of my script, which is as ironic as it was horrifying to discover, since it was a script to sync (rsync) my main server to my backup server, disk by disk. I can only assume this is due to me bouncing my server to replace a disk, but now my script and a subdirectory which I created in /root for my backups and logs are all missing/vanished. a) what happened - I need to understand this so I can avoid this EVER happening again. b) also, where should I store my scripts in future which can be run from cron but are persistent locations. Thanks
  13. @dmacies - Thanks. I didn't spot your comment earlier but I'll take that onboard, since I have allocated the whole disk to the VM anyway.
  14. Update: I've now tested this with a spinning disks too, with a W10 VM, configured as a local drive to the VM but also shared out on my network, as a target folder for an app running as a Windows service (although only tested this with) Blue Iris 4.. This has now allowed me to use/re-use a WD Purple disk for this data. Purple's are apparently specifically designed for CCTV capture .. and also I suspect this config will result in less hammer on my parity disk.