This has a limitation which is important to note: it runs the command substitution one time at the beginning when PS1 is set. This is undesirable, as the cluster status in the prompt stays the same even if you fail over. To confirm this, run 'echo "$PS1"'. It will show the cluster status in the prompt rather than the command. I posted a set of prompt improvements over on CPUG:
https://www.cpug.org/forums/showthread.php/22738-Command-prompt-improvements
In short, you need to escape the dollar sign to cause the shell not to evaluate it when setting PS1, but to store it to PS1 as a dollar sign instead. Each time the prompt is printed, PS1 is evaluated. Since it contains the $(...) construct, the command substitution is run and the current cluster state at the time of prompt printing is printed.
I also prefer to index from the end, like so:
awk '{print \$NF}'
$NF is set to the number of fields awk detected.