Thank you for your response. The point is that I have configured my system to shut down at the event "upsc Inform@localhost ups.status"!="OL", not at "LB". So there will be no /etc/killpower file created. At an ups.status != "OL" event, the following script named "notifyme" is run: echo `date` >> /root/upsLog echo " No power, shutting down the system!" >> /root/upsLog sleep 30 control=`/usr/local/ups/bin/upsc Inform@localhost ups.status` if [ $control != OL ] then /sbin/telinit 0 fi I tried adding the line: "touch /etc/powerdown" to the "notifyme" script and the lines: if (test -f /etc/powerdown) then echo "Killing the power, bye!" /usr/local/ups/bin/upsdrvctl shutdown sleep 120 fi to the /etc/rc.d/rc.6 script, but when I simulated a power failure, the system shut down, but the UPS did not. I think I did not add the lines at the correct place in the rc.6 script, or probably there is poor communication between the UPS and the software, for I am not sure the software I am using is for my UPS. I just found out that the powercom driver gives "OL" when the UPS is connected to the mains, and "OB BOOST" when it is disconnected. Besides, I am not quite sure whether I need to make the UPS itself go down in case of power failure, because if it does not go down, it has the chance to get charged when power returns. Now after in case of power failure the PC shuts down and the UPS goes on buzzing, but it can go on buzzing like that for quite a lot time before the battery gets damaged, because the PC is off and the power consumption from the UPS battery is minimal, am I not right? So what would you recommend to me? MAke the UPS itself power off after system shutdown in case of power failure, or leave it buzzing till power returns? In case you advise me to make the UPS go down itself after the system shutdown, I will be thankful to you if you tell me if the method I suggest to achieve that is working and where in the shutdown script I need to add it? Thank you for your responsiveness. Regards, Martin >-------- ?????????? ????? -------- >??: selinger@mathstat.dal.ca (Peter Selinger) >???????: Re: [Nut-upsuser] powercom user problem >??: tramni@abv.bg (Martin Ivanov) >????????? ??: ?????????, 2006, ?????? 17 00:29:50 EEST >---------------------------------- > >Martin Ivanov wrote: >> >> 1. How to make the UPS power off after the PC powers off in case of power >> failure. Of course when there is no power failure, but I issue shutdown >> command to the system, the UPS must not power off. > >The answer to this question in contained in the file INSTALL that is >distributed with NUT. The answer is under "Configuring shutdowns for >low battery events" -> "11. Edit your shutdown scripts: add upsdrvctl >shutdown" (line 503). > >-- Peter > ----------------------------------------------------------------- http://ide.li/ - ?????? ?? ????????? ?? ?????. ??????, ??????, ??????, ??????, ??????????.
Hi Martin, as far as I can see, you should not use "/sbin/telinit" to shut down the system in your notifyme script. You should use "upsmon -c fsd". This is for two reasons: first, so that the powerdown flag is set correctly. Second, in case there are any slaves attached to your master upsmon (which may not be the case in your situation, but could be the case in general), only "upsmon -c fsd" will do the correct thing to shut them down in a controlled way. See "FORCED SHUTDOWNS" on the upsmon(8) man page, and see also the upssched(8) man page. By the way, seeing that you have effectively implemented a 30-second timer to shut down on any battery event that is longer than 30 seconds, you probably should have used upssched(8); I am not very familiar with it, but from looking at the man page (and that of upssched.conf(8)), it seems that it was designed for exactly this scenario. -- Peter Martin Ivanov wrote:> > Thank you for your response. > The point is that I have configured my system to shut down at the event "> upsc Inform@localhost ups.status"!=3D"OL", not at "LB". So there will be > no /etc/killpower file created. At an ups.status !=3D "OL" event, the fol> lowing script named "notifyme" is run: > > echo `date` >> /root/upsLog > echo " No power, shutting down the system!" >> /root/upsLog > sleep 30 > control=3D`/usr/local/ups/bin/upsc Inform@localhost ups.status` > if [ $control !=3D OL ] > then > /sbin/telinit 0 > fi > > I tried adding the line: "touch /etc/powerdown" to the "notifyme" script > and the lines: > > if (test -f /etc/powerdown) > then > echo "Killing the power, bye!" > /usr/local/ups/bin/upsdrvctl shutdown > > sleep 120 > > fi > > to the /etc/rc.d/rc.6 script, but when I simulated a power failure, the s> ystem shut down, but the UPS did not. I think I did not add the lines at > the correct place in the rc.6 script, or probably there is poor communica> tion between the UPS and the software, for I am not sure the software I a> m using is for my UPS. I just found out that the powercom driver gives "O> L" when the UPS is connected to the mains, and "OB BOOST" when it is disc> onnected. > Besides, I am not quite sure whether I need to make the UPS itself go dow> n in case of power failure, because if it does not go down, it has the ch> ance to get charged when power returns. Now after in case of power failur> e the PC shuts down and the UPS goes on buzzing, but it can go on buzzing> like that for quite a lot time before the battery gets damaged, because > the PC is off and the power consumption from the UPS battery is minimal, > am I not right?=20 > So what would you recommend to me? MAke the UPS itself power off after sy> stem shutdown in case of power failure, or leave it buzzing till power r> eturns? > In case you advise me to make the UPS go down itself after the system shu> tdown, I will be thankful to you if you tell me if the method I suggest > to achieve that is working and where in the shutdown script I need to add> it? > > Thank you for your responsiveness. > Regards, Martin > > > >-------- =CE=F0=E8=E3=E8=ED=E0=EB=ED=EE =EF=E8=F1=EC=EE -------- > >=CE=F2: selinger@mathstat.dal.ca (Peter Selinger) > >=CE=F2=ED=EE=F1=ED=EE: Re: [Nut-upsuser] powercom user problem > >=C4=EE: tramni@abv.bg (Martin Ivanov) > >=C8=E7=EF=F0=E0=F2=E5=ED=EE =ED=E0: =D7=E5=F2=E2=FA=F0=F2=FA=EA, 2006, > =C0=E2=E3=F3=F1=F2 17 00:29:50 EEST > >---------------------------------- > > > >Martin Ivanov wrote: > >>=20 > >> 1. How to make the UPS power off after the PC powers off in case of p> ower > >> failure. Of course when there is no power failure, but I issue shutd> own=20 > >> command to the system, the UPS must not power off. > > > >The answer to this question in contained in the file INSTALL that is > >distributed with NUT. The answer is under "Configuring shutdowns for > >low battery events" -> "11. Edit your shutdown scripts: add upsdrvctl > >shutdown" (line 503).=20 > > > >-- Peter > > > > ----------------------------------------------------------------- > http://ide.li/ - =EF=EE=F0=F2=E0=EB =E7=E0 =E1=FA=EB=E3=E0=F0=E8=F2=E5 =EF> =EE =F1=E2=E5=F2=E0. =D1=F2=E0=F2=E8=E8, =ED=EE=E2=E8=ED=E8, =F4=EE=F0=F3> =EC=E8, =F1=ED=E8=EC=EA=E8, =E8=ED=F4=EE=F0=EC=E0=F6=E8=FF. > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser@lists.alioth.debian.org > http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser >
Hi Martin, sorry for the delay, but i been off line for a day. That is why you should keep the traffic on the list so someone else can answer you. tor 2006-08-17 klockan 09:48 +0300 skrev Martin Ivanov:> Thank you for your response. > The point is that I have configured my system to shut down at the event "upsc Inform@localhost ups.status"!="OL", not at "LB". So there will be no /etc/killpower file created. At an ups.status != "OL" event, the following script named "notifyme" is run: > > echo `date` >> /root/upsLog > echo " No power, shutting down the system!" >> /root/upsLog > sleep 30 > control=`/usr/local/ups/bin/upsc Inform@localhost ups.status` > if [ $control != OL ] > then > /sbin/telinit 0 > fi > > I tried adding the line: "touch /etc/powerdown" to the "notifyme" script and the lines: > > if (test -f /etc/powerdown) > then > echo "Killing the power, bye!" > /usr/local/ups/bin/upsdrvctl shutdown > > sleep 120 > > fi > > to the /etc/rc.d/rc.6 script, but when I simulated a power failure, the system shut down, but the UPS did not. I think I did not add the lines at the correct place in the rc.6 script, or probably there is poor communication between the UPS and the software, for I am not sure the software I am using is for my UPS. I just found out that the powercom driver gives "OL" when the UPS is connected to the mains, and "OB BOOST" when it is disconnected. > Besides, I am not quite sure whether I need to make the UPS itself go down in case of power failure, because if it does not go down, it has the chance to get charged when power returns. Now after in case of power failure the PC shuts down and the UPS goes on buzzing, but it can go on buzzing like that for quite a lot time before the battery gets damaged, because the PC is off and the power consumption from the UPS battery is minimal, am I not right? > So what would you recommend to me? MAke the UPS itself power off after system shutdown in case of power failure, or leave it buzzing till power returns? > In case you advise me to make the UPS go down itself after the system shutdown, I will be thankful to you if you tell me if the method I suggest to achieve that is working and where in the shutdown script I need to add it?See that you have come a long way on getting things to work. About the early mail. ------------quote------------- The result of "/usr/local/ups/bin/powercom -DDDD -u marto -a Inform" is: Network UPS Tools - PowerCom and similars protocol UPS driver $ Revision: 0.5 $ (2.0.4) debug level is '4' Values of arguments: manufacturer : 'PowerCom' model name : 'Unknown' serial number : 'Unknown' line voltage : '220' type : 'KIN1500AP' number of bytes from UPS: '16' method of flow control : 'no_flow_control' validation sequence: '{{7,0},{8,0},{8,0}}' shutdown arguments: '{{0,10},n}' frequency calculation coefficients: '{0.000210,0.000000}' load percentage calculation coefficients: '{6.134300,-0.380800,1.075000,0.181100}' battery percentage calculation coefficients: '{5.000000,0.326800,-825.000000,0.465110,0.000000}' voltage calculation coefficients: '{0.828570,0.000000}' Flow control disable input.frequency (raw data): [raw: 96] input.frequency: 49.61 output.frequency (raw data): [raw: 97] output.frequency: 49.10 ups.load (raw data): [raw: 37] ups.load: 40.0 battery.charge (raw data): [raw: 210] battery.charge: (null) input.voltage (raw data): [raw: 123] input.voltage: 236.3 input.voltage (raw data): [raw: 123] output.voltage: 236.3 STATUS: OL 8<-------snip------------ Would you please tell me what the problem is, for I have no idea. And then, when these technical problems get fixed, I will start experimentin with the types: Trust, KP625AP,KIN2200AP,Egys,KIN525AP,KIN1500AP. How shall I know that I have come on a successful configuration? ------end quote---------- To know if the driver type setting is right it's only to test and see the type that gives the right readings. The type you use now seems to give some strange readings when OnBattery. But the reading looks sane to me when you are OnLine. The BOOST you see when on battery looks like a bug. As i can see in the code, if the input voltage is lower then the line voltage in the config it gives BOOST. But it may due to that the AVR_ON bit is not read correctly by your driver setting. Then about the shutdown. Reading the code from the driver some of the ups need a minute and seconds argument to shutdown. The type you use now is only sending the second value. So in the ups.conf you may add shutdownArguments = {{0,10},y} This will send 0 minutes 10 seconds and tell the driver to use both parameters. You can test it by adding this and do a upsdrvctr shutdown, and it should power off in 10 seconds. (Don't use the ups to feed you computer during this test!) The best is to make one piece at the time to function. So start whit getting the driver to act OK. Then you can start the upsd and configure the monitor to do the things you want. But you have come a long way GOOD WORK Martin. When everything works you may tell us the settings and type of ups so we can add it to the list and enter the information. Regards Kjell