Results 11 to 20 of 32
I followed all the steps in this documentation with me local parameters and when I try upscmd command with the following parameters is gives the error
Code:
[root@proxy /]# upscmd ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-23-2012 #11
I followed all the steps in this documentation with me local parameters and when I try upscmd command with the following parameters is gives the error
Code:[root@proxy /]# upscmd -u root -p xxxxxx MGE test.battery.start.quick Unexpected response from upsd: ERR ACCESS-DENIED
my NUT setup supports only the following UPS commands
Code:[root@proxy /]# upscmd -l MGE@localhost Instant commands supported on UPS [MGE]: beeper.disable - Disable the UPS beeper beeper.enable - Enable the UPS beeper beeper.mute - Temporarily mute the UPS beeper beeper.off - Obsolete (use beeper.disable or beeper.mute) beeper.on - Obsolete (use beeper.enable) load.off - Turn off the load immediately load.off.delay - Turn off the load with a delay (seconds) load.on - Turn on the load immediately load.on.delay - Turn on the load with a delay (seconds) outlet.1.load.off - Turn off the load on outlet 1 immediately outlet.1.load.on - Turn on the load on outlet 1 immediately outlet.2.load.off - Turn off the load on outlet 2 immediately outlet.2.load.on - Turn on the load on outlet 2 immediately shutdown.return - Turn off the load and return when power is back shutdown.stayoff - Turn off the load and remain off shutdown.stop - Stop a shutdown in progress test.battery.start.deep - Start a deep battery test test.battery.start.quick - Start a quick battery test test.battery.stop - Stop the battery test
and the command /etc/init.d/ups start has the following result
Code:[root@proxy /]# /etc/init.d/ups start Starting UPS driver controller: [ OK ] Starting upsd: [ OK ] Starting UPS monitor (master): [ OK ]
- 10-24-2012 #12Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,696
Unfortunately, I don't have a UPS w/which to test, so I can't follow along with you. Looking at the man page, I can only suggest taking a look at your upsd.users file setup:
DIAGNOSTICS
upscmd won't work unless you provide a valid username and password. If you get "access denied" errors, make sure that your upsd.users(5) has an entry for you, and that the username you are using has permissions to SET variables.
- 10-24-2012 #13
Thanks Atreyu,
I edited the upsd.users file so that it looks like below
and after that command workedCode:[root] password = xxxxxx upsmon = master instcmds = test.battery.start.quick instcmds = test.batery.stop
Could I know how long I have to wait to shutdown the PC with these default settings when it runs from UPS battery?Code:[root@proxy ~]# upscmd -u root -p xxxxxx 3000 test.battery.start.quick OK
Thanks
- 10-24-2012 #14Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,696
Do you mean how long does your UPS battery last? I don't know that, it should be in your UPS specs, but 30 minutes is common.
If you mean how soon should you initiate a shutdown on your server when the UPS software detects a power outage, i'd say immediately. That is: immediately start to shut things (daemons, processes, warn users about the server going down w/a wall message, etc.) in a graceful fashion. You want your filesystems to have no I/O happening, if the battery kicks it and you are not done bringing down the system.
I'm not really sure how the ups software works w/the system to shut it down, but i imagine you define it somewhere. I would just make sure that things like Oracle and Samba are shut down first, and then a normal "shutdown -h now" (or similar, lots of options to shutdown) can be done.
- 10-24-2012 #15
Dear Atreyu
Yes the second option ie the server shutdown process, not the UPS battery dead time. If I can configure NUT to start the process after 5 minutes; when the server runs from the UPS battery that would be fine because some times the main power is available within fine minute time during frequent power interruptions. I suppose it should be configured in
somewhere in the upsmon.conf file when executing vi /etc/ups/upsmon.conf commandCode:MONITOR MGE@localhost 1 root xxxx master MINSUPPLIES 1 SHUTDOWNCMD "/sbin/shutdown -h +0" POLLFREQ 5 POLLFREQALERT 5 HOSTSYNC 15 DEADTIME 15 POWERDOWNFLAG /etc/killpower RBWARNTIME 43200 NOCOMMWARNTIME 300 FINALDELAY 5
- 10-26-2012 #16
Hi I tested the UPS by Disconnecting the main A/C current supply to the UPS
when that was being done I got the following message at the Linuxbox terminal
But I waited for three minutes my CentOS server didn't shutdownCode:UPS 3000@localhost on battery Broadcast message from nut@proxy.server (Wed Oct 24 17:21:15 2012): UPS 3000@localhost on line power
- 10-26-2012 #17Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,696
- 10-26-2012 #18
Yes Atreyu,
those are...
Code:Oct 24 17:14:54 proxy usbhid-ups[2741]: Startup successful Oct 24 17:14:54 proxy upsd[2743]: listening on 127.0.0.1 port 3493 Oct 24 17:14:54 proxy upsd[2743]: Connected to UPS [3000]: usbhid-ups-3000 Oct 24 17:14:54 proxy upsd[2743]: Unknown upsmon type = Oct 24 17:14:54 proxy upsd[2744]: Startup successful Oct 24 17:14:54 proxy upsmon[2747]: Startup successful Oct 24 17:14:54 proxy upsd[2744]: User root@127.0.0.1 logged into UPS [3000] Oct 24 17:18:34 proxy upsmon[2748]: UPS 3000@localhost on battery Oct 24 17:18:34 proxy kernel: type=1400 audit(1351079314.997:4): avc: denied { search } for pid=2757 comm="sh" name="home" dev=sda3 ino=9175041 scontext=unconfined_u:system_r:nut_upsmon_t:s0 tcontext=system_u:object_r:home_root_t:s0 tclass=dir Oct 24 17:18:35 proxy wall[2757]: wall: user nut broadcasted 1 lines (31 chars) Oct 24 17:21:15 proxy upsmon[2748]: UPS 3000@localhost on line power Oct 24 17:21:15 proxy kernel: type=1400 audit(1351079475.002:5): avc: denied { search } for pid=2767 comm="sh" name="home" dev=sda3 ino=9175041 scontext=unconfined_u:system_r:nut_upsmon_t:s0 tcontext=system_u:object_r:home_root_t:s0 tclass=dir Oct 24 17:21:15 proxy wall[2767]: wall: user nut broadcasted 1 lines (34 chars) Oct 24 17:23:41 proxy dbus: [system] Rejected send message, 1 matched rules; type="method_call", sender=":1.64" (uid=0 pid=2804 comm="/usr/bin/python) interface="org.freedesktop.NetworkManager" member="GetDevices" error name="(unset)" requested_reply=0 destination=":1.46" (uid=500 pid=2433 comm="nm-applet)) Oct 24 17:24:05 proxy kernel: ip_tables: (C) 2000-2006 Netfilter Core Team Oct 24 17:24:05 proxy kernel: nf_conntrack version 0.5.0 (16384 buckets, 65536 max) Oct 24 17:24:05 proxy kernel: ip6_tables: (C) 2000-2006 Netfilter Core Team Oct 24 17:24:22 proxy init: tty (/dev/tty2) main process (2147) killed by TERM signal Oct 24 17:24:22 proxy init: tty (/dev/tty3) main process (2149) killed by TERM signal Oct 24 17:24:22 proxy init: tty (/dev/tty4) main process (2151) killed by TERM signal Oct 24 17:24:22 proxy init: tty (/dev/tty5) main process (2153) killed by TERM signal Oct 24 17:24:22 proxy init: tty (/dev/tty6) main process (2155) killed by TERM signal Oct 24 17:24:22 proxy avahi-daemon[1757]: Got SIGTERM, quitting. Oct 24 17:24:22 proxy avahi-daemon[1757]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.101.31. Oct 24 17:24:23 proxy abrtd: Got signal 15, exiting Oct 24 17:24:26 proxy acpid: exiting Oct 24 17:24:27 proxy upsmon[2748]: Signal 15: exiting Oct 24 17:24:27 proxy upsd[2744]: User root@127.0.0.1 logged out from UPS [3000] Oct 24 17:24:27 proxy upsmon[2747]: upsmon parent: read Oct 24 17:24:27 proxy upsd[2744]: mainloop: Interrupted system call Oct 24 17:24:27 proxy upsd[2744]: Signal 15: exiting Oct 24 17:24:27 proxy NetworkManager[1745]: <info> caught signal 15, shutting down normally. Oct 24 17:24:27 proxy NetworkManager[1745]: <info> exiting (success)
- 10-26-2012 #19Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,696
it looks like things are starting to shut down...is there anything in dmesg?
it looks like SELinux is enabled. Could that be interfering? You can check if enabled with:
and temporarily disable it with:Code:getenforce
Code:setenforce 0
- 10-26-2012 #20
Yes SELinux is in enforcing mode I temporarily disabled it. Will give you the resuls of the setting.
Thanks


Reply With Quote

