42 out->
err(out,
"Could not connect to the CIB: %s",
47 rc = cib->
cmds->
query(cib, NULL, current_cib,
102 uint32_t show, uint32_t show_opts,
103 const char *only_node,
const char *only_rsc,
104 const char *neg_location_prefix,
bool simple_output)
106 xmlNode *cib_copy =
copy_xml(current_cib);
110 GList *unames = NULL;
111 GList *resources = NULL;
156 stonith_history, fence_history, show, show_opts,
157 neg_location_prefix, unames, resources);
160 g_list_free_full(unames, free);
161 g_list_free_full(resources, free);
164 stonith_history = NULL;
195 show_opts, NULL, NULL, NULL,
false, 0);
240 uint32_t show_opts,
const char *only_node,
const char *only_rsc,
241 const char *neg_location_prefix,
bool simple_output,
244 xmlNode *current_cib = NULL;
281 stonith = fencing_connect();
284 rc = cib_connect(out, cib, ¤t_cib);
290 fence_history, show, show_opts, only_node,
291 only_rsc, neg_location_prefix,
294 out->
err(out,
"Error outputting status info from the fencer or CIB");
298 if (stonith != NULL) {
307 if (current_cib != NULL) {
320 int nodes_online = 0;
321 int nodes_standby = 0;
322 int nodes_maintenance = 0;
323 GString *offline_nodes = NULL;
325 bool offline =
false;
326 bool has_warnings =
false;
333 for (GList *iter =
data_set->
nodes; iter != NULL; iter = iter->next) {
343 pcmk__add_word(&offline_nodes, 1024,
"offline node:");
344 pcmk__add_word(&offline_nodes, 0, pe__node_name(node));
351 out->
info(out,
"CLUSTER WARN: %s%s%s",
352 no_dc ?
"No DC" :
"",
353 no_dc && offline ?
", " :
"",
354 (offline? (
const char *) offline_nodes->str :
""));
356 if (offline_nodes != NULL) {
357 g_string_free(offline_nodes, TRUE);
361 char *nodes_standby_s = NULL;
362 char *nodes_maint_s = NULL;
364 if (nodes_standby > 0) {
369 if (nodes_maintenance > 0) {
375 out->
info(out,
"CLUSTER OK: %d node%s online%s%s, " 376 "%d resource instance%s configured",
378 nodes_standby_s != NULL ? nodes_standby_s :
"",
379 nodes_maint_s != NULL ? nodes_maint_s :
"",
382 free(nodes_standby_s);
#define CRM_CHECK(expr, failure_action)
int pcmk__pacemakerd_status(pcmk__output_t *out, const char *ipc_name, guint message_timeout_ms, enum pcmk_pacemakerd_state *state)
Control output from tools.
void stonith__register_messages(pcmk__output_t *out)
int(* message)(pcmk__output_t *out, const char *message_id,...)
GList * pe__build_rsc_list(pe_working_set_t *data_set, const char *s)
pcmk__fence_history
Control how much of the fencing history is output.
void pe_free_working_set(pe_working_set_t *data_set)
Free a working set.
pe_working_set_t * pe_new_working_set(void)
Create a new working set.
#define pe_flag_no_compat
crm_exit_t pcmk_rc2exitc(int rc)
Map a function return code to the most similar exit code.
int(* info)(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
const char * pcmk_rc_str(int rc)
Get a user-friendly description of a return code.
void cib_delete(cib_t *cib)
Free all memory used by CIB connection.
stonith_t * stonith_api_new(void)
int pcmk__output_cluster_status(pcmk__output_t *out, stonith_t *stonith, cib_t *cib, xmlNode *current_cib, enum pcmk__fence_history fence_history, uint32_t show, uint32_t show_opts, const char *only_node, const char *only_rsc, const char *neg_location_prefix, bool simple_output)
xmlNode * copy_xml(xmlNode *src_node)
cib_api_operations_t * cmds
int(* signon)(cib_t *cib, const char *name, enum cib_conn_type type)
int pcmk__xml_output_new(pcmk__output_t **out, xmlNodePtr *xml)
#define crm_trace(fmt, args...)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
struct pe_node_shared_s * details
int(*) void(* err)(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
void pcmk__register_lib_messages(pcmk__output_t *out)
pe_working_set_t * data_set
void pcmk__unpack_constraints(pe_working_set_t *data_set)
int(* query)(cib_t *cib, const char *section, xmlNode **output_data, int call_options)
int(* disconnect)(stonith_t *st)
Disconnect from the local stonith daemon.
int pcmk__output_simple_status(pcmk__output_t *out, pe_working_set_t *data_set)
int pcmk_legacy2rc(int legacy_rc)
void pe__register_messages(pcmk__output_t *out)
void free_xml(xmlNode *child)
int(* connect)(stonith_t *st, const char *name, int *stonith_fd)
Connect to the local fencer.
int cib__clean_up_connection(cib_t **cib)
Function and executable result codes.
GList * pe__build_node_name_list(pe_working_set_t *data_set, const char *s)
int pcmk__status(pcmk__output_t *out, cib_t *cib, enum pcmk__fence_history fence_history, uint32_t show, uint32_t show_opts, const char *only_node, const char *only_rsc, const char *neg_location_prefix, bool simple_output, guint timeout_ms)
void stonith_api_delete(stonith_t *st)
stonith_api_operations_t * cmds
gboolean cluster_status(pe_working_set_t *data_set)
void stonith_history_free(stonith_history_t *history)
This structure contains everything that makes up a single output formatter.
int pcmk__get_fencing_history(stonith_t *st, stonith_history_t **stonith_history, enum pcmk__fence_history fence_history)
Fetch STONITH history, optionally reducing it.
#define pe__set_working_set_flags(working_set, flags_to_set)
#define pcmk__plural_s(i)
void pcmk__xml_output_finish(pcmk__output_t *out, xmlNodePtr *xml)
int pcmk_status(xmlNodePtr *xml)
Output the current status of the cluster, formatted in the same way that crm_mon --output-as=xml woul...
int(* remove_notification)(stonith_t *stonith, const char *event)
Unregister callbacks for fence notifications.
gboolean cli_config_update(xmlNode **xml, int *best_version, gboolean to_logs)