Skip to content

Commit 8472aeb

Browse files
Merge pull request #85 from NETWAYS/fix/perfdata
Remove status perfdata for health check
2 parents 6f6db99 + e13ff93 commit 8472aeb

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Usage:
4141
Examples:
4242
4343
$ check_logstash health --hostname 'localhost' --port 8888 --insecure
44-
[OK] - Logstash is healthy | status=green process.cpu.percent=0;0.5;3;0;100
44+
[OK] - Logstash is healthy | process.cpu.percent=0;0.5;3;0;100
4545
\_[OK] Heap usage at 12.00%
4646
\_[OK] Open file descriptors at 12.00%
4747
\_[OK] CPU usage at 5.00%

cmd/health.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ func generatePerfdata(stat logstash.Stat, thres HealthThreshold) perfdata.Perfda
9191
// Generates the Perfdata from the results and thresholds
9292
var l perfdata.PerfdataList
9393

94-
l.Add(&perfdata.Perfdata{
95-
Label: "status",
96-
Value: stat.Status})
9794
l.Add(&perfdata.Perfdata{
9895
Label: "process.cpu.percent",
9996
Value: stat.Process.CPU.Percent,

cmd/health_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func TestHealthCmd_Logstash7(t *testing.T) {
129129
w.Write([]byte(`{"host":"test","version":"7.17.8","status":"green","jvm":{"threads":{"count":50,"peak_count":51},"mem":{"heap_used_percent":20}},"process":{"open_file_descriptors": 120,"peak_open_file_descriptors": 120,"max_file_descriptors":16384,"cpu":{"percent": 1}}}`))
130130
})),
131131
args: []string{"run", "../main.go", "health"},
132-
expected: "| status=green process.cpu.percent=1%;100;100;0;100 jvm.mem.heap_used_percent=20%;70;80;0;100 jvm.threads.count=50;;;;0 process.open_file_descriptors=120;100;100;0;16384",
132+
expected: "| process.cpu.percent=1%;100;100;0;100 jvm.mem.heap_used_percent=20%;70;80;0;100 jvm.threads.count=50;;;;0 process.open_file_descriptors=120;100;100;0;16384",
133133
},
134134
{
135135
name: "health-red",
@@ -269,7 +269,7 @@ func TestHealthCmd_Logstash8(t *testing.T) {
269269
w.Write([]byte(`{"host":"test","version":"8.6","status":"green","jvm":{"threads":{"count":50,"peak_count":51},"mem":{"heap_used_percent":20}},"process":{"open_file_descriptors": 120,"peak_open_file_descriptors": 120,"max_file_descriptors":16384,"cpu":{"percent": 1}}}`))
270270
})),
271271
args: []string{"run", "../main.go", "health"},
272-
expected: "| status=green process.cpu.percent=1%;100;100;0;100 jvm.mem.heap_used_percent=20%;70;80;0;100 jvm.threads.count=50;;;;0 process.open_file_descriptors=120;100;100;0;16384",
272+
expected: "| process.cpu.percent=1%;100;100;0;100 jvm.mem.heap_used_percent=20%;70;80;0;100 jvm.threads.count=50;;;;0 process.open_file_descriptors=120;100;100;0;16384",
273273
},
274274
{
275275
name: "health-cpu-heap-worst-state",

0 commit comments

Comments
 (0)