Operating System - HP-UX
1833875 Members
2123 Online
110063 Solutions
New Discussion

Re: ups_mond - performing additional actions

 
BASIS BCC
New Member

ups_mond - performing additional actions

Is there any way to use customer scripts when ups_mond receives signal about power interruption? I was looking into ups_conf but haven't found any possibilities. Many thanks for help, Marek
3 REPLIES 3
Pete Randall
Outstanding Contributor

Re: ups_mond - performing additional actions

I don't see anything in ups_conf either. The only possibility I can think of is to add scripts into the shutdown process but it sounds like you're hoping to initiate something sooner than that.

Pete

Pete
BASIS BCC
New Member

Re: ups_mond - performing additional actions

Exactly, I'd like to inform users about power failure and possibility of shutdown. Marek
Rod White
Frequent Advisor

Re: ups_mond - performing additional actions

Guys

I'm no great sys admin on HP-UX but I'm going to face the same problem in a few days time when my first UPS arrives.

Thinking about the way that the ups_mond runs and what you and I want to achieve, say an email to me, a notice to users, an email to a remote server to also take action before the shutdown. Then if these things were in a normal shutdown script they would occur every time a shutdown/reboot occured right!

So I thought that because ups_mond first calls /etc/shutdown -h before calling /etc/reboot -h, I could do the following

1) delete /etc/shutdown because it is a link to /usr/sbin/shutdown

2) create a new /etc/shutdown that grepped /var/adm/syslog/syslog.log for a recent entry from ups_mond, and if found in the file, sent my email, etc etc etc, slept for 1 minute then executed /usr/sbin/shutdown -h and if not found in that file then executed /usr/sbin/shutdown -h immediatly

If anyone has a good reason why this would be a BAD way to do it, or has a better way then by all means please let me know before I try this out.

Rod