Ito-Cole, Kaeny (Student)
2018-Sep-20 20:30 UTC
[Nut-upsuser] Upssched not getting called from UPSMON
Hi, I cant seem to get my upssched to get called by upsmon. Upsmon -c fsd just shuts down without the message I set or the one in upssched-cmd /etc/ups/upsmon.conf: MONITOR ups6 at localhost 1 <user> <pass> master MONITOR ups8 at localhost 1 <user> <pass> master SHUTDOWNCMD "/sbin/shutdown -h +0" NOTIFYCMD /usr/sbin/upssched NOTIFYMSG FSD "UPS %s: forced shutdown in progress TEST" NOTIFYFLAG ONLINE SYSLOG+EXEC NOTIFYFLAG ONBATT SYSLOG+EXEC NOTIFYFLAG LOWBATT SYSLOG+EXEC+WALL NOTIFYFLAG FSD SYSLOG+EXEC+WALL NOTIFYFLAG COMMOK SYSLOG+EXEC+WALL NOTIFYFLAG COMMBAD SYSLOG+EXEC+WALL NOTIFYFLAG SHUTDOWN SYSLOG+EXEC+WALL NOTIFYFLAG REPLBATT SYSLOG+EXEC+WALL NOTIFYFLAG NOCOMM SYSLOG+EXEC+WALL NOTIFYFLAG NOPARENT SYSLOG+EXEC+WALL First question is: where is syslog located? I don’t see it in my /var/log folder. Even when I use WALL, I don’t get the message that I set for NOTIFYMSG FSG /etc/ups/upssched.conf CMDSCRIPT /etc/ups/scripts/upssched-cmd PIPEFN /etc/ups/upssched/upssched.pipe LOCKFN /etc/ups/upssched/upssched.lock AT ONLINE ups8 at localhost EXECUTE UPS8_ONLINE AT ONLINE ups6 at localhost EXECUTE UPS6_ONLINE AT ONBATT ups6 at localhost EXECUTE UPS6_ONBATT AT ONBATT ups8 at localhost EXECUTE UPS8_ONBATT AT FSD * EXECUTE shutdown_FSD None of these get called when the events occur. /etc/ups/scripts/upssched-cmd WALL=wall case $1 in upsgone) logger -t upssched-cmd "The UPS has been gone for awhile" ;; UPS6_ONLINE) logger -t upssched-cmd "UPS6 is online" echo "UPS6 is ONLINE" | ${WALL} ;; UPS8_ONLINE) logger -t upssched-cmd "UPS8 is online" echo "UPS8 is ONLINE" | ${WALL} ;; UPS6_ONBATT) logger -t upssched-cmd "UPS6 is running on battery. Shutting down attached devices." echo "UPS6 is running on battery!" | ${WALL} echo "No Servers attached to this UPS. No shutdown starting" | ${WALL} ;; UPS8_ONBATT) logger -t upssched-cmd "UPS8 is running on battery" echo "UPS8 is running on battery!" | ${WALL} echo "Shutting down VMs on ESXi 192.168.23.3 and 192.168.24.3" | ${WALL} ssh root at 192.168.23.3 "nohup /vmfs/volumes/datastore1/UPScontrol/shutdown_esxi.sh> /dev/null 2>&1 &" ssh root at 192.168.24.3 "nohup /vmfs/volumes/datastore1/UPScontrol/shutdown_esxi.sh> /dev/null 2>&1 &" echo "finished shutting ESXI down..." | ${WALL} exit 0 ;; shutdown_FSD) logger -t upssched-cmd "FSD command" echo "Forced shutdown" | ${WALL} ;; *) logger -t upssched-cmd "Unrecognized command: $1" ;; esac None of this happens when the events occur. Can someone help me as to why this is? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20180920/670e73d6/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3246 bytes Desc: not available URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20180920/670e73d6/attachment.bin>
Where syslog output ends up is an OS specific question and depends upon the configuration of the system logger in use. On most systems the logging information will be found in /var/log. On most Linux systems, the default system log is /var/log/messages. Denny> On Sep 20, 2018, at 13:30, Ito-Cole, Kaeny (Student) <Kaeny.Ito-Cole.stu at gtri.gatech.edu> wrote: > > First question is: where is syslog located? I don’t see it in my /var/log folder. Even when I use WALL, I don’t get the message that I set for NOTIFYMSG FSG >
Ito-Cole, Kaeny (Student)
2018-Sep-21 17:25 UTC
[Nut-upsuser] Upssched not getting called from UPSMON
Ah yes sorry I forgot to specify I am on CentOS 7 and the newest NUT for that is 2.7.2 On 9/21/18, 9:04 AM, "Denny Page" <denny at cococafe.com> wrote: Where syslog output ends up is an OS specific question and depends upon the configuration of the system logger in use. On most systems the logging information will be found in /var/log. On most Linux systems, the default system log is /var/log/messages. Denny > On Sep 20, 2018, at 13:30, Ito-Cole, Kaeny (Student) <Kaeny.Ito-Cole.stu at gtri.gatech.edu> wrote: > > First question is: where is syslog located? I don’t see it in my /var/log folder. Even when I use WALL, I don’t get the message that I set for NOTIFYMSG FSG > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3246 bytes Desc: not available URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20180921/8a333f28/attachment.bin>
On Thu, 20 Sep 2018, Ito-Cole, Kaeny (Student) wrote:> Hi, I cant seem to get my upssched to get called by upsmon. Upsmon -c fsd just > shuts down without the message I set or the one in upssched-cmd> /etc/ups/upssched.conf > CMDSCRIPT /etc/ups/scripts/upssched-cmdHave you checked ownership and permissions for upssched and upssched-cmd? Can you run upssched/upssched-cmd directly from the command line as whatever user upsmon is run at? wall is no longer fit for purpose. Once you have upssched-cmd working, you need to set up notify-send. Roger