Determine if shutdown was started after it's been cancelled (23 Views)
Reply
Super Advisor
Carl Houseman
Posts: 219
Registered: ‎04-04-2006
Message 1 of 8 (23 Views)

Determine if shutdown was started after it's been cancelled

HP Power Manager (HPPM) 4.1 is directly or indirectly sending the following broadcast messages:

Broadcast Message from root () Sat May 5 14:17:40...
System is being shut down in approximately 2 minute(s).

Broadcast Message from root () Sat May 5 14:17:47...
System shut down has been canceled. (Power Fail)

How can I, from a script in another process, figure out that the shutdown was started and then cancelled? I can't find any log file that records that a shutdown was ever started.

The HPPM log files are binary, not easily deciphered.
Please use plain text.
Honored Contributor
Sandman!
Posts: 2,220
Registered: ‎01-13-2005
Message 2 of 8 (23 Views)

Re: Determine if shutdown was started after it's been cancelled

How about the /etc/shutdownlog file?
Please use plain text.
Honored Contributor
Sandman!
Posts: 2,220
Registered: ‎01-13-2005
Message 3 of 8 (23 Views)

Re: Determine if shutdown was started after it's been cancelled

Or you could run strings on the HPPM log files and grep for keywords viz.,

# strings | egrep "Broadcast|shut down|canceled"
Please use plain text.
Super Advisor
Carl Houseman
Posts: 219
Registered: ‎04-04-2006
Message 4 of 8 (23 Views)

Re: Determine if shutdown was started after it's been cancelled

By the time something is recorded in /etc/shutdownlog, the system has actually been shutdown.

When I said the HPPM log is "not easily deciphered" that means "no text" - nothing for strings to show.
Please use plain text.
Exalted Contributor
Steven E. Protter
Posts: 33,806
Registered: ‎08-15-2002
Message 5 of 8 (23 Views)

Re: Determine if shutdown was started after it's been cancelled

Shalom,

tail -f /var/adm/syslog/syslog.log

You will see shutdown data there.

Connect to the console, you will see ongoing data to that device.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Please use plain text.
Super Advisor
Carl Houseman
Posts: 219
Registered: ‎04-04-2006
Message 6 of 8 (23 Views)

Re: Determine if shutdown was started after it's been cancelled

Obvious answers aren't going to work for this one. syslog's got nothing.
Please use plain text.
Super Advisor
Carl Houseman
Posts: 219
Registered: ‎04-04-2006
Message 7 of 8 (23 Views)

Re: Determine if shutdown was started after it's been cancelled

Is there something I can run that looks like a logged-in terminal which will receive and record the broadcast messages to a file?
Please use plain text.
Super Advisor
Carl Houseman
Posts: 219
Registered: ‎04-04-2006
Message 8 of 8 (23 Views)

Re: Determine if shutdown was started after it's been cancelled

I found my answer by digging into the HPPM setup pages and docs. HPPM can run a predefined script at shutdown. From there I can log something to syslog, set flags and so forth.

I'd still be interested to know of any way to capture broadcast messages to a file.
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation