Feature #3456
closed
make exit code of ceph status commands status dependent
Added by Corin Langosch over 11 years ago.
Updated over 11 years ago.
Description
When running for example "ceph health" it always returns an exit code of 0, no matter if the cluster is healthy or not. I'd be helpful for some scripts and tools (like cron) to return only 0 when the cluster is healthy, 1 otherwise.
This is intentional: we want to return success in that we are able to successfully report the health (vs not being able to do so, e.g., if the monitors are unreachable.. in which case the health is unknown). To determine what the health is, the HEALTH_OK, _WARNING, _ERROR prefix is there for easy parsing.
Ah ok, I see. I don't know if it would be a good idea to have different exit codes for different failures/ status. I'm currently doing it as you explained, parsing the text with grep which is also working fine. Please feel free to just close it if you think it should stay as it is. :)
- Status changed from New to Closed
Also available in: Atom
PDF