Feature #3456
closedmake exit code of ceph status commands status dependent
0%
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.
Updated by Sage Weil over 11 years ago
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.
Updated by Corin Langosch over 11 years ago
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. :)