forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add '_monitoring' suffix to monitoring process names (elastic#27852)
* Add '_monitoring' suffix to monitoring process names Add '_monitoring' suffix to monitoring process names so that they can be distinguished from other processes. This is relevant for the status command where the beat instances appear the same in output. Changed the output format of the human readable option to better align text with the longer names.
- Loading branch information
1 parent
c685141
commit 610cff2
Showing
4 changed files
with
136 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
// or more contributor license agreements. Licensed under the Elastic License; | ||
// you may not use this file except in compliance with the Elastic License. | ||
|
||
package cmd | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/control/client" | ||
) | ||
|
||
var testStatus = &client.AgentStatus{ | ||
Status: client.Healthy, | ||
Message: "", | ||
Applications: []*client.ApplicationStatus{{ | ||
ID: "id_1", | ||
Name: "filebeat", | ||
Status: client.Healthy, | ||
Message: "Running", | ||
Payload: nil, | ||
}, { | ||
ID: "id_2", | ||
Name: "metricbeat", | ||
Status: client.Healthy, | ||
Message: "Running", | ||
Payload: nil, | ||
}, { | ||
ID: "id_3", | ||
Name: "filebeat_monitoring", | ||
Status: client.Healthy, | ||
Message: "Running", | ||
Payload: nil, | ||
}, { | ||
ID: "id_4", | ||
Name: "metricbeat_monitoring", | ||
Status: client.Healthy, | ||
Message: "Running", | ||
Payload: nil, | ||
}, | ||
}, | ||
} | ||
|
||
func ExamplehumanOutput() { | ||
humanOutput(os.Stdout, testStatus) | ||
// Output: | ||
// Status: HEALTHY | ||
// Message: (no message) | ||
// Applications: | ||
// * filebeat (HEALTHY) | ||
// Running | ||
// * metricbeat (HEALTHY) | ||
// Running | ||
// * filebeat_monitoring (HEALTHY) | ||
// Running | ||
// * metricbeat_monitoring (HEALTHY) | ||
// Running | ||
} | ||
|
||
func ExamplejsonOutput() { | ||
jsonOutput(os.Stdout, testStatus) | ||
// Output: | ||
// { | ||
// "Status": 2, | ||
// "Message": "", | ||
// "Applications": [ | ||
// { | ||
// "ID": "id_1", | ||
// "Name": "filebeat", | ||
// "Status": 2, | ||
// "Message": "Running", | ||
// "Payload": null | ||
// }, | ||
// { | ||
// "ID": "id_2", | ||
// "Name": "metricbeat", | ||
// "Status": 2, | ||
// "Message": "Running", | ||
// "Payload": null | ||
// }, | ||
// { | ||
// "ID": "id_3", | ||
// "Name": "filebeat_monitoring", | ||
// "Status": 2, | ||
// "Message": "Running", | ||
// "Payload": null | ||
// }, | ||
// { | ||
// "ID": "id_4", | ||
// "Name": "metricbeat_monitoring", | ||
// "Status": 2, | ||
// "Message": "Running", | ||
// "Payload": null | ||
// } | ||
// ] | ||
// } | ||
} | ||
|
||
func ExampleyamlOutput() { | ||
yamlOutput(os.Stdout, testStatus) | ||
// Output: | ||
// status: 2 | ||
// message: "" | ||
// applications: | ||
// - id: id_1 | ||
// name: filebeat | ||
// status: 2 | ||
// message: Running | ||
// payload: {} | ||
// - id: id_2 | ||
// name: metricbeat | ||
// status: 2 | ||
// message: Running | ||
// payload: {} | ||
// - id: id_3 | ||
// name: filebeat_monitoring | ||
// status: 2 | ||
// message: Running | ||
// payload: {} | ||
// - id: id_4 | ||
// name: metricbeat_monitoring | ||
// status: 2 | ||
// message: Running | ||
// payload: {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters