[Nut-upsuser] Master privileges unavailable on UPS,
no access :(
Jonathan Dion
dion.jonathan at gmail.com
Wed Aug 16 16:03:30 UTC 2006
Hi ^_^
Please "reply to all" when you reply Martin, so it stay in the list ^_^
thanks you.
On 8/16/06, Martin Ivanov <tramni at abv.bg> wrote:
> Thank you very much for your responsiveness. I followed your instructions and those of the site you gave to me, downloaded, compiled and installed the xosd package. I issued the command "xhost +local:marto.
> Then I modified upsmon.conf like that:
> RUN_AS_USER marto
> MONITOR Inform at localhost 1 marto password master
> MINSUPPLIES 1
> SHUTDOWNCMD "/sbin/shutdown -h now"
> NOTIFYCMD /usr/local/ups/bin/notifyme
> POLLFREQ 5
> POLLFREQALERT 5
> HOSTSYNC 0
> DEADTIME 15
> POWERDOWNFLAG /etc/killpower
> NOTIFYMSG ONLINE "UPS %s is getting line power"
> NOTIFYMSG ONBATT "Someone pulled the plug on %s"
> NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
> RBWARNTIME 43200
> NOCOMMWARNTIME 300
> FINALDELAY 0
> The file notifyme is executable and contains:
> echo "The system is shutting down"
>
> When I unplugged the UPS, nothing happened, no message,no shutdown. I do not care so much about the messages, my primary desire is to make the system issue the command "shutdown -h now" or "telinit 0" whenever the ups.status=OB BOOST, i.e whenever the mains electric supply fails. I want the system to go down when the mains power goes down, not when the UPS battery gets low or on the verge of exhaustion. Isn't there some way to achieve that?
>
> I am looking forward to your answer.
>
> Regards,
> Martin
>
> -----------------------------------------------------------------
> http://ide.li/ - портал за българите по света. Статии, новини, форуми, снимки, информация.
>
Regarding the message issue, I have the same problem, I only receive
notify when I log into a xterm and not if I log into a Konsole. I
never dug anymore into this problem, but I know that it was a subject
of concern for Arnaud (NUT Leader).
Regarding the shutdown command : Are you sure you want this behaviour
? It would say that even for micro power outage, your computer would
shutdown. On some UPS, there is the possibility to set the low battery
value, so the low battery flag triggers earlier, before the battery is
"on the verge of exhaustion". In most case, the low battery is
trigered when battery comes to 30% or 20% of capability. It usually
let enough time to shutdown the computer.
I think it would be better to do it like that if your UPS allow it.
Even set it to 90% if you want, but I think shutting down each time
there is a minor power outage is cutting down the interest to have an
UPS.
Anyway, I'll answer your question : there is a way to do it, of course ^_^
The NOTIFYCMD flag in upsmon.conf define the command to launch every
time an event that have EXEC in its NOTIFYFLAG occures. you can make a
shell script launched with this, that test if the event that triggered
him was OnBatt (if you put EXEC not only on ONBATT, no use else to
test) and if it was call "shutdown -h now"
For more information about how NOTIFYCMD works and how to get the
event in the called script, please look "man upsmon.conf"
Cheer,
Jonathan Dion
More information about the Nut-upsuser
mailing list