[sheepdog] Exit status of node recovery
Liu Yuan
namei.unix at gmail.com
Mon Aug 26 07:24:08 CEST 2013
On Fri, Aug 23, 2013 at 05:53:02PM +0200, Valerio Pachera wrote:
> Hi, I'm wondering if it could be good to have an exit status different
> from 0 when there's a recovery running.
>
> I wish to monitor if cluster is doing a recovery in nagios/icinga or
> another application.
>
> To get this info I have to "parse" the output of 'node recovery'
> instead of the exit status.
>
> lines=$(dog vdi recovery | wc -l)
> if [ lines -ne 2 ]; then
> echo "recovery is running"
> fi
>
> Instead of
>
> dog vdi recovery > /dev/null
> if [ $? -eq 1 ]; then
> echo "recovery is running"
> fi
>
> What do you think?
I don't think first form is better than the second form. We use non-zero status
code to indicate error of executing request as a general rule.
Thanks
Yuan
More information about the sheepdog
mailing list