March 1, 201115 yr Trying to setup apcupsd-3.14.3-i486 to work with PCNET. I have a APC Smart-UPS 2200 with a AP9617 management card installed and configured. Per http://www.apcupsd.com/manual/manual.html#checking-your-configuration-file --------------------------------------------------------------- PowerChute Network Shutdown Driver (PCNET) As of 3.14, Apcupsd supports the PowerChute Network Shutdown protocol. This is an alternative to SNMP for use with APC's AP9617 family of network smartslot modules. Note that the older AP9606 modules do not support PCNET. To enable PCNET support, configure with the --enable-pcnet flag. This is typically enabled by default. (IS THIS TRUE, OR DO I HAVE TO DO SOMETHING?) The required apcupsd.conf settings are straightforward: ## apcupsd.conf v1.1 ## UPSCABLE ether UPSTYPE pcnet LOCKFILE /var/lock DEVICE ipaddr:user:passphrase UPSCLASS standalone UPSMODE disable --------------------------------------------------------------- The options via Pkg Manager for Configuration Variables: (I DONT SEE HOW I COULD DO THE ABOVE INPUT?) Use Serial Port?(YES/NO/network_master:port): If set to NO, a connection via USB cable is used. If YES, a connection via SERIAL cable will be used. If set to anything else, that port will be used. (Set to remote_master:port to network slave off another server running apcupsd. Example: if the master is "tower" then set this field to tower:3551 ) Cable Type:(smart/usb/dumb/ether): Use "smart" for APC UPS, "usb" for some other brands, "dumb" for others with appropriate cable to serial port, "ether" to slave off of apcupsd running on another server. Battery Level: Shutdown will occur when percentage charge remaining is less than this level. Minutes Remaining: Shutdown will occur when remaining runtime reaches this value. Total Seconds Outage: If outage (in seconds) exceeds this value, a shutdown will occur. Power Down UPS after shutdown?(YES/NO): If YES the UPS will power itself off after the server is powered down. This allows it to save its batteries. If NO, the UPS will not power down. --------------------------------------------------------------- I am hoping someone could share what needs to be done to achive communication via PCNET. Many thanks.
March 2, 201115 yr Bump (please ) It sounds as if your UPS will be the network master. As you suspect, the package manager was not specifically set up for your situation. You can however try setting the cable type to "ether" In the USE SERIAL PORT field, put the IP address of the UPS network card, ID, and PASSWORD like this XXX.XXX.XXX.XXX:user:password In the Cable Type field, put ether That will probably do it.
March 3, 201115 yr Author Thanks Joe, I tried that and got the following via "apcaccess status" command: APC : 001,019,0489 DATE : Wed Mar 02 19:12:08 EST 2011 HOSTNAME : Tower RELEASE : 3.14.3 VERSION : 3.14.3 (20 January 2008) slackware UPSNAME : Tower CABLE : Ethernet Link MODEL : NETWORK UPS Driver <- This needs to be PCNET UPS Driver is my understanding, i explain below. UPSMODE : Net Slave <- This needs to be Stand Alone is my understanding, i explain below. STARTTIME: Wed Mar 02 19:11:58 EST 2011 STATUS : COMMLOST MBATTCHG : 10 Percent MINTIMEL : 5 Minutes MAXTIME : 300 Seconds NUMXFERS : 0 TONBATT : 0 seconds CUMONBATT: 0 seconds XOFFBATT : N/A STATFLAG : 0x07000100 Status Flag END APC : Wed Mar 02 19:12:08 EST 2011 I followed the following from a web search, looks like you figured it out back in 2009 http://lime-technology.com/forum/index.php?topic=3688.25;wap2 I just dont understand what was actually done :'(, but I think i got it and these are the steps I took to hopefully help others out there, as that thread was very hard to follow. I copied the file "\\Tower\flash\packages\apcupsd3-unmenu-package.conf" to my local desktop, I opened the file in PrimalScript (i believe notepad++ can do the same, Windows notepad/wordpad is no good here). What i needed to physically changed in the config file itself (unfortunitly not avaiable via unMENU package configuration variables) is flagged in red to blue, I used Lime green were the setting you input into unMenu Package configuration variables for apcupsd and get written to the file, no edit to these line need to be made in the config file itself. PACKAGE_VARIABLE Use Serial Port?(YES/NO/network_master:port)||vDEVICE=%IPADDRESS%:%ADMINID%:%PASSPHRASE%||If set to NO, a connection via USB cable is used. If YES, a connection via SERIAL cable will be used. If set to anything else, that port will be used. <br>(Set to remote_master:port to network slave off another server running apcupsd. <br> Example: if the master is "tower" then set this field to </b>tower:3551</b> ) PACKAGE_VARIABLE Cable Type:(smart/usb/dumb/ether)||vCABLETYPE=ether||Use "smart" for APC UPS, "usb" for some other brands, "dumb" for others with appropriate cable to serial port, "ether" to slave off of apcupsd running on another server. PACKAGE_VARIABLE Battery Level||vBATTERYLEVEL=10||Shutdown will occur when percentage charge remaining is less than this level. PACKAGE_VARIABLE Minutes Remaining||vMINUTES=5||Shutdown will occur when remaining runtime reaches this value. PACKAGE_VARIABLE Total Seconds Outage||vTIMEOUT=300||If outage (in seconds) exceeds this value, a shutdown will occur. PACKAGE_VARIABLE Power Down UPS after shutdown?(YES/NO)||vUPS_KILL=NO||If YES the UPS will power itself off after the server is powered down. This allows it to save its batteries. If NO, the UPS will not power down. You only want this if the UPS is powering other equipment that must stay powered. PACKAGE_INSTALLATION test -f /etc/apcupsd/apcupsd.conf && rm /etc/apcupsd/apcupsd.conf PACKAGE_INSTALLATION [ ! -d /var/lock/subsys/ ] && mkdir -p /var/lock/subsys PACKAGE_INSTALLATION [ -f /etc/rc.d/rc.apcupsd ] && /etc/rc.d/rc.apcupsd stop PACKAGE_INSTALLATION killall apcupsd PACKAGE_INSTALLATION installpkg apcupsd-3.14.3-i486-1kjz.tgz PACKAGE_INSTALLATION [ "${vDEVICE-NO}" = "NO" ] && sed -i -e "s/^DEVICE \/dev\/ttyS0/#DEVICE \/dev\/ttyS0/" /etc/apcupsd/apcupsd.conf PACKAGE_INSTALLATION [ "${vDEVICE-NO}" != "NO" -a "${vDEVICE-NO}" != "YES" ] && sed -i -e "s~^DEVICE \/dev\/ttyS0~DEVICE ${vDEVICE}~" /etc/apcupsd/apcupsd.conf PACKAGE_INSTALLATION [ "${vDEVICE-NO}" != "NO" -a "${vCABLETYPE-smart}" != "ether" ] && sed -i -e "s/^UPSTYPE usb/UPSTYPE apcsmart change to pcnet/" /etc/apcupsd/apcupsd.conf PACKAGE_INSTALLATION [ "${vCABLETYPE-smart}" = "ether" ] && sed -i -e "s/^UPSTYPE usb/UPSTYPE net change to pcnet/" /etc/apcupsd/apcupsd.conf PACKAGE_INSTALLATION [ "${vCABLETYPE-smart}" = "ether" ] && sed -i -e "s/^#NETTIME 60/NETTIME 60/" /etc/apcupsd/apcupsd.conf PACKAGE_INSTALLATION [ "${vCABLETYPE-smart}" = "ether" ] && sed -i -e "s/^UPSMODE standalone/UPSMODE shareslave/" /etc/apcupsd/apcupsd.conf PACKAGE_INSTALLATION [ "${vCABLETYPE-smart}" != "smart" ] && sed -i -e "s/^UPSCABLE smart/UPSCABLE ${vCABLETYPE-smart}/" /etc/apcupsd/apcupsd.conf PACKAGE_INSTALLATION sed -i -e "s/^MINUTES 3/MINUTES ${vMINUTES-5}/" /etc/apcupsd/apcupsd.conf PACKAGE_INSTALLATION sed -i -e "s/^BATTERYLEVEL 5/BATTERYLEVEL ${vBATTERYLEVEL-10}/" /etc/apcupsd/apcupsd.conf PACKAGE_INSTALLATION sed -i -e "s/^TIMEOUT 0/TIMEOUT ${vTIMEOUT-300}/" /etc/apcupsd/apcupsd.conf PACKAGE_INSTALLATION sed -i -e "s/WALL=wall/WALL=\"mail -s 'unRAID_Server_UPS_Alert' root\"/" /etc/apcupsd/apccontrol PACKAGE_INSTALLATION /etc/rc.d/rc.apcupsd start PACKAGE_INSTALLATION #Now, put into place the shutdown script replacement PACKAGE_INSTALLATION [ ! -f /sbin/powerdown ] && echo "<font color=red><b>You must ALSO install the 'Clean Powerdown' package. The server will not shut down cleanly without it.</b></font>" PACKAGE_INSTALLATION echo "/sbin/powerdown" >/etc/apcupsd/doshutdown PACKAGE_INSTALLATION echo "exit 99" >>/etc/apcupsd/doshutdown PACKAGE_INSTALLATION chmod 755 /etc/apcupsd/doshutdown PACKAGE_INSTALLATION [ "${vUPS_KILL-YES}" != "NO" ] && sed -i -e "s/\/sbin\/poweroff/\/etc\/apcupsd\/apccontrol killpower; \/sbin\/poweroff/" /etc/rc.d/rc.6 PACKAGE_VERSION_TEST strings /sbin/apcupsd 2>&1 | grep VERSION | grep -v "^VERSION$" | awk '{print $3}' PACKAGE_VERSION_STRING 3.14.3 PACKAGE_MEMORY_USAGE Light (10K to 500K) Joe L. question to you, per the above post it seems that I should rem out (#) the following lines in Purple Color above? I dont believe they are not needed when set to PCNET, as the UPS has the config when to initiate for its clients to shutdown (you set the UPS to say notify clients to shutdown when battery level at 5 minutes, immediately when on battary power, etc... you get the idea) I exported the apcaccess status results with those three lines in and then without them(I did not want to delete them so for history I put a # in front of each of those lines). Result were exactly the same, so I would have to say they are just not being referenced once you set it to PCNET. My Result: PC : 001,051,1233 DATE : Wed Mar 02 23:26:51 EST 2011 HOSTNAME : Tower RELEASE : 3.14.3 VERSION : 3.14.3 (20 January 2008) slackware UPSNAME : Tower CABLE : Ethernet Link MODEL : PCNET UPS Driver UPSMODE : Stand Alone STARTTIME: Wed Mar 02 23:26:28 EST 2011 STATUS : ONLINE LINEV : 120.9 Volts LOADPCT : 40.9 Percent Load Capacity BCHARGE : 100.0 Percent TIMELEFT : 6.0 Minutes MBATTCHG : 10 Percent MINTIMEL : 5 Minutes MAXTIME : 300 Seconds MAXLINEV : 120.9 Volts MINLINEV : 120.2 Volts OUTPUTV : 120.9 Volts SENSE : High DWAKE : 000 Seconds DSHUTD : 090 Seconds DLOWBATT : 05 Minutes LOTRANS : 106.0 Volts HITRANS : 127.0 Volts RETPCT : 000.0 Percent ITEMP : 18.0 C Internal ALARMDEL : No alarm BATTV : 55.1 Volts LINEFREQ : 60.0 Hz LASTXFER : Automatic or explicit self test NUMXFERS : 0 TONBATT : 0 seconds CUMONBATT: 0 seconds XOFFBATT : N/A SELFTEST : NO STESTI : 336 STATFLAG : 0x07000008 Status Flag REG1 : 0x00 Register 1 REG2 : 0x00 Register 2 REG3 : 0x00 Register 3 MANDATE : 10/17/09 SERIALNO : JS0942020351 BATTDATE : 10/17/10 NOMOUTV : 120 Volts NOMBATTV : 48.0 Volts EXTBATTS : 0 FIRMWARE : 665.6.D APCMODEL : Smart-UPS 2200 RM END APC : Wed Mar 02 23:28:00 EST 2011 If anyone has issues, just run "cat /etc/apcupsd/apcupsd.conf" to see what you actually have set and reference http://www.apcupsd.com/manual/manual.html#checking-your-configuration-file You will fix whatever issue you may have pretty easy that way.
March 3, 201115 yr That is excellent news. You have a different configuration that what I was thinking. You should make your "package" file a slightly different name than the original, change it to /boot/packages/apcupsd-pcnet-unmenu-package.conf or add one more line in it somewhere like this #AUTO_UPDATE=NO If you do not re-name it, or add the line asking it to not be updated, when you next check for unMENU updates it will be replaced with the original version. (Of course, if you re-name it, it will need to be installed using its new version) Joe L.
March 3, 201115 yr Author If I change the name of the config file as you stated to "apcupsd-pcnet-unmenu-package.conf" which i think is a great idea, what do I need to do so when unRAID reboots and goes to reinstall the pkg for it to know to use the new file name config file above?
March 3, 201115 yr install it via its new name. Make a change in the description so you can tell it is your pcnet version. Mark the new version for reinstall on reboot
March 4, 201115 yr Author Joe L. how do I mark the new version of the config file for reinstall on reboot? I went to the GO script which contains the line: cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c so anything with a ".auto_install" at the end of it gets installed. So "apcupsd-3.14.3-i486-1kjz.tgz.auto_install" is used, which is confusing for me because no where do i see where it meantions either the "apcupsd-3.14.3-i486-1kjz.tgz" package or the "apcupsd-unmenu-package.conf" (original) configuration file. Your guidence is appreciated.
March 4, 201115 yr put your changes into a new APC .conf file and name it something different then what is included. From there just use unMenu to install YOUR APC .conf file and have it reinstall on reboot like all the others. If you have any other APC packages installed you will probable need to disable them in package manager and then reboot your maachine before installing your custom APC package.
March 5, 201115 yr Author put your changes into a new APC .conf file and name it something different then what is included. From there just use unMenu to install YOUR APC .conf file and have it reinstall on reboot like all the others. If you have any other APC packages installed you will probable need to disable them in package manager and then reboot your maachine before installing your custom APC package. Thanks, trying... The file I created = /boot/packages/apcupsd-pcnet-unmenu-package.conf Where in unMenu do I "From there just use unMenu to install YOUR APC .conf file and have it reinstall on reboot like all the others." ? Sorry I just dont see anything that meantions / allows me to ADD my config file. When you say "If you have any other APC packages installed you will probable need to disable them in package manager" do you mean in Pkg Manager go to the original "Select apcupsd-3.14.3-i486-1kjz.tgz" button Click on it and then click "Disable Re-Instal on Reboot" For knowledge what file is stating to use /boot/packages/apcupsd-unmenu-package.config so it shows up under the "Pkg Manager" Link? It would seem that is were I want to state to have my /boot/packages/apcupsd-pcnet-unmenu-package.conf read/loaded into "Pkg Manager".
March 5, 201115 yr make a change in the description of your modified package so you can tell it from the original. Disable reinstall on reboot on the original apcupsd. Reboot. Use the package manager to install your new version. enable reinstall on reboot on it.
March 6, 201115 yr Author make a change in the description of your modified package so you can tell it from the original. Disable reinstall on reboot on the original apcupsd. Reboot. Use the package manager to install your new version. enable reinstall on reboot on it. I must have some miss understanding so I will give the steps I have taken so my error/omission can be pointed out. 1) Copied the original /boot/packages/apcupsd-unmenu-package.conf file and made a new file named /boot/packages/apcupsd-pcnet-package.conf (both are not under /boot/packages/) 2) Added a line "PACKAGE_DESCR MY CUSTOM RELEASE" to the new config file (/boot/packages/apcupsd-pcnet-package.conf) 2) Went to http://Tower:89 in my browser. Clicked/Selected unMenu from the left hand Panel. Clicked/Selected "Pkg manager" (one of the links in the upper left of the browser screen). 3) Clicked/Selected "apcupsd-3.14.3-i486-1kjz.tgz" because it was Installed and set to Re-install upon Reboot, Clicked/Selected "disable Re-Install on Re-Boot" then reboot the unRAID box. 4) Again went to http://Tower:89 in my browser. Clicked/Selected unMenu from the left hand Panel. Clicked/Selected "Pkg manager" (one of the links in the upper left of the browser screen). 5) I do not see an additonal apcupsd install available? Just the original (from /boot/packages/apcupsd-unmenu-package.conf), is Package Manager built to automatically read ANY .config file under /boot/packages/ and automatically make it avaiable via the web link? I scrolled up and done a few time, I do not see any option to say select a file to import into Package Manager. So I am stil stuck... For testing purposes to try and learn whats going on under the hood, I went back to the original /boot/packages/apcupsd-unmenu-package.conf file and added a new line just like I did to my new .config file (/boot/packages/apcupsd-pcnet-package.conf) the line was "PACKAGE_DESCR TESTING123!!!", I rebooted the unRaid box. Again went to http://Tower:89 in my browser. Clicked/Selected unMenu from the left hand Panel. Clicked/Selected "Pkg manager". For the original file to which I just added "PACKAGE_DESCR TESTING123!!!", it did show up in the description. Again still no additional entry in Package manager showing up for my new file /boot/packages/apcupsd-pcnet-package.conf Hope you can pick up my error from my explanation of exact steps I took above.
March 6, 201115 yr The file name you used for your new version does not match the expected pattern for a .conf file. Therefore, it is ignored. It must end wth -unmenu-package.conf
March 6, 201115 yr Author The file name you used for your new version does not match the expected pattern for a .conf file. Therefore, it is ignored. It must end wth -unmenu-package.conf That was it! You clearly gave me an example earlier in this post and that file name ended with -unmenu-package.conf. So IF I just copied and pasted that file name exactly as you suggested, it would have worked, but I feel this is a good thing as now I know what unMENU is look for Now what happen next is if I selected either entry "original" OR "new" I was seeing TWO entries (complete with description, variables, option to install) for each one of the config files... I played around and this is what i noticed. Due to the line "PACKAGE_FILE apcupsd-3.14.3-i486-1kjz.tgz" referenced in both .config files, it loaded both when going into either entry. I made a second copy of /boot/packages/apcupsd-3.14.3-i486-1kjz.tgz and renamed the second one ending in my initials (in caps, so it standout and reminds me in the future) /boot/packages/apcupsd-3.14.3-i486-1ME.tgz. I then changed the "PACKAGE_FILE " line in the new .config file to this second 9renamed) tgz file "PACKAGE_FILE apcupsd-3.14.3-i486-1ME.tgz" and rem'ed "#" out the line above it #PACKAGE_URL http://linuxpackages.cs.utah.edu//Slackware-12.0/ken/apcupsd-3.14.3-i486-1kjz.tgz this was just so no attempt would be made to try and download the tgz should it ever be deleted on my stick. #1 because there is no tgz with my rename actually there and to have it bring dont the one with the original name would not help... This is what I did, but would like to hear your thoughts.
March 6, 201115 yr I think you are getting how it works. It is not that cryptic, but the package manager does look for .conf files with a specific pattern to their name. Yes, the name used for the .manual_install and .auto_install are named after the file name used for the download, and that is the name given in PACKAGE_FILE Your idea of naming it with your initials is fine as long as it ends in .tgz so it is detected as a valid package file by the installpkg utility Joe L.
March 8, 201115 yr Author Yes Sir, renamed the copy of the tgz to: /boot/packages/apcupsd-3.14.3-i486-1ME.tgz Thanks for all your help and sharing!
Archived
This topic is now archived and is closed to further replies.