mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
node check: fix --downstream --nagios output
Ensure the performance data output (the bit after the pipe) contains information in a pareseable format. GitHub #749.
This commit is contained in:
@@ -1395,49 +1395,32 @@ do_node_check_downstream(PGconn *conn, OutputMode mode, t_node_info *node_info,
|
|||||||
{
|
{
|
||||||
case OM_NAGIOS:
|
case OM_NAGIOS:
|
||||||
{
|
{
|
||||||
printf("REPMGR_DOWNSTREAM_SERVERS %s: %s | ",
|
|
||||||
output_check_status(status),
|
|
||||||
details.data);
|
|
||||||
|
|
||||||
if (missing_nodes_count)
|
if (missing_nodes_count)
|
||||||
{
|
{
|
||||||
ItemListCell *missing_cell = NULL;
|
ItemListCell *missing_cell = NULL;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
|
|
||||||
printf("missing: ");
|
appendPQExpBufferStr(&details, " (missing: ");
|
||||||
|
|
||||||
for (missing_cell = missing_nodes.head; missing_cell; missing_cell = missing_cell->next)
|
for (missing_cell = missing_nodes.head; missing_cell; missing_cell = missing_cell->next)
|
||||||
{
|
{
|
||||||
if (first == false)
|
if (first == false)
|
||||||
printf(", ");
|
appendPQExpBufferStr(&details, ", ");
|
||||||
else
|
else
|
||||||
first = false;
|
first = false;
|
||||||
|
|
||||||
if (first == false)
|
if (first == false)
|
||||||
printf("%s", missing_cell->string);
|
appendPQExpBufferStr(&details, missing_cell->string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
appendPQExpBufferChar(&details, ')');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expected_nodes_count - missing_nodes_count)
|
printf("REPMGR_DOWNSTREAM_SERVERS %s: %s | attached=%i, missing=%i\n",
|
||||||
{
|
output_check_status(status),
|
||||||
ItemListCell *attached_cell = NULL;
|
details.data,
|
||||||
bool first = true;
|
expected_nodes_count - missing_nodes_count,
|
||||||
|
missing_nodes_count);
|
||||||
if (missing_nodes_count)
|
|
||||||
printf("; ");
|
|
||||||
printf("attached: ");
|
|
||||||
for (attached_cell = attached_nodes.head; attached_cell; attached_cell = attached_cell->next)
|
|
||||||
{
|
|
||||||
if (first == false)
|
|
||||||
printf(", ");
|
|
||||||
else
|
|
||||||
first = false;
|
|
||||||
|
|
||||||
if (first == false)
|
|
||||||
printf("%s", attached_cell->string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
printf("\n");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OM_CSV:
|
case OM_CSV:
|
||||||
|
|||||||
Reference in New Issue
Block a user