Understanding Heartbeat's State

Alan Robertson alanr@unix.sh
Fri, 09 Feb 2001 00:02:28 -0700


Tony Willoughby wrote:
> 
> I'm looking for the best way to obtain the state of heartbeat.
> 
> Here's why:  I use heartbeat in a system with two redundant cards
> (running Red Hat 6.1).
> 
> The system has a CLI that will allow one to control heartbeat.  I'd like
> to have a CLI command that initiates a failover between these cards.
> But, that CLI command should fail (not do the failover) if the primary
> has not heard from the secondary (say it's not booted or not installed).
> 
> It seems I could do something with set_nstatus_callback(), but this
> seems a little heavy for what I need.

If you're programming this in 'C' or python or something, this is the best
way.

> Is there a way to learn the status of heartbeat through /proc or
> /var/state?

I need to write a command like hastat or something which does this.  I need
it for my own purposes (writing test scripts), and it would be handy for
shell script programmers.

	-- Alan Robertson
	   alanr@suse.com