-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
collector.tmpl
126 lines (117 loc) · 3.71 KB
/
collector.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{{/*
NOTE: Changes made to this template should be reflected on the following templates, if applicable:
* cmd/agent/gui/views/templates/collectorStatus.tmpl
* cmd/agent/gui/views/templates/singleCheck.tmpl
*/}}=========
Collector
=========
{{- with .pythonInit -}}
{{- if .Errors }}
Error initializing Python
=========================
{{ range $err := .Errors -}}
- {{ $err }}
{{ end }}
{{- end -}}
{{- end }}
Running Checks
==============
{{- with .runnerStats }}
{{- if and (not .Runs) (not .Checks)}}
No checks have run yet
{{end -}}
{{- range $CheckName, $CheckInstances := .Checks}}
{{ $version := version $CheckInstances }}
{{$CheckName}}{{ if $version }} ({{$version}}){{ end }}
{{printDashes $CheckName "-"}}{{- if $version }}{{printDashes $version "-"}}---{{ end }}
{{- range $instance := $CheckInstances }}
Instance ID: {{.CheckID}} {{status .}}
Configuration Source: {{.CheckConfigSource}}
Total Runs: {{humanize .TotalRuns}}
Metric Samples: Last Run: {{humanize .MetricSamples}}, Total: {{humanize .TotalMetricSamples}}
Events: Last Run: {{humanize .Events}}, Total: {{humanize .TotalEvents}}
{{- range $k, $v := .TotalEventPlatformEvents }}
{{ $k }}: Last Run: {{humanize (index $instance.EventPlatformEvents $k) }}, Total: {{humanize $v}}
{{- end }}
Service Checks: Last Run: {{humanize .ServiceChecks}}, Total: {{humanize .TotalServiceChecks}}
{{- if .TotalHistogramBuckets}}
Histogram Buckets: Last Run: {{humanize .HistogramBuckets}}, Total: {{humanize .TotalHistogramBuckets}}
{{- end }}
Average Execution Time : {{humanizeDuration .AverageExecutionTime "ms"}}
Last Execution Date : {{formatUnixTime .UpdateTimestamp}}
Last Successful Execution Date : {{ if .LastSuccessDate }}{{formatUnixTime .LastSuccessDate}}{{ else }}Never{{ end }}
{{- if $.inventories }}
{{- if index $.inventories .CheckID }}
metadata:
{{- range $k, $v := index $.inventories .CheckID }}
{{ $k }}: {{ $v }}
{{- end }}
{{- end }}
{{- end }}
{{if .LastError -}}
Error: {{lastErrorMessage .LastError}}
{{lastErrorTraceback .LastError -}}
{{- end }}
{{- if .LastWarnings -}}
{{- range .LastWarnings }}
Warning: {{.}}
{{ end -}}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- with .pyLoaderStats }}
{{- if .Py3Warnings }}
Python 3 Linter Warnings
=======================
{{- range $CheckName, $warnings := .Py3Warnings }}
{{ $CheckName }}
{{printDashes $CheckName "-"}}
{{- range $idx, $warning := $warnings}}
{{$warning}}
{{- end }}
{{end}}
{{- end }}
{{- if .ConfigureErrors }}
Check Initialization Errors
===========================
{{ range $CheckName, $errors := .ConfigureErrors }}
{{ $CheckName }}
{{printDashes $CheckName "-"}}
{{- range $idx, $err := $errors}}
instance {{$idx}}:
{{$err}}
{{- end }}
{{- end}}
{{- end }}
{{- end }}
{{- with .autoConfigStats }}
{{- if .ConfigErrors}}
Config Errors
==============
{{- range $checkname, $error := .ConfigErrors }}
{{$checkname}}
{{printDashes $checkname "-"}}
{{$error}}
{{- end }}
{{- end}}
{{- end }}
{{- with .checkSchedulerStats }}
{{- if .LoaderErrors}}
Loading Errors
==============
{{- range $checkname, $errors := .LoaderErrors }}
{{$checkname}}
{{printDashes $checkname "-"}}
{{- range $kind, $err := $errors -}}
{{- if eq $kind "Python Check Loader" }}
{{$kind}}:
{{$err}}
{{ else }}
{{$kind}}:
{{$err}}
{{ end }}
{{- end }}
{{- end }}
{{- end}}
{{- end }}