March 6, 201412 yr Author I think this should do it. I don't get an error anymore.... Thanks for the suggestion of going back to the unRAID config file. Something that Tom posted earlier suggested, to me, that the timeZone setting should be available through a system variable. However, going back to read the config file is equally good, if a little slower/heavier on resources. I'll give that a try.
March 6, 201412 yr I'm not sure where the system variable is. It's not at /etc/timezone. So I went that route. You could change the php.ini but that would have to be done at boot with the webgui.
March 6, 201412 yr Thanks PeterB and dmacias for your work on a solution to the timezone warning message. I tried dmacias' code on my test system and I'm not getting the warning. Thanks again!!
March 6, 201412 yr Author I have made the amendments to my .plg, but not had a chance to test yet. Will release when I have done so .... However, the appearance of the messages is a very minor issue and, on investigation, I see that the date function is called simply to add date/time info into a log file which I hadn't even realised was being created!
March 6, 201412 yr Is the path to that log file /var/log/plugins/apcupsd as it appears from dmacias' code? Maybe powerdown should copy that to /boot somewhere so it doesn't disappear when we powerdown since /var is only in memory.
March 7, 201412 yr I have made the amendments to my .plg, but not had a chance to test yet. Will release when I have done so .... However, the appearance of the messages is a very minor issue and, on investigation, I see that the date function is called simply to add date/time info into a log file which I hadn't even realised was being created! This line will set the time zone correctly: date_default_timezone_set(substr(readlink("/etc/localtime-copied-from"), 20)); Add it somewhere near the top of apcupsdctl.php. It needs to be set for any of php's date functions to work properly. In most installations is set via a config variable called "date.timezone" in the php.ini file. This will get fixed there before 6.0 is released.
March 7, 201412 yr Author This line will set the time zone correctly: Thanks Tom. Just what I was looking for.
March 7, 201412 yr I have made the amendments to my .plg, but not had a chance to test yet. Will release when I have done so .... However, the appearance of the messages is a very minor issue and, on investigation, I see that the date function is called simply to add date/time info into a log file which I hadn't even realised was being created! This line will set the time zone correctly: date_default_timezone_set(substr(readlink("/etc/localtime-copied-from"), 20)); Add it somewhere near the top of apcupsdctl.php. It needs to be set for any of php's date functions to work properly. In most installations is set via a config variable called "date.timezone" in the php.ini file. This will get fixed there before 6.0 is released.
March 8, 201412 yr Thanks for the updated plugin. It works great for shutting down the server. But, it doesn't seem to kill my ups. I waited for over 5 minutes and the ups was still on. Then I tried to initiate it manually. I first stopped the array.Then I tried "/etc/apcupsd/apccontrol killpower". At first it didn't work because etc/apcupsd/powerfail was missing. After I created a blank file, it went through, but I get the following message: "0.066 apcupsd: usb.c:1066 UPS appears to support SmartUPS style hibernate." but still no kill Any ideas? Thanks EDIT: I seem to be having bigger issues. After all the testing, I realized that when the battery of my ups gets recharged to full, power is cut off for a split second and the server is shut off uncleanly. It had happened a few months back, where the server had gone offline in the middle of the night and I wasn't able to figure out why, now I know. It is a Cyberpower CP1000AVRLCD in case anyone else is having issues with a similar model
March 8, 201412 yr I realized that when the battery of my ups gets recharged to full, power is cut off for a split second WTF? If that is true then you need to return it if you still can. That is NOT acceptable behavior as you have described it.
March 9, 201412 yr I realized that when the battery of my ups gets recharged to full, power is cut off for a split second WTF? If that is true then you need to return it if you still can. That is NOT acceptable behavior as you have described it. Yes, it is simply unacceptable. I have had this device for a year and a half, and during this time I only had one power outage. And that time, the server was not set up to boot as soon as power came back, so by the time I turned the server on manually, the ups battery was already charged. That is probably why I didn't have the issue then. Apparently the unit has a 3 year warranty. I am going to test it one more time to be sure, and then I'll rma. This is ridiculous.
March 29, 201412 yr Is there an easy way of using ssmtp to mail notification events (/etc/apcupsd/onbattery /etc/apcupsd/offbattery, etc)? I was going to try to manually edit the onbattery.new and offbattery.new in the /boot/packages/apcupsd-3.14.10-x86_64-1_rlw.txz file. Thanks!
March 29, 201412 yr Author I was going to try to manually edit the onbattery.new and offbattery.new in the /boot/packages/apcupsd-3.14.10-x86_64-1_rlw.txz file. Rather than modifying the contents of the standard distribution package, it would be better to set up a sed command to modify the files every time they're installed.
March 29, 201412 yr I was going to try to manually edit the onbattery.new and offbattery.new in the /boot/packages/apcupsd-3.14.10-x86_64-1_rlw.txz file. Rather than modifying the contents of the standard distribution package, it would be better to set up a sed command to modify the files every time they're installed. Thanks for the information. Would the best place for me the insert the sed command be the Apcupsd-3.14.10-x86_64_2pb.plg file (like after the "#Finish APCUPSD Install")? Or is there a better place?
March 30, 201412 yr Author Thanks for the information. Would the best place for me the insert the sed command be the Apcupsd-3.14.10-x86_64_2pb.plg file (like after the "#Finish APCUPSD Install")? Or is there a better place? Yes, that would be fine ... if you want to edit (and re-edit everytime the plugin is updated) the plg file. There are already some sed commands in there, so add yours in the same place.
March 30, 201412 yr Author I have installed v6.0b4 on my server and am using apcupsd. Does anyone else find that the apcaccess command often takes a long time to complete, and even times out sometimes? root@Tower:~# apcaccess Error reading status from apcupsd @ localhost:3551: Connection timed out This can be seen by going to the Settings -> APC UPS Daemon page in the web gui - it will either take a long time to display, or time out and not display any of the status info. I do not understand what is causing this - telnet localhost 3551 never seems to show a failed connection. Also, apcaccess from my desktop computer (using network connection to apcupsd on the unRAID server) always completes instantly.
March 30, 201412 yr Tom has made some changes in php and the $_POST and $_GET are now provided. V6 Beta 4 readme: - emhttp: provide $_GET and $_POST to php scripts This is causing a problem in the apcupsdctl.php because the $_GET and $_POST do not work when a php is initiated from the command line. You will need to change the plugin so it is compatible with Beta 4. I suspect that this is not backwards compatible to Beta 3, but it shouldn't matter. Make the following changes to fix this: change this parse_str($argv[1],$_POST); $CMD = $_POST['cmd']; to this if ($argv[1] == "autostart") { $CMD = $argv[1]; } else { $CMD = $_POST['cmd']; } and change this php /usr/local/emhttp/plugins/apcupsd/apcupsdctl.php "cmd=autostart" to this php /usr/local/emhttp/plugins/apcupsd/apcupsdctl.php "autostart" My suggestions here are not very sophisticated, but I can not find any other way to reliably determine if the php is called from the cli.
March 30, 201412 yr Thanks! I ended up creating a folder in /boot/config/plugins and putting in a the sed script in there. The script also copied ssmtp and ssmtp config files to the right place to install them. I then called the script from /boot/config/go I was going to do /boot/config/rc.local/ proposal by WeeboTech but that seemed too much trouble for one script! Thanks for the information. Would the best place for me the insert the sed command be the Apcupsd-3.14.10-x86_64_2pb.plg file (like after the "#Finish APCUPSD Install")? Or is there a better place? Yes, that would be fine ... if you want to edit (and re-edit everytime the plugin is updated) the plg file. There are already some sed commands in there, so add yours in the same place.
March 31, 201412 yr PeterB, have you seen this yet http://lime-technology.com/forum/index.php?topic=32651.0 looks like we need an update to 3.14.12
March 31, 201412 yr Author PeterB, have you seen this yet http://lime-technology.com/forum/index.php?topic=32651.0 looks like we need an update to 3.14.12 Yep, it certainly looks like an update is in order - I hope that RLW is on top of this. However, I don't believe that this has any bearing on our V6 problem.
March 31, 201412 yr RLW? Yes indeed I can't see it having any bearing on the current plug-in problem itself.
March 31, 201412 yr Author RLW? Robby Workman, who seems to take it upon himself to provide binary packages for those useful applications which aren't included in the standard Slackware distributions. See here.
March 31, 201412 yr I managed to compile and updated version APCUPSD to version 3.14.12. This was done on a fresh install of 64 bit Slackware 14.1 (as a Xen VM) using default settings of apcupsd.SlackBuild (except I changed the version number) from SlackBuilds Repository and the source code from http://www.apcupsd.com. The compiled package file is located here (hosted by Dropbox). I also modified the PLG file (attached below the message). I tested it on my Unraid 6 beta4 server and it seems to install and work okay. Since I don't have a more permanent hosting solution if anyone has a better host feel free to host the file and modify the PLG file. (Dropbox limits to 10GB of bandwidth per day) Aside: never compiled anything under Slackware before so half the time was spend trying to get Slackware to run as virtual machine from iso. The other half the time was me tracking down compilation error that was due to I did not install X-windows and missing libraries the first install. Apcupsd-3.14.12-x86_64_2pb.plg.txt
Archived
This topic is now archived and is closed to further replies.