Min Wang
2016-May-09 23:55 UTC
[Nut-upsuser] cyberpower ups need to manully turn on the switch
HI
in centos: C="/usr/bin/upssched-cmd"
here is the output of that file:
# more /tmp/NUT.report
NUT configuration 2016-05-10 03:02:20 UTC
########### /etc/ups/nut.conf ###########
MODE=netserver
########### /etc/ups/ups.conf ###########
[cyberpower]
#driver = powerpanel
#port = auto
driver = usbhid-ups
port = auto
vendorid = 0764
desc = " My main server 19"
########### /etc/ups/upsd.conf ###########
LISTEN 127.0.0.1 3493
LISTEN 192.168.1.19 3493
LISTEN ::1 3493
########### /etc/ups/upsd.users ###########
[admin]
password = *********
actions = SET
instcmds = ALL
[upsmon]
password = *********
upsmon master
[upsmonslave]
password = *********
upsmon slave
########### /etc/ups/upsmon.conf ###########
MONITOR cyberpower at localhost 1 upsmon ********* master
MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -hP +0"
POLLFREQ 5
POLLFREQALERT 5
HOSTSYNC 15
DEADTIME 15
POWERDOWNFLAG /etc/killpower
NOTIFYMSG LOWBATT "UPS %s battery is low"
NOTIFYMSG FSD "UPS %s: forced shutdown in progress"
NOTIFYMSG SHUTDOWN "Auto logout and shutdown proceeding"
NOTIFYMSG REPLBATT "UPS %s battery needs to be replaced"
NOTIFYMSG NOCOMM "UPS %s is unavailable"
NOTIFYMSG NOPARENT "upsmon parent process died - shutdown impossible"
NOTIFYFLAG LOWBATT SYSLOG+WALL
NOTIFYFLAG SHUTDOWN SYSLOG+WALL
NOTIFYFLAG REPLBATT SYSLOG+WALL
NOTIFYFLAG NOCOMM SYSLOG+WALL
NOTIFYFLAG NOPARENT SYSLOG+WALL
RBWARNTIME 43200
NOCOMMWARNTIME 300
FINALDELAY 5
########### /etc/ups/upssched.conf ###########
CMDSCRIPT /usr/bin/upssched-cmd
########### /usr/bin/upssched-cmd ###########
case $1 in
upsgone)
logger -t upssched-cmd "The UPS has been gone for awhile"
;;
*)
logger -t upssched-cmd "Unrecognized command: $1"
;;
esac
########### /etc/hosts.allow ###########
########### ps aux ###########
nut 2651 0.0 0.0 43396 1116 ? Ss May07 0:08
/usr/sbin/upsd
root 2654 0.0 0.0 39116 1172 ? Ss May07 0:00
/usr/sbin/upsmon
nut 2655 0.0 0.0 41208 1300 ? S May07 0:03
/usr/sbin/upsmon
########### Ownership and permissions ###########
-rwxr-xr-x. 1 root root 64824 May 15 2013 /usr/sbin/upsd*
-rwxr-xr-x. 1 root root 44296 May 15 2013 /usr/sbin/upsmon*
-rwxr-xr-x. 1 root root 28816 May 15 2013 /usr/sbin/upssched*
-rw-r-----. 1 root nut 1554 Mar 22 2014 /etc/ups/nut.conf
-rw-r-----. 1 root nut 3797 Mar 22 2014 /etc/ups/ups.conf
-rw-r-----. 1 root nut 2807 Mar 22 2014 /etc/ups/upsd.conf
-rw-r-----. 1 root nut 2294 May 7 14:28 /etc/ups/upsd.users
-rw-r-----. 1 root root 2131 Mar 22 2014 /etc/ups/upsd.users.orig
-rw-r-----. 1 root nut 11948 May 11 2014 /etc/ups/upsmon.conf
-rw-r-----. 1 root root 11913 Mar 22 2014 /etc/ups/upsmon.conf.orig
-rw-r-----. 1 root nut 3891 May 15 2013 /etc/ups/upssched.conf
min
On Mon, May 9, 2016 at 6:00 AM, Roger Price <roger at rogerprice.org>
wrote:
> On Sun, 8 May 2016, Min Wang wrote:
>
> Hi
>> centos 6.3 uses traditional SysV script ( not systemctl)
>>
>> here is the /etc/init.d/ups ( script) assuming it similar to
nutshutdown
>>
>
> File /etc/init.d/ups is an administrative script which is used to set up
> the nut daemon - I was looking for a run-time script called by systemd, but
> since there is no systemd, could you run the attached Bash script which
> will prepare a report on your NUT configuration for you to post. Perhaps
> this will show what is not sending the "upsdrvctl shutdown"
order.
>
> Check the address C="/usr/sbin/upssched-cmd" You may not have a
file
> upssched-cmd, or CentOS may put this somewhere else.
>
> Roger
>
> #!/bin/bash
> # Report NUT configuration
> # Remove comments, blank lines and passwords
>
> C="/usr/sbin/upssched-cmd" # Please check !!
> D="/etc/ups" # Where does CentOS hide the UPC
configuration?
> T=`mktemp` # Temporary file
> R="/tmp/NUT.report" # T without passwords
>
> echo -e " NUT configuration `date --utc '+%Y-%m-%d
%T %Z'`"
> > $T
>
> # Configuration files, remove comments and empty lines
> RE="^#.*$|^[[:space:]]*$"
> for F in $D/nut.conf $D/ups.conf $D/upsd.conf $D/upsd.users $D/upsmon.conf
> $D/upssched.conf $C
> do echo -e "\n ########### $F ###########" >> $T
> if [[ -f "$F" && -r "$F" ]] ; then
> cat $F | grep -v -E "$RE" >> $T
> else echo "Cannot access $F" >> $T
> fi
> done
> # Get upsd rules out of hosts.allow
> HA="/etc/hosts.allow"
> echo -e "\n ########### $HA ###########" >> $T
> if [[ -f "$HA" && -r "$HA" ]] ; then
> grep -v -E "^#.*$|^[[:space:]]*$" < $HA |
> while read L || [[ -n "$L" ]]
> do if [[ "$L" =~ ^.*(upsd.*)$ ]]
> then TRIM=$L # Bash removes unwanted white space
> echo $TRIM >> $T
> fi
> done
> else echo "Cannot access $HA" >> $T
> fi
>
> # Processes
> echo -e "\n ########### ps aux ###########" >> $T
> ps aux | grep "/ups" | grep -v "grep" >> $T
>
> # Ownership and permissions
> echo -e "\n ########### Ownership and permissions
###########" >> $T
> ls -alF /usr/sbin/ups* >> $T
> ls -alF /etc/ups/* | grep -v -E "~|stats|set" >> $T
>
> # Remove password from report
> L=`grep password $T | tr -d " \t\n\r"`
> if [[ "$L" =~ ^.*=(.+)$ ]]
> then PASS="${BASH_REMATCH[1]}"
> sed "s/$PASS/*********/" < $T > $R
> else # Could not find a password
> cat $T > $R
> fi
>
> echo "I have created file \"$R\" with a summary of your NUT
configuration."
> echo "Passwords have been removed."
> rm $T;
> exit
>
>
> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
>
--
http://www.comrite.com
Yellow pages, Ads and Search
http://www.meidongnet.com
News, Ads, Free Online dating, Games for Chinese Community in NY, NJ, PA
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20160509/0565a2a1/attachment.html>
Roger Price
2016-May-10 20:16 UTC
[Nut-upsuser] cyberpower ups need to manully turn on the switch
On Mon, 9 May 2016, Min Wang wrote:> HIin centos: C="/usr/bin/upssched-cmd"?Noted, thanks.> here is the output of that file: > > ? ? ? ? ########### ps aux ########### > nut ? ? ? 2651 ?0.0 ?0.0 ?43396 ?1116 ? ? ? ? ?Ss ? May07 ? 0:08 /usr/sbin/upsd > root ? ? ?2654 ?0.0 ?0.0 ?39116 ?1172 ? ? ? ? ?Ss ? May07 ? 0:00 /usr/sbin/upsmon > nut ? ? ? 2655 ?0.0 ?0.0 ?41208 ?1300 ? ? ? ? ?S ? ?May07 ? 0:03 /usr/sbin/upsmonMy NUT setup shows: upsd 2859 0.0 0.0 13228 880 ? Ss avril24 3:16 /usr/lib/ups/driver/usbhid-ups -a Eaton-66781 upsd 2863 0.0 0.0 19860 1052 ? Ss avril24 0:34 /usr/sbin/upsd -u upsd root 2866 0.0 0.0 19400 656 ? Ss avril24 0:00 /usr/sbin/upsmon upsd 2867 0.0 0.0 19824 824 ? S avril24 0:30 /usr/sbin/upsmon Note the extra "upshid-ups" line. If your driver is not running then perhaps that explains why the UPS shutdown command is not being sent. What does command grep usbhid /var/log/messages report? Roger
Min Wang
2016-May-11 01:07 UTC
[Nut-upsuser] cyberpower ups need to manully turn on the switch
Hi the grep usbhid /var/log/messages said: May 10 23:53:17 kvm-hosts-1 upsd[1762]: Can't connect to UPS [cyberpower] (usbhid-ups-cyberpower): No such file or directory May 10 23:58:17 kvm-hosts-1 upsd[1762]: Can't connect to UPS [cyberpower] (usbhid-ups-cyberpower): No such file or directory it seems I did not have usbhid-ups running, so I /etc/init.d/ups restart # ps -ef | grep usbhid root 91 2 0 May10 ? 00:00:00 [usbhid_resumer] nut 16315 1 0 00:06 ? 00:00:00 /sbin/usbhid-ups -a cyberpower now it is running. hmm, strange. min On Tue, May 10, 2016 at 4:16 PM, Roger Price <roger at rogerprice.org> wrote:> On Mon, 9 May 2016, Min Wang wrote: > > HIin centos: C="/usr/bin/upssched-cmd" >> > > Noted, thanks. > > here is the output of that file: >> >> ########### ps aux ########### >> nut 2651 0.0 0.0 43396 1116 ? Ss May07 0:08 >> /usr/sbin/upsd >> root 2654 0.0 0.0 39116 1172 ? Ss May07 0:00 >> /usr/sbin/upsmon >> nut 2655 0.0 0.0 41208 1300 ? S May07 0:03 >> /usr/sbin/upsmon >> > > My NUT setup shows: > > upsd 2859 0.0 0.0 13228 880 ? Ss avril24 3:16 > /usr/lib/ups/driver/usbhid-ups -a Eaton-66781 > upsd 2863 0.0 0.0 19860 1052 ? Ss avril24 0:34 /usr/sbin/upsd -u upsd > root 2866 0.0 0.0 19400 656 ? Ss avril24 0:00 /usr/sbin/upsmon > upsd 2867 0.0 0.0 19824 824 ? S avril24 0:30 /usr/sbin/upsmon > > Note the extra "upshid-ups" line. If your driver is not running then > perhaps that explains why the UPS shutdown command is not being sent. > > What does command grep usbhid /var/log/messages report? > > Roger > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at lists.alioth.debian.org > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser >-- http://www.comrite.com Yellow pages, Ads and Search http://www.meidongnet.com News, Ads, Free Online dating, Games for Chinese Community in NY, NJ, PA -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20160510/e2b90b47/attachment.html>