Project

General

Profile

Actions

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.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

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.

Actions #1

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.

Actions #2

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. :)

Actions #3

Updated by Josh Durgin over 11 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF