From a7f31e4f70d01558f8977e66034ee1b6f412894c Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 3 Mar 2022 13:43:51 -0900 Subject: [PATCH 01/35] start of metrics output implementation --- go.mod | 2 + go.sum | 3 ++ main.go | 149 +++++++++++++++++++++++++++++++++++++++++++++----------- 3 files changed, 126 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index 44eaacc..0c4cc3d 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,8 @@ require ( github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect github.com/go-ole/go-ole v1.2.4 // indirect github.com/pelletier/go-toml v1.6.0 // indirect + github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 + github.com/prometheus/common v0.4.0 github.com/sensu-community/sensu-plugin-sdk v0.11.0 github.com/sensu/sensu-go/api/core/v2 v2.3.0 github.com/shirou/gopsutil v3.20.10+incompatible diff --git a/go.sum b/go.sum index f1cdf03..c04e905 100644 --- a/go.sum +++ b/go.sum @@ -146,6 +146,7 @@ github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzR github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -177,8 +178,10 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0 h1:7etb9YClo3a6HjLzfl6rIQaU+FDfi0VSX39io3aQ+DM= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= diff --git a/main.go b/main.go index ca7830e..669e2c1 100644 --- a/main.go +++ b/main.go @@ -1,12 +1,17 @@ package main import ( + "bytes" "encoding/json" "fmt" "os" + "sort" "strings" + "time" "github.com/Knetic/govaluate" + dto "github.com/prometheus/client_model/go" + "github.com/prometheus/common/expfmt" "github.com/sensu-community/sensu-plugin-sdk/sensu" corev2 "github.com/sensu/sensu-go/api/core/v2" "github.com/shirou/gopsutil/process" @@ -26,6 +31,7 @@ type Config struct { sensu.PluginConfig Search string SuppressOKOutput bool + SumoLogicCompat bool } var ( @@ -49,13 +55,22 @@ var ( }, { Path: "suppress-ok-output", - Env: "", + Env: "PROCESSES_CHECK_SUPPRESS_OK_OUTPUT", Argument: "suppress-ok-output", Shorthand: "S", Default: false, Usage: "Aside from overal status, only output failures", Value: &plugin.SuppressOKOutput, }, + { + Path: "sumologic-compat", + Env: "PROCESSES_CHECK_SUMOLOGIC_COMPAT", + Argument: "sumologic-compat", + Shorthand: "", + Default: false, + Usage: "Add Sumo Logic compatible \"procstat\" metrics family", + Value: &plugin.SumoLogicCompat, + }, } ) @@ -65,45 +80,55 @@ func main() { } func checkArgs(event *corev2.Event) (int, error) { - if len(plugin.Search) == 0 { - return sensu.CheckStateUnknown, fmt.Errorf("--search is required") - } + //if len(plugin.Search) == 0 { + // return sensu.CheckStateUnknown, fmt.Errorf("--search is required") + //} return sensu.CheckStateOK, nil } func executeCheck(event *corev2.Event) (int, error) { - found := make(map[string]int) + found := make(map[string][]*process.Process) searches, err := parseSearches(plugin.Search) if err != nil { return sensu.CheckStateCritical, err } - myPid := os.Getpid() processes, _ := process.Processes() - for _, process := range processes { + for _, p := range processes { // Skip myself - if process.Pid == int32(myPid) { + if p.Pid == int32(myPid) { continue } - name, _ := process.Name() - cmdline, _ := process.Cmdline() - for _, search := range searches { - // skip empty search string, should this be tunable? - if len(search.SearchString) == 0 { - continue - } - if !search.FullCmdLine && name == search.SearchString { - found[search.SearchString]++ - break - } else if search.FullCmdLine { - if strings.Contains(cmdline, search.SearchString) { - found[search.SearchString]++ + name, _ := p.Name() + cmdline, _ := p.Cmdline() + if len(searches) == 0 { + found[""] = append(found[""], p) + // if not search configuration is provided, construct metrics for all processes + } else { + for _, search := range searches { + // skip duplicate search string to prevent duplicate counts + if len(found[search.SearchString]) > 0 { + continue + } + // skip empty search string, should this be tunable? + if len(search.SearchString) == 0 { + continue + } + if !search.FullCmdLine && name == search.SearchString { + found[search.SearchString] = append(found[search.SearchString], p) break + } else if search.FullCmdLine { + if strings.Contains(cmdline, search.SearchString) { + found[search.SearchString] = append(found[search.SearchString], p) + break + } } } } + } + // Construct alert severity overallSeverity := 0 for _, search := range searches { // skip empty search string, should this be tunable? @@ -111,7 +136,7 @@ func executeCheck(event *corev2.Event) (int, error) { continue } thisSeverity := 0 - strExpr := fmt.Sprintf("%d %s %d", found[search.SearchString], search.Comparison, search.Number) + strExpr := fmt.Sprintf("%d %s %d", len(found[search.SearchString]), search.Comparison, search.Number) expression, err := govaluate.NewEvaluableExpression(strExpr) if err != nil { return sensu.CheckStateCritical, fmt.Errorf("Unable to create expression %s: %v", strExpr, err) @@ -129,22 +154,90 @@ func executeCheck(event *corev2.Event) (int, error) { } if (!plugin.SuppressOKOutput && thisSeverity == 0) || thisSeverity > 0 { - fmt.Printf("%-8s | %d %s %d (found %s required) evaluated %v for %q\n", mapSeverity(thisSeverity), found[search.SearchString], search.Comparison, search.Number, search.Comparison, result.(bool), search.SearchString) + fmt.Printf("# %-8s | %d %s %d (found %s required) evaluated %v for %q\n", mapSeverity(thisSeverity), len(found[search.SearchString]), search.Comparison, search.Number, search.Comparison, result.(bool), search.SearchString) + } + + } + fmt.Printf("# Status - %s\n", mapSeverity(overallSeverity)) + + // Construct metrics + nowMS := time.Now().UnixMilli() + families := make([]*dto.MetricFamily, 0) + //var processesFamily *dto.MetricFamily + //processesFamily = newMetricFamily("processes", "SumoLogic Compatibility", dto.MetricType_GAUGE) + //families = append(families, processesFamily) + var procstatFamily *dto.MetricFamily + procstatFamily = newMetricFamily("procstat", "SumoLogic Compatibility", dto.MetricType_GAUGE) + families = append(families, procstatFamily) + for searchStr, processes := range found { + //var totalMetrics []string + //totalTags := make(map[string][]*process.Process) + for _, p := range processes { + name, _ := p.Name() + labels := make([]*dto.LabelPair, 0) + procstatTags := make(map[string]string) + //Set the labels for the metric + procstatTags["field"] = "none" + procstatTags["search_string"] = searchStr + procstatTags["process.executable.name"] = name + + //CPU usage metric + procstatTags["field"] = "cpu_usage" + value, _ := p.CPUPercent() + keys := make([]string, 0, len(procstatTags)) + for k := range procstatTags { + keys = append(keys, k) + } + sort.Strings(keys) + for _, key := range keys { + name := fmt.Sprintf("%v", key) + val := fmt.Sprintf("%v", procstatTags[key]) + labels = append(labels, &dto.LabelPair{Name: &name, Value: &val}) + } + gauge := &dto.Metric{ + Label: labels, + Gauge: &dto.Gauge{ + Value: &value, + }, + TimestampMs: &nowMS, + } + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + + } + } + + var buf bytes.Buffer + for _, family := range families { + buf.Reset() + encoder := expfmt.NewEncoder(&buf, expfmt.FmtText) + err = encoder.Encode(family) + if err != nil { + return sensu.CheckStateCritical, err } + fmt.Print(buf.String()) } - fmt.Printf("Status - %s\n", mapSeverity(overallSeverity)) return overallSeverity, nil } +func newMetricFamily(name, help string, metricType dto.MetricType) *dto.MetricFamily { + return &dto.MetricFamily{ + Name: &name, + Help: &help, + Type: &metricType, + Metric: []*dto.Metric{}, + } +} + func parseSearches(searchJSON string) ([]Search, error) { searches := []Search{} - err := json.Unmarshal([]byte(searchJSON), &searches) - if err != nil { - return []Search{}, err + if len(searchJSON) > 0 { + err := json.Unmarshal([]byte(searchJSON), &searches) + if err != nil { + return []Search{}, err + } } - return searches, nil } From f9670e49203767e4e748dc4b68e740666f8eb170 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 3 Mar 2022 13:44:52 -0900 Subject: [PATCH 02/35] update test to allow for no search --- main_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main_test.go b/main_test.go index c42164b..d0a69df 100644 --- a/main_test.go +++ b/main_test.go @@ -22,7 +22,7 @@ func TestCheckArgs(t *testing.T) { assert := assert.New(t) event := corev2.FixtureEvent("entity1", "check1") _, err := checkArgs(event) - assert.Error(err) + assert.NoError(err) plugin.Search = `[{"full_cmdline": true, "number": 1, "severity": 1, "search_string": "eventmonitor"}, {"number": 1, "severity": 2, "search_string": "ssh-agent"}, {"number": 2, "severity": 1, "search_string": "non-existent"}]` _, err = checkArgs(event) From 34527dd889a1a3c27a2a51bf25a76a3b78d19fc9 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 3 Mar 2022 14:14:59 -0900 Subject: [PATCH 03/35] add memory_usage --- main.go | 51 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/main.go b/main.go index 669e2c1..4c55374 100644 --- a/main.go +++ b/main.go @@ -174,33 +174,22 @@ func executeCheck(event *corev2.Event) (int, error) { //totalTags := make(map[string][]*process.Process) for _, p := range processes { name, _ := p.Name() - labels := make([]*dto.LabelPair, 0) procstatTags := make(map[string]string) //Set the labels for the metric procstatTags["field"] = "none" + procstatTags["host.name"], _ = os.Hostname() procstatTags["search_string"] = searchStr procstatTags["process.executable.name"] = name - //CPU usage metric + //cpu_usage metric procstatTags["field"] = "cpu_usage" - value, _ := p.CPUPercent() - keys := make([]string, 0, len(procstatTags)) - for k := range procstatTags { - keys = append(keys, k) - } - sort.Strings(keys) - for _, key := range keys { - name := fmt.Sprintf("%v", key) - val := fmt.Sprintf("%v", procstatTags[key]) - labels = append(labels, &dto.LabelPair{Name: &name, Value: &val}) - } - gauge := &dto.Metric{ - Label: labels, - Gauge: &dto.Gauge{ - Value: &value, - }, - TimestampMs: &nowMS, - } + val64, _ := p.CPUPercent() + gauge := newGaugeMetric(procstatTags, float64(val64), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + //memory_usage metric + procstatTags["field"] = "memory_usage" + val32, _ := p.MemoryPercent() + gauge = newGaugeMetric(procstatTags, float64(val32), nowMS) procstatFamily.Metric = append(procstatFamily.Metric, gauge) } @@ -220,7 +209,27 @@ func executeCheck(event *corev2.Event) (int, error) { return overallSeverity, nil } - +func newGaugeMetric(tags map[string]string, value float64, timestampMS int64) *dto.Metric { + labels := make([]*dto.LabelPair, 0) + keys := make([]string, 0, len(tags)) + for k := range tags { + keys = append(keys, k) + } + sort.Strings(keys) + for _, key := range keys { + name := fmt.Sprintf("%v", key) + val := fmt.Sprintf("%v", tags[key]) + labels = append(labels, &dto.LabelPair{Name: &name, Value: &val}) + } + gauge := &dto.Metric{ + Label: labels, + Gauge: &dto.Gauge{ + Value: &value, + }, + TimestampMs: ×tampMS, + } + return gauge +} func newMetricFamily(name, help string, metricType dto.MetricType) *dto.MetricFamily { return &dto.MetricFamily{ Name: &name, From 19b190641edbf33f17bef9088fc713f59a9ab67f Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 3 Mar 2022 14:32:01 -0900 Subject: [PATCH 04/35] add created_at metric --- main.go | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 4c55374..f59285e 100644 --- a/main.go +++ b/main.go @@ -173,6 +173,11 @@ func executeCheck(event *corev2.Event) (int, error) { //var totalMetrics []string //totalTags := make(map[string][]*process.Process) for _, p := range processes { + var fval32 float32 + var fval64 float64 + //var ival32 int32 + var ival64 int64 + name, _ := p.Name() procstatTags := make(map[string]string) //Set the labels for the metric @@ -183,13 +188,21 @@ func executeCheck(event *corev2.Event) (int, error) { //cpu_usage metric procstatTags["field"] = "cpu_usage" - val64, _ := p.CPUPercent() - gauge := newGaugeMetric(procstatTags, float64(val64), nowMS) + procstatTags["units"] = "percent" + fval64, _ = p.CPUPercent() + gauge := newGaugeMetric(procstatTags, float64(fval64), nowMS) procstatFamily.Metric = append(procstatFamily.Metric, gauge) //memory_usage metric procstatTags["field"] = "memory_usage" - val32, _ := p.MemoryPercent() - gauge = newGaugeMetric(procstatTags, float64(val32), nowMS) + procstatTags["units"] = "percent" + fval32, _ = p.MemoryPercent() + gauge = newGaugeMetric(procstatTags, float64(fval32), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + //created_at metric + procstatTags["field"] = "created_at" + procstatTags["units"] = "nanoseconds" + ival64, _ = p.CreateTime() + gauge = newGaugeMetric(procstatTags, float64(ival64)*1e6, nowMS) procstatFamily.Metric = append(procstatFamily.Metric, gauge) } @@ -230,6 +243,27 @@ func newGaugeMetric(tags map[string]string, value float64, timestampMS int64) *d } return gauge } +func newCounterMetric(tags map[string]string, value float64, timestampMS int64) *dto.Metric { + labels := make([]*dto.LabelPair, 0) + keys := make([]string, 0, len(tags)) + for k := range tags { + keys = append(keys, k) + } + sort.Strings(keys) + for _, key := range keys { + name := fmt.Sprintf("%v", key) + val := fmt.Sprintf("%v", tags[key]) + labels = append(labels, &dto.LabelPair{Name: &name, Value: &val}) + } + counter := &dto.Metric{ + Label: labels, + Counter: &dto.Counter{ + Value: &value, + }, + TimestampMs: ×tampMS, + } + return counter +} func newMetricFamily(name, help string, metricType dto.MetricType) *dto.MetricFamily { return &dto.MetricFamily{ Name: &name, From 3a0bec97b2a6f5e78092e71a2dbad10f8adac2a1 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 3 Mar 2022 14:33:55 -0900 Subject: [PATCH 05/35] add num_fds metric --- main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index f59285e..a38853a 100644 --- a/main.go +++ b/main.go @@ -175,7 +175,7 @@ func executeCheck(event *corev2.Event) (int, error) { for _, p := range processes { var fval32 float32 var fval64 float64 - //var ival32 int32 + var ival32 int32 var ival64 int64 name, _ := p.Name() @@ -204,6 +204,12 @@ func executeCheck(event *corev2.Event) (int, error) { ival64, _ = p.CreateTime() gauge = newGaugeMetric(procstatTags, float64(ival64)*1e6, nowMS) procstatFamily.Metric = append(procstatFamily.Metric, gauge) + //num_fds metric + procstatTags["field"] = "num_fds" + procstatTags["units"] = "count" + ival32, _ = p.NumFDs() + gauge = newGaugeMetric(procstatTags, float64(ival32)*1e6, nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) } } From dc874476eb2aae553c92e65c8bfb6cb647e74787 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 3 Mar 2022 14:46:05 -0900 Subject: [PATCH 06/35] add io counter metrics read/write_count/bytes --- main.go | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index a38853a..3ab9f5f 100644 --- a/main.go +++ b/main.go @@ -178,11 +178,17 @@ func executeCheck(event *corev2.Event) (int, error) { var ival32 int32 var ival64 int64 - name, _ := p.Name() + name, err := p.Name() + if err != nil { + continue + } procstatTags := make(map[string]string) //Set the labels for the metric + hostname, err := os.Hostname() + if err == nil { + procstatTags["host.name"] = hostname + } procstatTags["field"] = "none" - procstatTags["host.name"], _ = os.Hostname() procstatTags["search_string"] = searchStr procstatTags["process.executable.name"] = name @@ -210,6 +216,29 @@ func executeCheck(event *corev2.Event) (int, error) { ival32, _ = p.NumFDs() gauge = newGaugeMetric(procstatTags, float64(ival32)*1e6, nowMS) procstatFamily.Metric = append(procstatFamily.Metric, gauge) + iostats, err := p.IOCounters() + if err == nil && iostats != nil { + //read_count metric + procstatTags["field"] = "read_count" + procstatTags["units"] = "count" + gauge = newGaugeMetric(procstatTags, float64(iostats.ReadCount), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + //read_bytes metric + procstatTags["field"] = "read_bytes" + procstatTags["units"] = "bytes" + gauge = newGaugeMetric(procstatTags, float64(iostats.ReadBytes), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + //write_count metric + procstatTags["field"] = "write_count" + procstatTags["units"] = "count" + gauge = newGaugeMetric(procstatTags, float64(iostats.WriteCount), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + //write_bytes metric + procstatTags["field"] = "write_bytes" + procstatTags["units"] = "bytes" + gauge = newGaugeMetric(procstatTags, float64(iostats.WriteBytes), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + } } } From 65cafeb9b2d3e0518006239ee6917812916ce353 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 3 Mar 2022 14:49:59 -0900 Subject: [PATCH 07/35] add page fault metrics --- main.go | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 3ab9f5f..bcdaaed 100644 --- a/main.go +++ b/main.go @@ -239,7 +239,29 @@ func executeCheck(event *corev2.Event) (int, error) { gauge = newGaugeMetric(procstatTags, float64(iostats.WriteBytes), nowMS) procstatFamily.Metric = append(procstatFamily.Metric, gauge) } - + faults, err := p.PageFaults() + if err == nil && faults != nil { + //major_fault metric + procstatTags["field"] = "major_faults" + procstatTags["units"] = "count" + gauge = newGaugeMetric(procstatTags, float64(faults.MajorFaults), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + //minor_fault metric + procstatTags["field"] = "minor_faults" + procstatTags["units"] = "count" + gauge = newGaugeMetric(procstatTags, float64(faults.MinorFaults), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + //child_major_fault metric + procstatTags["field"] = "child_major_faults" + procstatTags["units"] = "count" + gauge = newGaugeMetric(procstatTags, float64(faults.ChildMajorFaults), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + //child_minor_fault metric + procstatTags["field"] = "child_minor_faults" + procstatTags["units"] = "count" + gauge = newGaugeMetric(procstatTags, float64(faults.ChildMinorFaults), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + } } } From ad57abd72ea7c92edcd4dbc88a7d7f0c9c879ccb Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 3 Mar 2022 14:53:43 -0900 Subject: [PATCH 08/35] added context switching metrics --- main.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/main.go b/main.go index bcdaaed..b312585 100644 --- a/main.go +++ b/main.go @@ -262,6 +262,19 @@ func executeCheck(event *corev2.Event) (int, error) { gauge = newGaugeMetric(procstatTags, float64(faults.ChildMinorFaults), nowMS) procstatFamily.Metric = append(procstatFamily.Metric, gauge) } + switches, err := p.NumCtxSwitches() + if err == nil && switches != nil { + //involuntary_context_switches + procstatTags["field"] = "involuntary_context_switches" + procstatTags["units"] = "count" + gauge = newGaugeMetric(procstatTags, float64(switches.Involuntary), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + //voluntary_context_switches + procstatTags["field"] = "voluntary_context_switches" + procstatTags["units"] = "count" + gauge = newGaugeMetric(procstatTags, float64(switches.Voluntary), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + } } } From 25ea598142604b2cf91e8bc29e08eb22ed9df65f Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 3 Mar 2022 14:55:49 -0900 Subject: [PATCH 09/35] added num_threads metric --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.go b/main.go index b312585..b44802d 100644 --- a/main.go +++ b/main.go @@ -216,6 +216,12 @@ func executeCheck(event *corev2.Event) (int, error) { ival32, _ = p.NumFDs() gauge = newGaugeMetric(procstatTags, float64(ival32)*1e6, nowMS) procstatFamily.Metric = append(procstatFamily.Metric, gauge) + //num_threads metric + procstatTags["field"] = "num_threads" + procstatTags["units"] = "count" + ival32, _ = p.NumThreads() + gauge = newGaugeMetric(procstatTags, float64(ival32)*1e6, nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) iostats, err := p.IOCounters() if err == nil && iostats != nil { //read_count metric From 96e1f0dba94a300d3c17a8a12ce8902609956128 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 3 Mar 2022 15:08:10 -0900 Subject: [PATCH 10/35] added rlimit metrics --- main.go | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/main.go b/main.go index b44802d..09c04d8 100644 --- a/main.go +++ b/main.go @@ -281,6 +281,48 @@ func executeCheck(event *corev2.Event) (int, error) { gauge = newGaugeMetric(procstatTags, float64(switches.Voluntary), nowMS) procstatFamily.Metric = append(procstatFamily.Metric, gauge) } + rlims, err := p.RlimitUsage(true) + if err == nil { + procstatTags["units"] = "N/A" + for _, rlim := range rlims { + var name string + switch rlim.Resource { + case process.RLIMIT_CPU: + name = "cpu_time" + case process.RLIMIT_DATA: + name = "memory_data" + case process.RLIMIT_STACK: + name = "memory_stack" + case process.RLIMIT_RSS: + name = "memory_rss" + case process.RLIMIT_NOFILE: + name = "num_fds" + case process.RLIMIT_MEMLOCK: + name = "memory_locked" + case process.RLIMIT_AS: + name = "memory_vms" + case process.RLIMIT_LOCKS: + name = "file_locks" + case process.RLIMIT_SIGPENDING: + name = "signals_pending" + case process.RLIMIT_NICE: + name = "nice_priority" + case process.RLIMIT_RTPRIO: + name = "realtime_priority" + default: + continue + } + procstatTags["field"] = "rlimit_" + name + "_soft" + gauge = newGaugeMetric(procstatTags, float64(rlim.Soft), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + procstatTags["field"] = "rlimit_" + name + "_hard" + gauge = newGaugeMetric(procstatTags, float64(rlim.Hard), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + procstatTags["field"] = name + gauge = newGaugeMetric(procstatTags, float64(rlim.Used), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + } + } } } From f33054e1df17178e729e9d1b8a385642ef70a1d1 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 3 Mar 2022 15:21:19 -0900 Subject: [PATCH 11/35] add memory info stats --- main.go | 47 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 09c04d8..e291a24 100644 --- a/main.go +++ b/main.go @@ -204,6 +204,28 @@ func executeCheck(event *corev2.Event) (int, error) { fval32, _ = p.MemoryPercent() gauge = newGaugeMetric(procstatTags, float64(fval32), nowMS) procstatFamily.Metric = append(procstatFamily.Metric, gauge) + mem, err := p.MemoryInfo() + if err == nil { + procstatTags["units"] = "bytes" + procstatTags["field"] = "memory_rss" + gauge = newGaugeMetric(procstatTags, float64(mem.RSS), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + procstatTags["field"] = "memory_vms" + gauge = newGaugeMetric(procstatTags, float64(mem.VMS), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + procstatTags["field"] = "memory_swap" + gauge = newGaugeMetric(procstatTags, float64(mem.Swap), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + procstatTags["field"] = "memory_data" + gauge = newGaugeMetric(procstatTags, float64(mem.Data), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + procstatTags["field"] = "memory_stack" + gauge = newGaugeMetric(procstatTags, float64(mem.Stack), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + procstatTags["field"] = "memory_locked" + gauge = newGaugeMetric(procstatTags, float64(mem.Locked), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + } //created_at metric procstatTags["field"] = "created_at" procstatTags["units"] = "nanoseconds" @@ -283,28 +305,36 @@ func executeCheck(event *corev2.Event) (int, error) { } rlims, err := p.RlimitUsage(true) if err == nil { - procstatTags["units"] = "N/A" for _, rlim := range rlims { + procstatTags["units"] = "N/A" var name string switch rlim.Resource { case process.RLIMIT_CPU: name = "cpu_time" case process.RLIMIT_DATA: name = "memory_data" + procstatTags["units"] = "bytes" case process.RLIMIT_STACK: name = "memory_stack" + procstatTags["units"] = "bytes" case process.RLIMIT_RSS: name = "memory_rss" + procstatTags["units"] = "bytes" case process.RLIMIT_NOFILE: name = "num_fds" + procstatTags["units"] = "count" case process.RLIMIT_MEMLOCK: name = "memory_locked" + procstatTags["units"] = "bytes" case process.RLIMIT_AS: name = "memory_vms" + procstatTags["units"] = "bytes" case process.RLIMIT_LOCKS: name = "file_locks" + procstatTags["units"] = "count" case process.RLIMIT_SIGPENDING: name = "signals_pending" + procstatTags["units"] = "count" case process.RLIMIT_NICE: name = "nice_priority" case process.RLIMIT_RTPRIO: @@ -318,9 +348,18 @@ func executeCheck(event *corev2.Event) (int, error) { procstatTags["field"] = "rlimit_" + name + "_hard" gauge = newGaugeMetric(procstatTags, float64(rlim.Hard), nowMS) procstatFamily.Metric = append(procstatFamily.Metric, gauge) - procstatTags["field"] = name - gauge = newGaugeMetric(procstatTags, float64(rlim.Used), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) + + switch rlim.Resource { + case process.RLIMIT_CPU, + process.RLIMIT_LOCKS, + process.RLIMIT_SIGPENDING, + process.RLIMIT_NICE, + process.RLIMIT_RTPRIO: + procstatTags["field"] = name + gauge = newGaugeMetric(procstatTags, float64(rlim.Used), nowMS) + procstatFamily.Metric = append(procstatFamily.Metric, gauge) + } + } } } From dac0352a044cea6479c472cea4db08a22a3afaaf Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 3 Mar 2022 15:34:10 -0900 Subject: [PATCH 12/35] add total processes metric --- main.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index e291a24..a311ee7 100644 --- a/main.go +++ b/main.go @@ -163,13 +163,20 @@ func executeCheck(event *corev2.Event) (int, error) { // Construct metrics nowMS := time.Now().UnixMilli() families := make([]*dto.MetricFamily, 0) - //var processesFamily *dto.MetricFamily - //processesFamily = newMetricFamily("processes", "SumoLogic Compatibility", dto.MetricType_GAUGE) - //families = append(families, processesFamily) + var processesFamily *dto.MetricFamily + processesFamily = newMetricFamily("processes", "SumoLogic Compatibility", dto.MetricType_GAUGE) + families = append(families, processesFamily) var procstatFamily *dto.MetricFamily procstatFamily = newMetricFamily("procstat", "SumoLogic Compatibility", dto.MetricType_GAUGE) families = append(families, procstatFamily) + totalProcesses := int64(0) + totalTags := make(map[string]string) + hostname, err := os.Hostname() + if err == nil { + totalTags["host.name"] = hostname + } for searchStr, processes := range found { + totalProcesses += int64(len(processes)) //var totalMetrics []string //totalTags := make(map[string][]*process.Process) for _, p := range processes { @@ -364,6 +371,10 @@ func executeCheck(event *corev2.Event) (int, error) { } } } + totalTags["field"] = "total" + totalTags["units"] = "count" + gauge := newGaugeMetric(totalTags, float64(totalProcesses), nowMS) + processesFamily.Metric = append(processesFamily.Metric, gauge) var buf bytes.Buffer for _, family := range families { From a86b3ac278cc6dc4d5521bc7bfae0b97ff8b66d1 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 3 Mar 2022 15:55:10 -0900 Subject: [PATCH 13/35] add processes total state metrics --- main.go | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index a311ee7..5c5780b 100644 --- a/main.go +++ b/main.go @@ -170,6 +170,19 @@ func executeCheck(event *corev2.Event) (int, error) { procstatFamily = newMetricFamily("procstat", "SumoLogic Compatibility", dto.MetricType_GAUGE) families = append(families, procstatFamily) totalProcesses := int64(0) + totalThreads := int64(0) + totalStatusMap := map[string]int64{ + "wait": 0, + "blocked": 0, + "zombies": 0, + "dead": 0, + "stopped": 0, + "running": 0, + "sleeping": 0, + "idle": 0, + "unknown": 0, + "unexpected": 0, + } totalTags := make(map[string]string) hostname, err := os.Hostname() if err == nil { @@ -177,8 +190,6 @@ func executeCheck(event *corev2.Event) (int, error) { } for searchStr, processes := range found { totalProcesses += int64(len(processes)) - //var totalMetrics []string - //totalTags := make(map[string][]*process.Process) for _, p := range processes { var fval32 float32 var fval64 float64 @@ -189,6 +200,29 @@ func executeCheck(event *corev2.Event) (int, error) { if err != nil { continue } + status, err := p.Status() + switch status[0] { + case 'W': + totalStatusMap["wait"] += 1 + case 'U', 'D', 'L': + totalStatusMap["blocked"] += 1 + // Also known as uninterruptible sleep or disk sleep + case 'Z': + totalStatusMap["zombies"] += 1 + case 'X': + totalStatusMap["dead"] += 1 + case 'T': + totalStatusMap["stopped"] += 1 + case 'R': + case 'S': + totalStatusMap["sleeping"] += 1 + case 'I': + totalStatusMap["idle"] += 1 + case '?': + totalStatusMap["unknown"] += 1 + default: + totalStatusMap["unexpected"] += 1 + } procstatTags := make(map[string]string) //Set the labels for the metric hostname, err := os.Hostname() @@ -249,6 +283,7 @@ func executeCheck(event *corev2.Event) (int, error) { procstatTags["field"] = "num_threads" procstatTags["units"] = "count" ival32, _ = p.NumThreads() + totalThreads += int64(ival32) gauge = newGaugeMetric(procstatTags, float64(ival32)*1e6, nowMS) procstatFamily.Metric = append(procstatFamily.Metric, gauge) iostats, err := p.IOCounters() @@ -375,6 +410,16 @@ func executeCheck(event *corev2.Event) (int, error) { totalTags["units"] = "count" gauge := newGaugeMetric(totalTags, float64(totalProcesses), nowMS) processesFamily.Metric = append(processesFamily.Metric, gauge) + totalTags["field"] = "total_threads" + totalTags["units"] = "count" + gauge = newGaugeMetric(totalTags, float64(totalThreads), nowMS) + processesFamily.Metric = append(processesFamily.Metric, gauge) + for status, count := range totalStatusMap { + totalTags["field"] = status + totalTags["units"] = "count" + gauge = newGaugeMetric(totalTags, float64(count), nowMS) + processesFamily.Metric = append(processesFamily.Metric, gauge) + } var buf bytes.Buffer for _, family := range families { From 487db41c0adc98bf2369d375177b46425c63eb8f Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 3 Mar 2022 16:00:34 -0900 Subject: [PATCH 14/35] add total process state metrics --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index 5c5780b..37a7034 100644 --- a/main.go +++ b/main.go @@ -172,6 +172,7 @@ func executeCheck(event *corev2.Event) (int, error) { totalProcesses := int64(0) totalThreads := int64(0) totalStatusMap := map[string]int64{ + "parked": 0, "wait": 0, "blocked": 0, "zombies": 0, @@ -202,6 +203,8 @@ func executeCheck(event *corev2.Event) (int, error) { } status, err := p.Status() switch status[0] { + case 'P': + totalStatusMap["parked"] += 1 case 'W': totalStatusMap["wait"] += 1 case 'U', 'D', 'L': @@ -214,6 +217,7 @@ func executeCheck(event *corev2.Event) (int, error) { case 'T': totalStatusMap["stopped"] += 1 case 'R': + totalStatusMap["running"] += 1 case 'S': totalStatusMap["sleeping"] += 1 case 'I': From 1842319b1d4389763bb9bcbbc1eef5ac98bfc4cb Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Thu, 3 Mar 2022 16:03:04 -0900 Subject: [PATCH 15/35] help text refactor --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 37a7034..dfdffcd 100644 --- a/main.go +++ b/main.go @@ -164,10 +164,10 @@ func executeCheck(event *corev2.Event) (int, error) { nowMS := time.Now().UnixMilli() families := make([]*dto.MetricFamily, 0) var processesFamily *dto.MetricFamily - processesFamily = newMetricFamily("processes", "SumoLogic Compatibility", dto.MetricType_GAUGE) + processesFamily = newMetricFamily("processes", "SumoLogic Dashboard Compatible Cumulative Process Metrics", dto.MetricType_GAUGE) families = append(families, processesFamily) var procstatFamily *dto.MetricFamily - procstatFamily = newMetricFamily("procstat", "SumoLogic Compatibility", dto.MetricType_GAUGE) + procstatFamily = newMetricFamily("procstat", "SumoLogic Dashboard Compatible Per Process Metrics", dto.MetricType_GAUGE) families = append(families, procstatFamily) totalProcesses := int64(0) totalThreads := int64(0) From b5da95b6994396f95ca597bf13c5367c3394dc44 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Fri, 4 Mar 2022 10:26:38 -0900 Subject: [PATCH 16/35] more metrics work --- main.go | 73 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/main.go b/main.go index dfdffcd..7cf5bab 100644 --- a/main.go +++ b/main.go @@ -32,6 +32,7 @@ type Config struct { Search string SuppressOKOutput bool SumoLogicCompat bool + MetricsOnly bool } var ( @@ -46,7 +47,7 @@ var ( options = []*sensu.PluginConfigOption{ { Path: "search", - Env: "", + Env: "PROCESSES_CHECK_SEARCH", Argument: "search", Shorthand: "s", Default: "", @@ -62,6 +63,15 @@ var ( Usage: "Aside from overal status, only output failures", Value: &plugin.SuppressOKOutput, }, + { + Path: "metrics-only", + Env: "PROCESSES_CHECK_METRICS_ONLY", + Argument: "metrics-only", + Shorthand: "", + Default: false, + Usage: "Do not alert based on search configuration", + Value: &plugin.MetricsOnly, + }, { Path: "sumologic-compat", Env: "PROCESSES_CHECK_SUMOLOGIC_COMPAT", @@ -80,9 +90,6 @@ func main() { } func checkArgs(event *corev2.Event) (int, error) { - //if len(plugin.Search) == 0 { - // return sensu.CheckStateUnknown, fmt.Errorf("--search is required") - //} return sensu.CheckStateOK, nil } @@ -130,36 +137,38 @@ func executeCheck(event *corev2.Event) (int, error) { // Construct alert severity overallSeverity := 0 - for _, search := range searches { - // skip empty search string, should this be tunable? - if len(search.SearchString) == 0 { - continue - } - thisSeverity := 0 - strExpr := fmt.Sprintf("%d %s %d", len(found[search.SearchString]), search.Comparison, search.Number) - expression, err := govaluate.NewEvaluableExpression(strExpr) - if err != nil { - return sensu.CheckStateCritical, fmt.Errorf("Unable to create expression %s: %v", strExpr, err) - } - result, err := expression.Evaluate(nil) - if err != nil { - return sensu.CheckStateCritical, fmt.Errorf("Unable to evalute expression %s: %v", strExpr, err) - } + if !plugin.MetricsOnly { - if !result.(bool) && overallSeverity < search.Severity { - overallSeverity = search.Severity - thisSeverity = search.Severity - } else if !result.(bool) { - thisSeverity = search.Severity - } + for _, search := range searches { + // skip empty search string, should this be tunable? + if len(search.SearchString) == 0 { + continue + } + thisSeverity := 0 + strExpr := fmt.Sprintf("%d %s %d", len(found[search.SearchString]), search.Comparison, search.Number) + expression, err := govaluate.NewEvaluableExpression(strExpr) + if err != nil { + return sensu.CheckStateCritical, fmt.Errorf("Unable to create expression %s: %v", strExpr, err) + } + result, err := expression.Evaluate(nil) + if err != nil { + return sensu.CheckStateCritical, fmt.Errorf("Unable to evalute expression %s: %v", strExpr, err) + } - if (!plugin.SuppressOKOutput && thisSeverity == 0) || thisSeverity > 0 { - fmt.Printf("# %-8s | %d %s %d (found %s required) evaluated %v for %q\n", mapSeverity(thisSeverity), len(found[search.SearchString]), search.Comparison, search.Number, search.Comparison, result.(bool), search.SearchString) - } + if !result.(bool) && overallSeverity < search.Severity { + overallSeverity = search.Severity + thisSeverity = search.Severity + } else if !result.(bool) { + thisSeverity = search.Severity + } - } - fmt.Printf("# Status - %s\n", mapSeverity(overallSeverity)) + if (!plugin.SuppressOKOutput && thisSeverity == 0) || thisSeverity > 0 { + fmt.Printf("# %-8s | %d %s %d (found %s required) evaluated %v for %q\n", mapSeverity(thisSeverity), len(found[search.SearchString]), search.Comparison, search.Number, search.Comparison, result.(bool), search.SearchString) + } + } + fmt.Printf("# Status - %s\n", mapSeverity(overallSeverity)) + } // Construct metrics nowMS := time.Now().UnixMilli() families := make([]*dto.MetricFamily, 0) @@ -281,14 +290,14 @@ func executeCheck(event *corev2.Event) (int, error) { procstatTags["field"] = "num_fds" procstatTags["units"] = "count" ival32, _ = p.NumFDs() - gauge = newGaugeMetric(procstatTags, float64(ival32)*1e6, nowMS) + gauge = newGaugeMetric(procstatTags, float64(ival32), nowMS) procstatFamily.Metric = append(procstatFamily.Metric, gauge) //num_threads metric procstatTags["field"] = "num_threads" procstatTags["units"] = "count" ival32, _ = p.NumThreads() totalThreads += int64(ival32) - gauge = newGaugeMetric(procstatTags, float64(ival32)*1e6, nowMS) + gauge = newGaugeMetric(procstatTags, float64(ival32), nowMS) procstatFamily.Metric = append(procstatFamily.Metric, gauge) iostats, err := p.IOCounters() if err == nil && iostats != nil { From 933479ac3cb17a9331f1a4039b1d2211ad49a4a0 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Fri, 4 Mar 2022 10:58:21 -0900 Subject: [PATCH 17/35] ensure processes are only tabulated once --- main.go | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index 7cf5bab..2a377a8 100644 --- a/main.go +++ b/main.go @@ -33,6 +33,7 @@ type Config struct { SuppressOKOutput bool SumoLogicCompat bool MetricsOnly bool + Verbose bool } var ( @@ -81,6 +82,15 @@ var ( Usage: "Add Sumo Logic compatible \"procstat\" metrics family", Value: &plugin.SumoLogicCompat, }, + { + Path: "verbose", + Env: "PROCESSES_CHECK_SUMOLOGIC_VERBOSE", + Argument: "verbose", + Shorthand: "v", + Default: false, + Usage: "Verbose output", + Value: &plugin.Verbose, + }, } ) @@ -101,32 +111,47 @@ func executeCheck(event *corev2.Event) (int, error) { } myPid := os.Getpid() processes, _ := process.Processes() + + seenPids := make(map[int32]bool) for _, p := range processes { + name, _ := p.Name() + cmdline, _ := p.Cmdline() // Skip myself if p.Pid == int32(myPid) { + if plugin.Verbose { + fmt.Printf("# Skipping this process: %v %v\n", name, cmdline) + } continue } - name, _ := p.Name() - cmdline, _ := p.Cmdline() + // Skip if this Pid has already been tabulated + if _, ok := seenPids[p.Pid]; ok { + if plugin.Verbose { + fmt.Printf("# Skipping duplicate process: %v %v\n", name, cmdline) + } + continue + } else { + seenPids[p.Pid] = true + } if len(searches) == 0 { + // if not search configuration is provided, construct metrics for all processes as empty SearchString found[""] = append(found[""], p) - // if not search configuration is provided, construct metrics for all processes } else { for _, search := range searches { - // skip duplicate search string to prevent duplicate counts - if len(found[search.SearchString]) > 0 { - continue - } // skip empty search string, should this be tunable? if len(search.SearchString) == 0 { + if plugin.Verbose { + fmt.Printf("# Found empty search: %+v\n", search) + } continue } if !search.FullCmdLine && name == search.SearchString { found[search.SearchString] = append(found[search.SearchString], p) + // break out of search loop if process matches : do not let process match multiple searches break } else if search.FullCmdLine { if strings.Contains(cmdline, search.SearchString) { found[search.SearchString] = append(found[search.SearchString], p) + // break out of search if process matches: do not let process match multiple searches break } } From e30b0f0225bf2b0fc85f87ea224134caebe58fc6 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Fri, 4 Mar 2022 11:32:16 -0900 Subject: [PATCH 18/35] refactor metrics processing --- main.go | 333 +---------------------------------------------------- metrics.go | 305 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 308 insertions(+), 330 deletions(-) create mode 100644 metrics.go diff --git a/main.go b/main.go index 2a377a8..d0f008d 100644 --- a/main.go +++ b/main.go @@ -1,17 +1,12 @@ package main import ( - "bytes" "encoding/json" "fmt" "os" - "sort" "strings" - "time" "github.com/Knetic/govaluate" - dto "github.com/prometheus/client_model/go" - "github.com/prometheus/common/expfmt" "github.com/sensu-community/sensu-plugin-sdk/sensu" corev2 "github.com/sensu/sensu-go/api/core/v2" "github.com/shirou/gopsutil/process" @@ -195,334 +190,12 @@ func executeCheck(event *corev2.Event) (int, error) { fmt.Printf("# Status - %s\n", mapSeverity(overallSeverity)) } // Construct metrics - nowMS := time.Now().UnixMilli() - families := make([]*dto.MetricFamily, 0) - var processesFamily *dto.MetricFamily - processesFamily = newMetricFamily("processes", "SumoLogic Dashboard Compatible Cumulative Process Metrics", dto.MetricType_GAUGE) - families = append(families, processesFamily) - var procstatFamily *dto.MetricFamily - procstatFamily = newMetricFamily("procstat", "SumoLogic Dashboard Compatible Per Process Metrics", dto.MetricType_GAUGE) - families = append(families, procstatFamily) - totalProcesses := int64(0) - totalThreads := int64(0) - totalStatusMap := map[string]int64{ - "parked": 0, - "wait": 0, - "blocked": 0, - "zombies": 0, - "dead": 0, - "stopped": 0, - "running": 0, - "sleeping": 0, - "idle": 0, - "unknown": 0, - "unexpected": 0, - } - totalTags := make(map[string]string) - hostname, err := os.Hostname() - if err == nil { - totalTags["host.name"] = hostname - } - for searchStr, processes := range found { - totalProcesses += int64(len(processes)) - for _, p := range processes { - var fval32 float32 - var fval64 float64 - var ival32 int32 - var ival64 int64 - - name, err := p.Name() - if err != nil { - continue - } - status, err := p.Status() - switch status[0] { - case 'P': - totalStatusMap["parked"] += 1 - case 'W': - totalStatusMap["wait"] += 1 - case 'U', 'D', 'L': - totalStatusMap["blocked"] += 1 - // Also known as uninterruptible sleep or disk sleep - case 'Z': - totalStatusMap["zombies"] += 1 - case 'X': - totalStatusMap["dead"] += 1 - case 'T': - totalStatusMap["stopped"] += 1 - case 'R': - totalStatusMap["running"] += 1 - case 'S': - totalStatusMap["sleeping"] += 1 - case 'I': - totalStatusMap["idle"] += 1 - case '?': - totalStatusMap["unknown"] += 1 - default: - totalStatusMap["unexpected"] += 1 - } - procstatTags := make(map[string]string) - //Set the labels for the metric - hostname, err := os.Hostname() - if err == nil { - procstatTags["host.name"] = hostname - } - procstatTags["field"] = "none" - procstatTags["search_string"] = searchStr - procstatTags["process.executable.name"] = name - - //cpu_usage metric - procstatTags["field"] = "cpu_usage" - procstatTags["units"] = "percent" - fval64, _ = p.CPUPercent() - gauge := newGaugeMetric(procstatTags, float64(fval64), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - //memory_usage metric - procstatTags["field"] = "memory_usage" - procstatTags["units"] = "percent" - fval32, _ = p.MemoryPercent() - gauge = newGaugeMetric(procstatTags, float64(fval32), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - mem, err := p.MemoryInfo() - if err == nil { - procstatTags["units"] = "bytes" - procstatTags["field"] = "memory_rss" - gauge = newGaugeMetric(procstatTags, float64(mem.RSS), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - procstatTags["field"] = "memory_vms" - gauge = newGaugeMetric(procstatTags, float64(mem.VMS), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - procstatTags["field"] = "memory_swap" - gauge = newGaugeMetric(procstatTags, float64(mem.Swap), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - procstatTags["field"] = "memory_data" - gauge = newGaugeMetric(procstatTags, float64(mem.Data), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - procstatTags["field"] = "memory_stack" - gauge = newGaugeMetric(procstatTags, float64(mem.Stack), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - procstatTags["field"] = "memory_locked" - gauge = newGaugeMetric(procstatTags, float64(mem.Locked), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - } - //created_at metric - procstatTags["field"] = "created_at" - procstatTags["units"] = "nanoseconds" - ival64, _ = p.CreateTime() - gauge = newGaugeMetric(procstatTags, float64(ival64)*1e6, nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - //num_fds metric - procstatTags["field"] = "num_fds" - procstatTags["units"] = "count" - ival32, _ = p.NumFDs() - gauge = newGaugeMetric(procstatTags, float64(ival32), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - //num_threads metric - procstatTags["field"] = "num_threads" - procstatTags["units"] = "count" - ival32, _ = p.NumThreads() - totalThreads += int64(ival32) - gauge = newGaugeMetric(procstatTags, float64(ival32), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - iostats, err := p.IOCounters() - if err == nil && iostats != nil { - //read_count metric - procstatTags["field"] = "read_count" - procstatTags["units"] = "count" - gauge = newGaugeMetric(procstatTags, float64(iostats.ReadCount), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - //read_bytes metric - procstatTags["field"] = "read_bytes" - procstatTags["units"] = "bytes" - gauge = newGaugeMetric(procstatTags, float64(iostats.ReadBytes), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - //write_count metric - procstatTags["field"] = "write_count" - procstatTags["units"] = "count" - gauge = newGaugeMetric(procstatTags, float64(iostats.WriteCount), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - //write_bytes metric - procstatTags["field"] = "write_bytes" - procstatTags["units"] = "bytes" - gauge = newGaugeMetric(procstatTags, float64(iostats.WriteBytes), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - } - faults, err := p.PageFaults() - if err == nil && faults != nil { - //major_fault metric - procstatTags["field"] = "major_faults" - procstatTags["units"] = "count" - gauge = newGaugeMetric(procstatTags, float64(faults.MajorFaults), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - //minor_fault metric - procstatTags["field"] = "minor_faults" - procstatTags["units"] = "count" - gauge = newGaugeMetric(procstatTags, float64(faults.MinorFaults), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - //child_major_fault metric - procstatTags["field"] = "child_major_faults" - procstatTags["units"] = "count" - gauge = newGaugeMetric(procstatTags, float64(faults.ChildMajorFaults), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - //child_minor_fault metric - procstatTags["field"] = "child_minor_faults" - procstatTags["units"] = "count" - gauge = newGaugeMetric(procstatTags, float64(faults.ChildMinorFaults), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - } - switches, err := p.NumCtxSwitches() - if err == nil && switches != nil { - //involuntary_context_switches - procstatTags["field"] = "involuntary_context_switches" - procstatTags["units"] = "count" - gauge = newGaugeMetric(procstatTags, float64(switches.Involuntary), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - //voluntary_context_switches - procstatTags["field"] = "voluntary_context_switches" - procstatTags["units"] = "count" - gauge = newGaugeMetric(procstatTags, float64(switches.Voluntary), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - } - rlims, err := p.RlimitUsage(true) - if err == nil { - for _, rlim := range rlims { - procstatTags["units"] = "N/A" - var name string - switch rlim.Resource { - case process.RLIMIT_CPU: - name = "cpu_time" - case process.RLIMIT_DATA: - name = "memory_data" - procstatTags["units"] = "bytes" - case process.RLIMIT_STACK: - name = "memory_stack" - procstatTags["units"] = "bytes" - case process.RLIMIT_RSS: - name = "memory_rss" - procstatTags["units"] = "bytes" - case process.RLIMIT_NOFILE: - name = "num_fds" - procstatTags["units"] = "count" - case process.RLIMIT_MEMLOCK: - name = "memory_locked" - procstatTags["units"] = "bytes" - case process.RLIMIT_AS: - name = "memory_vms" - procstatTags["units"] = "bytes" - case process.RLIMIT_LOCKS: - name = "file_locks" - procstatTags["units"] = "count" - case process.RLIMIT_SIGPENDING: - name = "signals_pending" - procstatTags["units"] = "count" - case process.RLIMIT_NICE: - name = "nice_priority" - case process.RLIMIT_RTPRIO: - name = "realtime_priority" - default: - continue - } - procstatTags["field"] = "rlimit_" + name + "_soft" - gauge = newGaugeMetric(procstatTags, float64(rlim.Soft), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - procstatTags["field"] = "rlimit_" + name + "_hard" - gauge = newGaugeMetric(procstatTags, float64(rlim.Hard), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - - switch rlim.Resource { - case process.RLIMIT_CPU, - process.RLIMIT_LOCKS, - process.RLIMIT_SIGPENDING, - process.RLIMIT_NICE, - process.RLIMIT_RTPRIO: - procstatTags["field"] = name - gauge = newGaugeMetric(procstatTags, float64(rlim.Used), nowMS) - procstatFamily.Metric = append(procstatFamily.Metric, gauge) - } - - } - } - } - } - totalTags["field"] = "total" - totalTags["units"] = "count" - gauge := newGaugeMetric(totalTags, float64(totalProcesses), nowMS) - processesFamily.Metric = append(processesFamily.Metric, gauge) - totalTags["field"] = "total_threads" - totalTags["units"] = "count" - gauge = newGaugeMetric(totalTags, float64(totalThreads), nowMS) - processesFamily.Metric = append(processesFamily.Metric, gauge) - for status, count := range totalStatusMap { - totalTags["field"] = status - totalTags["units"] = "count" - gauge = newGaugeMetric(totalTags, float64(count), nowMS) - processesFamily.Metric = append(processesFamily.Metric, gauge) - } - - var buf bytes.Buffer - for _, family := range families { - buf.Reset() - encoder := expfmt.NewEncoder(&buf, expfmt.FmtText) - err = encoder.Encode(family) - if err != nil { - return sensu.CheckStateCritical, err - } - - fmt.Print(buf.String()) + err = generateMetrics(found) + if err != nil { + return sensu.CheckStateCritical, nil } - return overallSeverity, nil } -func newGaugeMetric(tags map[string]string, value float64, timestampMS int64) *dto.Metric { - labels := make([]*dto.LabelPair, 0) - keys := make([]string, 0, len(tags)) - for k := range tags { - keys = append(keys, k) - } - sort.Strings(keys) - for _, key := range keys { - name := fmt.Sprintf("%v", key) - val := fmt.Sprintf("%v", tags[key]) - labels = append(labels, &dto.LabelPair{Name: &name, Value: &val}) - } - gauge := &dto.Metric{ - Label: labels, - Gauge: &dto.Gauge{ - Value: &value, - }, - TimestampMs: ×tampMS, - } - return gauge -} -func newCounterMetric(tags map[string]string, value float64, timestampMS int64) *dto.Metric { - labels := make([]*dto.LabelPair, 0) - keys := make([]string, 0, len(tags)) - for k := range tags { - keys = append(keys, k) - } - sort.Strings(keys) - for _, key := range keys { - name := fmt.Sprintf("%v", key) - val := fmt.Sprintf("%v", tags[key]) - labels = append(labels, &dto.LabelPair{Name: &name, Value: &val}) - } - counter := &dto.Metric{ - Label: labels, - Counter: &dto.Counter{ - Value: &value, - }, - TimestampMs: ×tampMS, - } - return counter -} -func newMetricFamily(name, help string, metricType dto.MetricType) *dto.MetricFamily { - return &dto.MetricFamily{ - Name: &name, - Help: &help, - Type: &metricType, - Metric: []*dto.Metric{}, - } -} func parseSearches(searchJSON string) ([]Search, error) { searches := []Search{} diff --git a/metrics.go b/metrics.go new file mode 100644 index 0000000..3f5a77c --- /dev/null +++ b/metrics.go @@ -0,0 +1,305 @@ +package main + +import ( + "bytes" + "fmt" + "os" + "sort" + "time" + + dto "github.com/prometheus/client_model/go" + "github.com/prometheus/common/expfmt" + "github.com/shirou/gopsutil/process" +) + +func generateMetrics(found map[string][]*process.Process) error { + totalFamilies := make([]*dto.MetricFamily, 0) + var processesFamily *dto.MetricFamily + processesFamily = newMetricFamily("processes", "SumoLogic Dashboard Compatible Cumulative Process Metrics", dto.MetricType_GAUGE) + totalFamilies = append(totalFamilies, processesFamily) + + statFamilies := make([]*dto.MetricFamily, 0) + var procstatFamily *dto.MetricFamily + procstatFamily = newMetricFamily("procstat", "SumoLogic Dashboard Compatible Per Process Metrics", dto.MetricType_GAUGE) + statFamilies = append(statFamilies, procstatFamily) + + nowMS := time.Now().UnixMilli() + totalProcesses := int64(0) + totalThreads := int64(0) + totalStatusMap := map[string]int64{ + "parked": 0, + "wait": 0, + "blocked": 0, + "zombies": 0, + "dead": 0, + "stopped": 0, + "running": 0, + "sleeping": 0, + "idle": 0, + "unknown": 0, + "unexpected": 0, + } + totalTags := make(map[string]string) + hostname, err := os.Hostname() + if err == nil { + totalTags["host.name"] = hostname + } + for searchStr, processes := range found { + totalProcesses += int64(len(processes)) + for _, p := range processes { + var fval32 float32 + var fval64 float64 + var ival32 int32 + var ival64 int64 + + name, err := p.Name() + if err != nil { + continue + } + status, err := p.Status() + switch status[0] { + case 'P': + totalStatusMap["parked"] += 1 + case 'W': + totalStatusMap["wait"] += 1 + case 'U', 'D', 'L': + totalStatusMap["blocked"] += 1 + // Also known as uninterruptible sleep or disk sleep + case 'Z': + totalStatusMap["zombies"] += 1 + case 'X': + totalStatusMap["dead"] += 1 + case 'T': + totalStatusMap["stopped"] += 1 + case 'R': + totalStatusMap["running"] += 1 + case 'S': + totalStatusMap["sleeping"] += 1 + case 'I': + totalStatusMap["idle"] += 1 + case '?': + totalStatusMap["unknown"] += 1 + default: + totalStatusMap["unexpected"] += 1 + } + metricTags := make(map[string]string) + //Set the labels for the metric + hostname, err := os.Hostname() + if err == nil { + metricTags["host.name"] = hostname + } + metricTags["field"] = "none" + metricTags["search_string"] = searchStr + metricTags["process.executable.name"] = name + + //cpu_usage metric + metricTags["field"] = "cpu_usage" + metricTags["units"] = "percent" + fval64, _ = p.CPUPercent() + _, err = addGaugeMetric(statFamilies, metricTags, float64(fval64), nowMS) + //memory_usage metric + metricTags["field"] = "memory_usage" + metricTags["units"] = "percent" + fval32, _ = p.MemoryPercent() + _, err = addGaugeMetric(statFamilies, metricTags, float64(fval32), nowMS) + mem, err := p.MemoryInfo() + if err == nil { + metricTags["units"] = "bytes" + metricTags["field"] = "memory_rss" + _, err = addGaugeMetric(statFamilies, metricTags, float64(mem.RSS), nowMS) + metricTags["field"] = "memory_vms" + _, err = addGaugeMetric(statFamilies, metricTags, float64(mem.VMS), nowMS) + metricTags["field"] = "memory_swap" + _, err = addGaugeMetric(statFamilies, metricTags, float64(mem.Swap), nowMS) + metricTags["field"] = "memory_data" + _, err = addGaugeMetric(statFamilies, metricTags, float64(mem.Data), nowMS) + metricTags["field"] = "memory_stack" + _, err = addGaugeMetric(statFamilies, metricTags, float64(mem.Stack), nowMS) + metricTags["field"] = "memory_locked" + _, err = addGaugeMetric(statFamilies, metricTags, float64(mem.Locked), nowMS) + } + //created_at metric + metricTags["field"] = "created_at" + metricTags["units"] = "nanoseconds" + ival64, _ = p.CreateTime() + _, err = addGaugeMetric(statFamilies, metricTags, float64(ival64)*1e6, nowMS) + //num_fds metric + metricTags["field"] = "num_fds" + metricTags["units"] = "count" + ival32, _ = p.NumFDs() + _, err = addGaugeMetric(statFamilies, metricTags, float64(ival32), nowMS) + //num_threads metric + metricTags["field"] = "num_threads" + metricTags["units"] = "count" + ival32, _ = p.NumThreads() + totalThreads += int64(ival32) + _, err = addGaugeMetric(statFamilies, metricTags, float64(ival32), nowMS) + iostats, err := p.IOCounters() + if err == nil && iostats != nil { + //read_count metric + metricTags["field"] = "read_count" + metricTags["units"] = "count" + _, err = addGaugeMetric(statFamilies, metricTags, float64(iostats.ReadCount), nowMS) + //read_bytes metric + metricTags["field"] = "read_bytes" + metricTags["units"] = "bytes" + _, err = addGaugeMetric(statFamilies, metricTags, float64(iostats.ReadBytes), nowMS) + //write_count metric + metricTags["field"] = "write_count" + metricTags["units"] = "count" + _, err = addGaugeMetric(statFamilies, metricTags, float64(iostats.WriteCount), nowMS) + //write_bytes metric + metricTags["field"] = "write_bytes" + metricTags["units"] = "bytes" + _, err = addGaugeMetric(statFamilies, metricTags, float64(iostats.WriteBytes), nowMS) + } + faults, err := p.PageFaults() + if err == nil && faults != nil { + //major_fault metric + metricTags["field"] = "major_faults" + metricTags["units"] = "count" + _, err = addGaugeMetric(statFamilies, metricTags, float64(faults.MajorFaults), nowMS) + //minor_fault metric + metricTags["field"] = "minor_faults" + metricTags["units"] = "count" + _, err = addGaugeMetric(statFamilies, metricTags, float64(faults.MinorFaults), nowMS) + //child_major_fault metric + metricTags["field"] = "child_major_faults" + metricTags["units"] = "count" + _, err = addGaugeMetric(statFamilies, metricTags, float64(faults.ChildMajorFaults), nowMS) + //child_minor_fault metric + metricTags["field"] = "child_minor_faults" + metricTags["units"] = "count" + _, err = addGaugeMetric(statFamilies, metricTags, float64(faults.ChildMinorFaults), nowMS) + } + switches, err := p.NumCtxSwitches() + if err == nil && switches != nil { + //involuntary_context_switches + metricTags["field"] = "involuntary_context_switches" + metricTags["units"] = "count" + _, err = addGaugeMetric(statFamilies, metricTags, float64(switches.Involuntary), nowMS) + //voluntary_context_switches + metricTags["field"] = "voluntary_context_switches" + metricTags["units"] = "count" + _, err = addGaugeMetric(statFamilies, metricTags, float64(switches.Voluntary), nowMS) + } + rlims, err := p.RlimitUsage(true) + if err == nil { + for _, rlim := range rlims { + metricTags["units"] = "N/A" + var name string + switch rlim.Resource { + case process.RLIMIT_CPU: + name = "cpu_time" + case process.RLIMIT_DATA: + name = "memory_data" + metricTags["units"] = "bytes" + case process.RLIMIT_STACK: + name = "memory_stack" + metricTags["units"] = "bytes" + case process.RLIMIT_RSS: + name = "memory_rss" + metricTags["units"] = "bytes" + case process.RLIMIT_NOFILE: + name = "num_fds" + metricTags["units"] = "count" + case process.RLIMIT_MEMLOCK: + name = "memory_locked" + metricTags["units"] = "bytes" + case process.RLIMIT_AS: + name = "memory_vms" + metricTags["units"] = "bytes" + case process.RLIMIT_LOCKS: + name = "file_locks" + metricTags["units"] = "count" + case process.RLIMIT_SIGPENDING: + name = "signals_pending" + metricTags["units"] = "count" + case process.RLIMIT_NICE: + name = "nice_priority" + case process.RLIMIT_RTPRIO: + name = "realtime_priority" + default: + continue + } + metricTags["field"] = "rlimit_" + name + "_soft" + _, err = addGaugeMetric(statFamilies, metricTags, float64(rlim.Soft), nowMS) + metricTags["field"] = "rlimit_" + name + "_hard" + _, err = addGaugeMetric(statFamilies, metricTags, float64(rlim.Hard), nowMS) + + switch rlim.Resource { + case process.RLIMIT_CPU, + process.RLIMIT_LOCKS, + process.RLIMIT_SIGPENDING, + process.RLIMIT_NICE, + process.RLIMIT_RTPRIO: + metricTags["field"] = name + _, err = addGaugeMetric(statFamilies, metricTags, float64(rlim.Used), nowMS) + } + + } + } + + } + } + totalTags["field"] = "total" + totalTags["units"] = "count" + _, err = addGaugeMetric(totalFamilies, totalTags, float64(totalProcesses), nowMS) + totalTags["field"] = "total_threads" + totalTags["units"] = "count" + _, err = addGaugeMetric(totalFamilies, totalTags, float64(totalThreads), nowMS) + for status, count := range totalStatusMap { + totalTags["field"] = status + totalTags["units"] = "count" + _, err = addGaugeMetric(totalFamilies, totalTags, float64(count), nowMS) + } + statFamilies = append(statFamilies, totalFamilies...) + var buf bytes.Buffer + for _, family := range statFamilies { + if len(family.Metric) > 0 { + buf.Reset() + encoder := expfmt.NewEncoder(&buf, expfmt.FmtText) + err = encoder.Encode(family) + if err != nil { + return err + } + + fmt.Print(buf.String()) + } + } + return nil + +} +func newMetricFamily(name, help string, metricType dto.MetricType) *dto.MetricFamily { + return &dto.MetricFamily{ + Name: &name, + Help: &help, + Type: &metricType, + Metric: []*dto.Metric{}, + } +} + +func addGaugeMetric(families []*dto.MetricFamily, tags map[string]string, value float64, timestampMS int64) (*dto.Metric, error) { + labels := make([]*dto.LabelPair, 0) + keys := make([]string, 0, len(tags)) + for k := range tags { + keys = append(keys, k) + } + sort.Strings(keys) + for _, key := range keys { + name := fmt.Sprintf("%v", key) + val := fmt.Sprintf("%v", tags[key]) + labels = append(labels, &dto.LabelPair{Name: &name, Value: &val}) + } + gauge := &dto.Metric{ + Label: labels, + Gauge: &dto.Gauge{ + Value: &value, + }, + TimestampMs: ×tampMS, + } + for _, family := range families { + family.Metric = append(family.Metric, gauge) + } + return gauge, nil +} From b178276500718020893871e4c6cf996cb206581f Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Fri, 4 Mar 2022 11:56:31 -0900 Subject: [PATCH 19/35] update test coverage --- main_test.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/main_test.go b/main_test.go index d0a69df..fe0fd35 100644 --- a/main_test.go +++ b/main_test.go @@ -10,6 +10,21 @@ import ( func TestMain(t *testing.T) { } +func TestMapSeverity(t *testing.T) { + assert := assert.New(t) + ret := mapSeverity(0) + assert.Equal("OK", ret) + ret = mapSeverity(1) + assert.Equal("WARNING", ret) + ret = mapSeverity(2) + assert.Equal("CRITICAL", ret) + for i := 3; i < 10; i++ { + ret = mapSeverity(i) + assert.Equal("UNKNOWN", ret) + } + +} + func TestParseSearches(t *testing.T) { assert := assert.New(t) searches := `[{"full_cmdline": true, "number": 1, "severity": 1, "search_string": "eventmonitor"}, {"number": 1, "severity": 2, "search_string": "ssh-agent"}, {"number": 2, "severity": 1, "search_string": "non-existent"}]` @@ -28,3 +43,19 @@ func TestCheckArgs(t *testing.T) { _, err = checkArgs(event) assert.NoError(err) } + +func TestExecuteCheck(t *testing.T) { + assert := assert.New(t) + plugin.Search = `` + _, err := executeCheck(nil) + assert.NoError(err) + + plugin.Verbose = true + plugin.Search = `[{"full_cmdline": true, "number": 1, "severity": 1, "search_string": "eventmonitor"}, {"number": 1, "severity": 2, "search_string": "ssh-agent"}, {"number": 2, "severity": 1, "search_string": "non-existent"}]` + _, err = executeCheck(nil) + assert.NoError(err) + + plugin.Search = `[{"full_cmdline": true, "number": 1, "severity": 1, "search_string": "go"}, {"full_cmdline": true, "number": 2, "severity": 1, "search_string": "go"}]` + _, err = executeCheck(nil) + assert.NoError(err) +} From 1ea9cacfba746558d27c46acba41cb72a4701cea Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Fri, 4 Mar 2022 12:00:41 -0900 Subject: [PATCH 20/35] add test coverage --- main_test.go | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/main_test.go b/main_test.go index fe0fd35..ef6a998 100644 --- a/main_test.go +++ b/main_test.go @@ -44,18 +44,26 @@ func TestCheckArgs(t *testing.T) { assert.NoError(err) } -func TestExecuteCheck(t *testing.T) { +func TestExecuteCheckWithSearch(t *testing.T) { assert := assert.New(t) - plugin.Search = `` + plugin.Verbose = true + plugin.Search = `[{"full_cmdline": true, "number": 1, "severity": 1, "search_string": "go"}, {"full_cmdline": true, "number": 2, "severity": 1, "search_string": "go"}]` _, err := executeCheck(nil) assert.NoError(err) - +} +func TestExecuteCheckFullProcessList(t *testing.T) { + assert := assert.New(t) plugin.Verbose = true - plugin.Search = `[{"full_cmdline": true, "number": 1, "severity": 1, "search_string": "eventmonitor"}, {"number": 1, "severity": 2, "search_string": "ssh-agent"}, {"number": 2, "severity": 1, "search_string": "non-existent"}]` - _, err = executeCheck(nil) + plugin.Search = `` + _, err := executeCheck(nil) assert.NoError(err) +} - plugin.Search = `[{"full_cmdline": true, "number": 1, "severity": 1, "search_string": "go"}, {"full_cmdline": true, "number": 2, "severity": 1, "search_string": "go"}]` - _, err = executeCheck(nil) +func TestExecuteCheckFullProcessListMetricsOnly(t *testing.T) { + assert := assert.New(t) + plugin.Verbose = false + plugin.MetricsOnly = true + plugin.Search = `` + _, err := executeCheck(nil) assert.NoError(err) } From 83610c57ea71c074d6cf4f31b41b7153ba644e2e Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Fri, 4 Mar 2022 12:36:03 -0900 Subject: [PATCH 21/35] update to latest deps --- .goreleaser.yml | 4 +- CHANGELOG.md | 6 + go.mod | 8 +- go.sum | 295 +++++++++++++++++++++++++++++++++++++++++++----- main.go | 2 +- 5 files changed, 280 insertions(+), 35 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index c5eca04..eefaee2 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -4,8 +4,8 @@ builds: - # First Build env: - CGO_ENABLED=0 - main: main.go - ldflags: '-s -w -X github.com/sensu-community/sensu-plugin-sdk/version.version={{.Version}} -X github.com/sensu-community/sensu-plugin-sdk/version.commit={{.Commit}} -X github.com/sensu-community/sensu-plugin-sdk/version.date={{.Date}}' + main: . + ldflags: '-s -w -X github.com/sensu/sensu-plugin-sdk/version.version={{.Version}} -X github.com/sensu/sensu-plugin-sdk/version.commit={{.Commit}} -X github.com/sensu/sensu-plugin-sdk/version.date={{.Date}}' # Set the binary output location to bin/ so archive will comply with Sensu Go Asset structure binary: bin/{{ .ProjectName }} goos: diff --git a/CHANGELOG.md b/CHANGELOG.md index c463dde..01d2e6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## Unreleased +### Added +- Sumo Logic Dashboard compatible metric output ### Changed +- Allow for empty search configuration to match full process list +- Added metrics only flag to disable search based alerts +- Converted search alert text output into metric comment strings +- Update to sensu plugin sdk 0.15.0 - Changed types import to corev2 - Minor README fix diff --git a/go.mod b/go.mod index 0c4cc3d..18c6f1a 100644 --- a/go.mod +++ b/go.mod @@ -7,16 +7,14 @@ require ( github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect github.com/go-ole/go-ole v1.2.4 // indirect github.com/pelletier/go-toml v1.6.0 // indirect - github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 - github.com/prometheus/common v0.4.0 - github.com/sensu-community/sensu-plugin-sdk v0.11.0 + github.com/prometheus/client_model v0.2.0 + github.com/prometheus/common v0.32.1 github.com/sensu/sensu-go/api/core/v2 v2.3.0 + github.com/sensu/sensu-plugin-sdk v0.15.0 github.com/shirou/gopsutil v3.20.10+incompatible github.com/spf13/afero v1.2.2 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/stretchr/testify v1.6.0 - golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa // indirect - golang.org/x/sys v0.0.0-20200120151820-655fe14d7479 // indirect gopkg.in/ini.v1 v1.51.1 // indirect ) diff --git a/go.sum b/go.sum index c04e905..7faf813 100644 --- a/go.sum +++ b/go.sum @@ -5,13 +5,33 @@ cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6A cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Knetic/govaluate v3.0.0+incompatible h1:7o6+MAPhYTCF0+fdvoz1xDedhRb4f6s9Tn1Tt7/WTEg= @@ -20,17 +40,27 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -44,23 +74,30 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/echlebek/crock v1.0.1 h1:KbzamClMIfVIkkjq/GTXf+N16KylYBpiaTitO3f1ujg= github.com/echlebek/crock v1.0.1/go.mod h1:/kvwHRX3ZXHj/kHWJkjXDmzzRow54EJuHtQ/PapL/HI= github.com/echlebek/timeproxy v1.0.0 h1:V41/v8tmmMDNMA2GrBPI45nlXb3F7+OY+nJz1BqKsCk= github.com/echlebek/timeproxy v1.0.0/go.mod h1:0dg2Lnb8no/jFwoMQKMTU6iAivgoMptGqSTprhnrRtk= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -68,30 +105,60 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -119,16 +186,21 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -136,10 +208,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= @@ -165,6 +235,7 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -172,19 +243,31 @@ github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzI github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0 h1:7etb9YClo3a6HjLzfl6rIQaU+FDfi0VSX39io3aQ+DM= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/robertkrimen/otto v0.0.0-20191219234010-c382bd3c16ff h1:+6NUiITWwE5q1KO6SAfUX918c+Tab0+tGAM/mtdlUyA= github.com/robertkrimen/otto v0.0.0-20191219234010-c382bd3c16ff/go.mod h1:xvqspoSXJTIpemEonrMDFq6XzwHYYgToXWj5eRX1OtY= @@ -195,8 +278,6 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sensu-community/sensu-plugin-sdk v0.11.0 h1:qkkteqfQx9pW7wbEZ7pk9w1OzqAmJSvXX1mpptibob0= -github.com/sensu-community/sensu-plugin-sdk v0.11.0/go.mod h1:OMS/JgUcJRBbrojqJHoRW5fsWfsb3A+G9rVNgIgDrIM= github.com/sensu/sensu-go/api/core/v2 v2.0.0/go.mod h1:L+ZZ+QzsGTrNldiAdVrrQI/WIo31cq43YnEFt9T/6Pg= github.com/sensu/sensu-go/api/core/v2 v2.3.0 h1:7RrVfN4dvOMFsEOLotpvYD061s/fhicZQf4JaVoLgaI= github.com/sensu/sensu-go/api/core/v2 v2.3.0/go.mod h1:97IK4ZQuvVjWvvoLkp+NgrD6ot30WDRz3LEbFUc/N34= @@ -205,15 +286,16 @@ github.com/sensu/sensu-go/types v0.3.0 h1:nVplWvduq9ArIu2rz3jMrzdVBFAlkm6T9l45Uy github.com/sensu/sensu-go/types v0.3.0/go.mod h1:TyeO3h/82XE1KppZRFg+jKB4QYwY2hE5hbCzjnnGdRo= github.com/sensu/sensu-licensing v0.1.2 h1:EEZxvbj/pmCCfD4ePAzs9mb6k6IPRDbUJcwAOfSvuUc= github.com/sensu/sensu-licensing v0.1.2/go.mod h1:Xfs4do2c3U+VvuNCjthUH7QJOZ9o6NfbQSb7rrvSXGc= +github.com/sensu/sensu-plugin-sdk v0.15.0 h1:4ukLVY+CwuLDveR67/2tIMCPYQA4AwNiLoRxgLVp6xg= +github.com/sensu/sensu-plugin-sdk v0.15.0/go.mod h1:oOp6HAJR+LfrufCOGv5HmTctHKRzn+E68td6TPNZDbQ= github.com/shirou/gopsutil v3.20.10+incompatible h1:kQuRhh6h6y4luXvnmtu/lJEGtdJ3q8lbu9NQY99GP+o= github.com/shirou/gopsutil v3.20.10+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -237,7 +319,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgho= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= @@ -245,9 +327,15 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= @@ -256,11 +344,18 @@ golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -270,10 +365,17 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -288,17 +390,41 @@ golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa h1:F+8P+gmewFQYRk6JoLQLwjBCTu3mcIURZfNkVweuRKA= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -313,14 +439,42 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200120151820-655fe14d7479 h1:LhLiKguPgZL+Tglay4GhVtfF0kb8cvOJ0dHTCBO8YNI= -golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -340,16 +494,57 @@ golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -358,18 +553,59 @@ google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a h1:Ob5/580gVHBJZgXnff1cZDbG+xLtMVE5mDRTe+nIsX4= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 h1:PDIOdWxZ8eRizhKa1AAvY53xsvLB1cWorMjslvY3VA8= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0 h1:T7P4R73V3SSDPhH7WW7ATbfViLtmamH0DKrP3f9AuDI= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1 h1:7QnIQpGRHE5RnLKnESfDoxm2dTapTZua5a0kS0A+VXQ= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.51.1 h1:GyboHr4UqMiLUybYjd22ZjQIKEJEpgtLXtuGbR21Oho= @@ -381,13 +617,18 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/main.go b/main.go index d0f008d..610cbb5 100644 --- a/main.go +++ b/main.go @@ -7,8 +7,8 @@ import ( "strings" "github.com/Knetic/govaluate" - "github.com/sensu-community/sensu-plugin-sdk/sensu" corev2 "github.com/sensu/sensu-go/api/core/v2" + "github.com/sensu/sensu-plugin-sdk/sensu" "github.com/shirou/gopsutil/process" ) From 9c4ceaeb0a46ce62e6090832a42ff68b390db57f Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Fri, 4 Mar 2022 13:25:28 -0900 Subject: [PATCH 22/35] fix metric --- metrics.go | 1 + 1 file changed, 1 insertion(+) diff --git a/metrics.go b/metrics.go index 3f5a77c..2d5f6e1 100644 --- a/metrics.go +++ b/metrics.go @@ -191,6 +191,7 @@ func generateMetrics(found map[string][]*process.Process) error { switch rlim.Resource { case process.RLIMIT_CPU: name = "cpu_time" + metricTags["units"] = "seconds" case process.RLIMIT_DATA: name = "memory_data" metricTags["units"] = "bytes" From 257e16a6b07f54d1264732410e31efce99243d01 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Fri, 4 Mar 2022 13:40:48 -0900 Subject: [PATCH 23/35] add metrics into readme --- README.md | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++--- go.sum | 4 +++ metrics.go | 25 ++++++++------- 3 files changed, 104 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 7cf6d84..b68f3c3 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ ## Table of Contents - [Overview](#overview) +- [Output Metrics](#output-metrics) - [Configuration](#configuration) - [Asset registration](#asset-registration) - [Check definition](#check-definition) @@ -19,11 +20,92 @@ ## Overview -The Sensu Processes Check is a [Sensu Check][1] that searches for certain -running processes (or other strings in a command line). It can search for -multiple processes and, on a per-string basis, set the number of processes -expected, severity if the number of processes is not met, and whether or not -to search the full command line for the requested string. +The Sensu Processes Check is a [Sensu Check][1] that provides metrics for +processes found in the host process table. + +It can optionally restrict the list of processes considered, using a [search configuration](#search-string-details) specifying multiple +strings to match. The search configuration can also be used to set alert conditions based on the +number of matching processes on a per-string basis. + +### Output Metrics +Metrics output conforms to the Prometheus exposition standard. + +### procstat +The `procstat` metric family provides individual per-process metrics for each process matching the configured search criteria. +Each different per-process metric in this metric family is distinguished by the value of the label named `field`. +Each metric is also labeled with `process.executable.name` and `process.executable.pid` + +| Field | Units | Description | +|--------------------------------|-------------|-------------------------------------| +| cpu_usage | percent | percent of CPU time used by process +| cpu_time | seconds | total amount of time process has used +| created_at | nanoseconds | process creation time since Unix epoch +| memory_usage | percent | percent of memory used by process +| memory_rss | bytes | process resident set (the number of virtual pages resident in RAM +| memory_vms | bytes | size of the process's virtual memory (address space) +| memory_swap | bytes | size of the process's swap +| memory_data | bytes | size of the process's data segment (initialized data, uninitialized data, and heap +| memory_stack | bytes | size of the process stack +| memory_locked | bytes | size of memory locked into RAM +| num_fds | count | number of file descriptors opened by process +| file_locks | count | number of file locks held by process +| num_threads | count | number of process threads +| read_count | count | number or read operations performed +| read_bytes | bytes | bytes read +| write_count | count | number of write operations performed +| writebytes | bytes | bytes written +| major_faults | count | The number of major faults the process has made which have required loading a memory page from disk. +| minor_faults | count | The number of minor faults the process has made which have not required loading a memory page from disk. +| child_major_faults | count | The number of major faults that the process's waited-for children have made. +| child_minor_faults | count | The number of minor faults that the process's waited-for children have made. +| signals_pending | count | number of currently queued signals +| nice_priority | N/A | nice priority +| realtime_priority | N/A | realtime priority +| voluntary_context_switches | count | number of voluntary context switches +| involuntary_context_switches | count | number of involuntary context switches +| rlimit_cpu_time_soft | seconds | soft maximum limit for cpu_time +| rlimit_cpu_time_hard | seconds | hard maximum limit for cpu_time +| rlimit_core_size_soft | bytes | ... +| rlimit_core_size_hard | bytes | ... +| rlimit_memory_data_soft | bytes | ... +| rlimit_memory_data_hard | bytes | ... +| rlimit_memory_stack_soft | bytes | ... +| rlimit_memory_stack_hard | bytes | ... +| rlimit_memory_rss_soft | bytes | ... +| rlimit_memory_rss_hard | bytes | ... +| rlimit_num_fds_soft | count | ... +| rlimit_num_fds_hard | count | ... +| rlimit_memory_locked_soft | bytes | ... +| rlimit_memory_locked_hard | bytes | ... +| rlimit_memory_vms_soft | bytes | ... +| rlimit_memory_vms_hard | bytes | ... +| rlimit_file_locks_soft | bytes | ... +| rlimit_file_locks_hard | bytes | ... +| rlimit_signals_pending_soft | count | ... +| rlimit_signals_pending_hard | count | ... +| rlimit_nice_priority_soft | count | ... +| rlimit_nice_priority_hard | count | ... +| rlimit_realtime_priority_soft | count | ... +| rlimit_realtime_priority_hard | count | ... + +#### processes +The `processes` metric family provides summary metrics derived from the list of processes matching the configured search criteria. +Each different metric in this metric family is distinguished by the value of the label named `field`. + +| Field | Units | Description | +|-------------------|-------|-------------------------------------| +| total | count | total number of processes tabulated | +| total_threads | count | total number of threads +| sleeping | count | number of processes in sleeping state +| unknown | count | number of processes in unknown state +| parked | count | number of processes in parked state +| blocked | count | number of processes in blocked state +| zombies | count | number of processes in zombie state +| stopped | count | number of processes in stopped state +| running | count | number of processes in running state +| wait | count | number of processes in wait state +| dead | count | number of processes in dead state +| idle | count | number of processes in idle state ## Configuration diff --git a/go.sum b/go.sum index 7faf813..6803b2f 100644 --- a/go.sum +++ b/go.sum @@ -74,6 +74,7 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -244,6 +245,7 @@ github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -320,6 +322,7 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgho= github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= @@ -621,6 +624,7 @@ gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/metrics.go b/metrics.go index 2d5f6e1..87b82c8 100644 --- a/metrics.go +++ b/metrics.go @@ -27,17 +27,17 @@ func generateMetrics(found map[string][]*process.Process) error { totalProcesses := int64(0) totalThreads := int64(0) totalStatusMap := map[string]int64{ - "parked": 0, - "wait": 0, - "blocked": 0, - "zombies": 0, - "dead": 0, - "stopped": 0, - "running": 0, - "sleeping": 0, - "idle": 0, - "unknown": 0, - "unexpected": 0, + "parked": 0, + "wait": 0, + "blocked": 0, + "zombies": 0, + "dead": 0, + "stopped": 0, + "running": 0, + "sleeping": 0, + "idle": 0, + "unknown": 0, + "other": 0, } totalTags := make(map[string]string) hostname, err := os.Hostname() @@ -80,7 +80,7 @@ func generateMetrics(found map[string][]*process.Process) error { case '?': totalStatusMap["unknown"] += 1 default: - totalStatusMap["unexpected"] += 1 + totalStatusMap["other"] += 1 } metricTags := make(map[string]string) //Set the labels for the metric @@ -91,6 +91,7 @@ func generateMetrics(found map[string][]*process.Process) error { metricTags["field"] = "none" metricTags["search_string"] = searchStr metricTags["process.executable.name"] = name + metricTags["process.executable.pid"] = string(p.Pid) //cpu_usage metric metricTags["field"] = "cpu_usage" From 29854e5f96d6805102621b6835f1bdc75a837b5d Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Fri, 4 Mar 2022 13:42:16 -0900 Subject: [PATCH 24/35] moar readme --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b68f3c3..416d092 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,9 @@ ## Table of Contents - [Overview](#overview) -- [Output Metrics](#output-metrics) + - [Output Metrics](#output-metrics) + - [procstat](#procstat) + - [processes](#processes) - [Configuration](#configuration) - [Asset registration](#asset-registration) - [Check definition](#check-definition) @@ -30,7 +32,7 @@ number of matching processes on a per-string basis. ### Output Metrics Metrics output conforms to the Prometheus exposition standard. -### procstat +#### procstat The `procstat` metric family provides individual per-process metrics for each process matching the configured search criteria. Each different per-process metric in this metric family is distinguished by the value of the label named `field`. Each metric is also labeled with `process.executable.name` and `process.executable.pid` From 1308317433eca6943871e31caa3995905f46a691 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Fri, 4 Mar 2022 13:48:50 -0900 Subject: [PATCH 25/35] hide the sumologic compat flag for now --- README.md | 13 +++++++++++++ main.go | 20 +++++++++++--------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 416d092..14ec757 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ - [Check definition](#check-definition) - [Usage examples](#usage-examples) - [Help output](#help-output) + - [Environment variables](#environment-variables) - [Search string details](#search-string-details) - [Exit severity](#exit-severity) - [Annotations](#annotations) @@ -160,12 +161,24 @@ Available Commands: Flags: -h, --help help for sensu-processes-check + --metrics-only Do not alert based on search configuration -s, --search string An array of JSON search criteria, fields are "search_string", "severity", "number", "comparison", and "full_cmdline" -S, --suppress-ok-output Aside from overal status, only output failures + -v, --verbose Verbose output Use "sensu-processes-check [command] --help" for more information about a command. + ``` +### Environment variables + +| Argument | Environment Variable | +|----------------------|------------------------------------| +| --metrics-only | PROCESSES_CHECK_METRICS_ONLY | +| --search | PROCESSES_CHECK_SEARCH | +| --suppress-ok-output | PROCESSES_CHECK_SUPPRESS_OK_OUTPUT | +| --verbose | PROCESSES_CHECK_SUMOLOGIC_VERBOSE | + ### Search string details The search string is JSON array of processes to search for. Each JSON object diff --git a/main.go b/main.go index 610cbb5..6b9c32c 100644 --- a/main.go +++ b/main.go @@ -68,15 +68,17 @@ var ( Usage: "Do not alert based on search configuration", Value: &plugin.MetricsOnly, }, - { - Path: "sumologic-compat", - Env: "PROCESSES_CHECK_SUMOLOGIC_COMPAT", - Argument: "sumologic-compat", - Shorthand: "", - Default: false, - Usage: "Add Sumo Logic compatible \"procstat\" metrics family", - Value: &plugin.SumoLogicCompat, - }, + /* + { + Path: "sumologic-compat", + Env: "PROCESSES_CHECK_SUMOLOGIC_COMPAT", + Argument: "sumologic-compat", + Shorthand: "", + Default: false, + Usage: "Add Sumo Logic compatible \"procstat\" metrics family", + Value: &plugin.SumoLogicCompat, + }, + */ { Path: "verbose", Env: "PROCESSES_CHECK_SUMOLOGIC_VERBOSE", From 2bb010af22fc1c8c1b9d178bd39810fa7c0014b5 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Fri, 4 Mar 2022 14:01:12 -0900 Subject: [PATCH 26/35] show truncated metrics output in the matching example --- README.md | 30 ++++++++++++++++++++++++++---- main.go | 2 +- metrics.go | 6 +++--- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 14ec757..2bb400d 100644 --- a/README.md +++ b/README.md @@ -203,8 +203,19 @@ is running on a Linux server, the following output may be produced: ``` sensu-processes-check -s '[{"search_string": "sshd"}]' -OK | 3 >= 1 (found >= required) evaluated true for "sshd" -Status - OK +# OK | 3 >= 1 (found >= required) evaluated true for "sshd" +# Status - OK + +# HELP procstat per-process metrics +# TYPE procstat gauge + +... + +# HELP processes summary metrics +# TYPE processes gauge +processes{field="total",host.name="carbon",units="count"} 3 1646434587929 +... + ``` If you compare the output of `ps -e` and `ps -ef` you will see the 3 matches it @@ -229,8 +240,19 @@ and set `search_string` to `/usr/sbin/sshd`. ``` sensu-processes-check -s '[{"search_string": "/usr/sbin/sshd", "full_cmdline": true}]' -OK | 1 >= 1 (found >= required) evaluated true for "/usr/sbin/sshd" -Status - OK +# OK | 1 >= 1 (found >= required) evaluated true for "/usr/sbin/sshd" +# Status - OK + +# HELP procstat per-process metrics +# TYPE procstat gauge + +... + +# HELP processes summary metrics +# TYPE processes gauge +processes{field="total",host.name="carbon",units="count"} 1 1646434588019 +... + ``` #### Supported comparisons diff --git a/main.go b/main.go index 6b9c32c..fb7f999 100644 --- a/main.go +++ b/main.go @@ -189,7 +189,7 @@ func executeCheck(event *corev2.Event) (int, error) { } } - fmt.Printf("# Status - %s\n", mapSeverity(overallSeverity)) + fmt.Printf("# Status - %s\n\n", mapSeverity(overallSeverity)) } // Construct metrics err = generateMetrics(found) diff --git a/metrics.go b/metrics.go index 87b82c8..5e59582 100644 --- a/metrics.go +++ b/metrics.go @@ -15,12 +15,12 @@ import ( func generateMetrics(found map[string][]*process.Process) error { totalFamilies := make([]*dto.MetricFamily, 0) var processesFamily *dto.MetricFamily - processesFamily = newMetricFamily("processes", "SumoLogic Dashboard Compatible Cumulative Process Metrics", dto.MetricType_GAUGE) + processesFamily = newMetricFamily("processes", "summary metrics", dto.MetricType_GAUGE) totalFamilies = append(totalFamilies, processesFamily) statFamilies := make([]*dto.MetricFamily, 0) var procstatFamily *dto.MetricFamily - procstatFamily = newMetricFamily("procstat", "SumoLogic Dashboard Compatible Per Process Metrics", dto.MetricType_GAUGE) + procstatFamily = newMetricFamily("procstat", "per-process metrics", dto.MetricType_GAUGE) statFamilies = append(statFamilies, procstatFamily) nowMS := time.Now().UnixMilli() @@ -91,7 +91,7 @@ func generateMetrics(found map[string][]*process.Process) error { metricTags["field"] = "none" metricTags["search_string"] = searchStr metricTags["process.executable.name"] = name - metricTags["process.executable.pid"] = string(p.Pid) + metricTags["process.executable.pid"] = fmt.Sprintf("%v", (p.Pid)) //cpu_usage metric metricTags["field"] = "cpu_usage" From 426eb424b1ebe892d44a271ab459c66fd355fa22 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Fri, 4 Mar 2022 14:03:09 -0900 Subject: [PATCH 27/35] updated linter --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2583a9a..b419065 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,4 +13,4 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - name: Run golangci-lint - uses: actions-contrib/golangci-lint@v1 + uses: golangci/golangci-lint-action@v2 From 139ecd807eaa876772dcb9e52693aeaa5a8cde29 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Fri, 4 Mar 2022 14:18:00 -0900 Subject: [PATCH 28/35] make linter happy --- go.mod | 8 +--- go.sum | 21 +++++----- metrics.go | 113 ++++++++++++++++++++++++++--------------------------- 3 files changed, 68 insertions(+), 74 deletions(-) diff --git a/go.mod b/go.mod index 18c6f1a..2e6cd25 100644 --- a/go.mod +++ b/go.mod @@ -4,17 +4,13 @@ go 1.14 require ( github.com/Knetic/govaluate v3.0.0+incompatible - github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect - github.com/go-ole/go-ole v1.2.4 // indirect - github.com/pelletier/go-toml v1.6.0 // indirect + github.com/StackExchange/wmi v1.2.1 // indirect github.com/prometheus/client_model v0.2.0 github.com/prometheus/common v0.32.1 github.com/sensu/sensu-go/api/core/v2 v2.3.0 github.com/sensu/sensu-plugin-sdk v0.15.0 github.com/shirou/gopsutil v3.20.10+incompatible - github.com/spf13/afero v1.2.2 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/stretchr/testify v1.6.0 - gopkg.in/ini.v1 v1.51.1 // indirect + github.com/stretchr/testify v1.7.0 ) diff --git a/go.sum b/go.sum index 6803b2f..c98122d 100644 --- a/go.sum +++ b/go.sum @@ -37,8 +37,8 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/Knetic/govaluate v3.0.0+incompatible h1:7o6+MAPhYTCF0+fdvoz1xDedhRb4f6s9Tn1Tt7/WTEg= github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= -github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= +github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -99,8 +99,8 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= -github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= +github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY= +github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= @@ -239,9 +239,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4= -github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -301,9 +300,8 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1 github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -322,8 +320,9 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgho= github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -443,6 +442,7 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -610,9 +610,8 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.51.1 h1:GyboHr4UqMiLUybYjd22ZjQIKEJEpgtLXtuGbR21Oho= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/sourcemap.v1 v1.0.5 h1:inv58fC9f9J3TK2Y2R1NPntXEn3/wjWHkonhIUODNTI= gopkg.in/sourcemap.v1 v1.0.5/go.mod h1:2RlvNNSMglmRrcvhfuzp4hQHwOtjxlbjX7UPY/GXb78= diff --git a/metrics.go b/metrics.go index 5e59582..868d865 100644 --- a/metrics.go +++ b/metrics.go @@ -14,13 +14,11 @@ import ( func generateMetrics(found map[string][]*process.Process) error { totalFamilies := make([]*dto.MetricFamily, 0) - var processesFamily *dto.MetricFamily - processesFamily = newMetricFamily("processes", "summary metrics", dto.MetricType_GAUGE) + processesFamily := newMetricFamily("processes", "summary metrics", dto.MetricType_GAUGE) totalFamilies = append(totalFamilies, processesFamily) statFamilies := make([]*dto.MetricFamily, 0) - var procstatFamily *dto.MetricFamily - procstatFamily = newMetricFamily("procstat", "per-process metrics", dto.MetricType_GAUGE) + procstatFamily := newMetricFamily("procstat", "per-process metrics", dto.MetricType_GAUGE) statFamilies = append(statFamilies, procstatFamily) nowMS := time.Now().UnixMilli() @@ -57,30 +55,32 @@ func generateMetrics(found map[string][]*process.Process) error { continue } status, err := p.Status() - switch status[0] { - case 'P': - totalStatusMap["parked"] += 1 - case 'W': - totalStatusMap["wait"] += 1 - case 'U', 'D', 'L': - totalStatusMap["blocked"] += 1 - // Also known as uninterruptible sleep or disk sleep - case 'Z': - totalStatusMap["zombies"] += 1 - case 'X': - totalStatusMap["dead"] += 1 - case 'T': - totalStatusMap["stopped"] += 1 - case 'R': - totalStatusMap["running"] += 1 - case 'S': - totalStatusMap["sleeping"] += 1 - case 'I': - totalStatusMap["idle"] += 1 - case '?': - totalStatusMap["unknown"] += 1 - default: - totalStatusMap["other"] += 1 + if err != nil { + switch status[0] { + case 'P': + totalStatusMap["parked"] += 1 + case 'W': + totalStatusMap["wait"] += 1 + case 'U', 'D', 'L': + totalStatusMap["blocked"] += 1 + // Also known as uninterruptible sleep or disk sleep + case 'Z': + totalStatusMap["zombies"] += 1 + case 'X': + totalStatusMap["dead"] += 1 + case 'T': + totalStatusMap["stopped"] += 1 + case 'R': + totalStatusMap["running"] += 1 + case 'S': + totalStatusMap["sleeping"] += 1 + case 'I': + totalStatusMap["idle"] += 1 + case '?': + totalStatusMap["unknown"] += 1 + default: + totalStatusMap["other"] += 1 + } } metricTags := make(map[string]string) //Set the labels for the metric @@ -97,92 +97,92 @@ func generateMetrics(found map[string][]*process.Process) error { metricTags["field"] = "cpu_usage" metricTags["units"] = "percent" fval64, _ = p.CPUPercent() - _, err = addGaugeMetric(statFamilies, metricTags, float64(fval64), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(fval64), nowMS) //memory_usage metric metricTags["field"] = "memory_usage" metricTags["units"] = "percent" fval32, _ = p.MemoryPercent() - _, err = addGaugeMetric(statFamilies, metricTags, float64(fval32), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(fval32), nowMS) mem, err := p.MemoryInfo() if err == nil { metricTags["units"] = "bytes" metricTags["field"] = "memory_rss" - _, err = addGaugeMetric(statFamilies, metricTags, float64(mem.RSS), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(mem.RSS), nowMS) metricTags["field"] = "memory_vms" - _, err = addGaugeMetric(statFamilies, metricTags, float64(mem.VMS), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(mem.VMS), nowMS) metricTags["field"] = "memory_swap" - _, err = addGaugeMetric(statFamilies, metricTags, float64(mem.Swap), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(mem.Swap), nowMS) metricTags["field"] = "memory_data" - _, err = addGaugeMetric(statFamilies, metricTags, float64(mem.Data), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(mem.Data), nowMS) metricTags["field"] = "memory_stack" - _, err = addGaugeMetric(statFamilies, metricTags, float64(mem.Stack), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(mem.Stack), nowMS) metricTags["field"] = "memory_locked" - _, err = addGaugeMetric(statFamilies, metricTags, float64(mem.Locked), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(mem.Locked), nowMS) } //created_at metric metricTags["field"] = "created_at" metricTags["units"] = "nanoseconds" ival64, _ = p.CreateTime() - _, err = addGaugeMetric(statFamilies, metricTags, float64(ival64)*1e6, nowMS) + addGaugeMetric(statFamilies, metricTags, float64(ival64)*1e6, nowMS) //num_fds metric metricTags["field"] = "num_fds" metricTags["units"] = "count" ival32, _ = p.NumFDs() - _, err = addGaugeMetric(statFamilies, metricTags, float64(ival32), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(ival32), nowMS) //num_threads metric metricTags["field"] = "num_threads" metricTags["units"] = "count" ival32, _ = p.NumThreads() totalThreads += int64(ival32) - _, err = addGaugeMetric(statFamilies, metricTags, float64(ival32), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(ival32), nowMS) iostats, err := p.IOCounters() if err == nil && iostats != nil { //read_count metric metricTags["field"] = "read_count" metricTags["units"] = "count" - _, err = addGaugeMetric(statFamilies, metricTags, float64(iostats.ReadCount), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(iostats.ReadCount), nowMS) //read_bytes metric metricTags["field"] = "read_bytes" metricTags["units"] = "bytes" - _, err = addGaugeMetric(statFamilies, metricTags, float64(iostats.ReadBytes), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(iostats.ReadBytes), nowMS) //write_count metric metricTags["field"] = "write_count" metricTags["units"] = "count" - _, err = addGaugeMetric(statFamilies, metricTags, float64(iostats.WriteCount), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(iostats.WriteCount), nowMS) //write_bytes metric metricTags["field"] = "write_bytes" metricTags["units"] = "bytes" - _, err = addGaugeMetric(statFamilies, metricTags, float64(iostats.WriteBytes), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(iostats.WriteBytes), nowMS) } faults, err := p.PageFaults() if err == nil && faults != nil { //major_fault metric metricTags["field"] = "major_faults" metricTags["units"] = "count" - _, err = addGaugeMetric(statFamilies, metricTags, float64(faults.MajorFaults), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(faults.MajorFaults), nowMS) //minor_fault metric metricTags["field"] = "minor_faults" metricTags["units"] = "count" - _, err = addGaugeMetric(statFamilies, metricTags, float64(faults.MinorFaults), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(faults.MinorFaults), nowMS) //child_major_fault metric metricTags["field"] = "child_major_faults" metricTags["units"] = "count" - _, err = addGaugeMetric(statFamilies, metricTags, float64(faults.ChildMajorFaults), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(faults.ChildMajorFaults), nowMS) //child_minor_fault metric metricTags["field"] = "child_minor_faults" metricTags["units"] = "count" - _, err = addGaugeMetric(statFamilies, metricTags, float64(faults.ChildMinorFaults), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(faults.ChildMinorFaults), nowMS) } switches, err := p.NumCtxSwitches() if err == nil && switches != nil { //involuntary_context_switches metricTags["field"] = "involuntary_context_switches" metricTags["units"] = "count" - _, err = addGaugeMetric(statFamilies, metricTags, float64(switches.Involuntary), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(switches.Involuntary), nowMS) //voluntary_context_switches metricTags["field"] = "voluntary_context_switches" metricTags["units"] = "count" - _, err = addGaugeMetric(statFamilies, metricTags, float64(switches.Voluntary), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(switches.Voluntary), nowMS) } rlims, err := p.RlimitUsage(true) if err == nil { @@ -225,9 +225,9 @@ func generateMetrics(found map[string][]*process.Process) error { continue } metricTags["field"] = "rlimit_" + name + "_soft" - _, err = addGaugeMetric(statFamilies, metricTags, float64(rlim.Soft), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(rlim.Soft), nowMS) metricTags["field"] = "rlimit_" + name + "_hard" - _, err = addGaugeMetric(statFamilies, metricTags, float64(rlim.Hard), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(rlim.Hard), nowMS) switch rlim.Resource { case process.RLIMIT_CPU, @@ -236,7 +236,7 @@ func generateMetrics(found map[string][]*process.Process) error { process.RLIMIT_NICE, process.RLIMIT_RTPRIO: metricTags["field"] = name - _, err = addGaugeMetric(statFamilies, metricTags, float64(rlim.Used), nowMS) + addGaugeMetric(statFamilies, metricTags, float64(rlim.Used), nowMS) } } @@ -246,14 +246,14 @@ func generateMetrics(found map[string][]*process.Process) error { } totalTags["field"] = "total" totalTags["units"] = "count" - _, err = addGaugeMetric(totalFamilies, totalTags, float64(totalProcesses), nowMS) + addGaugeMetric(totalFamilies, totalTags, float64(totalProcesses), nowMS) totalTags["field"] = "total_threads" totalTags["units"] = "count" - _, err = addGaugeMetric(totalFamilies, totalTags, float64(totalThreads), nowMS) + addGaugeMetric(totalFamilies, totalTags, float64(totalThreads), nowMS) for status, count := range totalStatusMap { totalTags["field"] = status totalTags["units"] = "count" - _, err = addGaugeMetric(totalFamilies, totalTags, float64(count), nowMS) + addGaugeMetric(totalFamilies, totalTags, float64(count), nowMS) } statFamilies = append(statFamilies, totalFamilies...) var buf bytes.Buffer @@ -281,7 +281,7 @@ func newMetricFamily(name, help string, metricType dto.MetricType) *dto.MetricFa } } -func addGaugeMetric(families []*dto.MetricFamily, tags map[string]string, value float64, timestampMS int64) (*dto.Metric, error) { +func addGaugeMetric(families []*dto.MetricFamily, tags map[string]string, value float64, timestampMS int64) { labels := make([]*dto.LabelPair, 0) keys := make([]string, 0, len(tags)) for k := range tags { @@ -303,5 +303,4 @@ func addGaugeMetric(families []*dto.MetricFamily, tags map[string]string, value for _, family := range families { family.Metric = append(family.Metric, gauge) } - return gauge, nil } From 6c661ca47e35d41eae02366c7117fea6694bcfd4 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Fri, 4 Mar 2022 14:19:46 -0900 Subject: [PATCH 29/35] update the go version used to build and test --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 92a91c3..e70827a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v1 with: - go-version: 1.14.x + go-version: 1.17.x - name: Run GoReleaser uses: goreleaser/goreleaser-action@v1 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a3475d..f0d5800 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,10 +12,10 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 - - name: Set up Go 1.14 + - name: Set up Go 1.17 uses: actions/setup-go@v1 with: - go-version: 1.14 + go-version: 1.17 id: go - name: Test run: go test -v ./... From 940e87fefcf48637598a1325371a8e9129d99d45 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Fri, 4 Mar 2022 14:26:17 -0900 Subject: [PATCH 30/35] protect against empty status array in unprivledged windows env --- metrics.go | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/metrics.go b/metrics.go index 868d865..b5def18 100644 --- a/metrics.go +++ b/metrics.go @@ -56,30 +56,32 @@ func generateMetrics(found map[string][]*process.Process) error { } status, err := p.Status() if err != nil { - switch status[0] { - case 'P': - totalStatusMap["parked"] += 1 - case 'W': - totalStatusMap["wait"] += 1 - case 'U', 'D', 'L': - totalStatusMap["blocked"] += 1 - // Also known as uninterruptible sleep or disk sleep - case 'Z': - totalStatusMap["zombies"] += 1 - case 'X': - totalStatusMap["dead"] += 1 - case 'T': - totalStatusMap["stopped"] += 1 - case 'R': - totalStatusMap["running"] += 1 - case 'S': - totalStatusMap["sleeping"] += 1 - case 'I': - totalStatusMap["idle"] += 1 - case '?': - totalStatusMap["unknown"] += 1 - default: - totalStatusMap["other"] += 1 + if len(status) > 0 { + switch status[0] { + case 'P': + totalStatusMap["parked"] += 1 + case 'W': + totalStatusMap["wait"] += 1 + case 'U', 'D', 'L': + totalStatusMap["blocked"] += 1 + // Also known as uninterruptible sleep or disk sleep + case 'Z': + totalStatusMap["zombies"] += 1 + case 'X': + totalStatusMap["dead"] += 1 + case 'T': + totalStatusMap["stopped"] += 1 + case 'R': + totalStatusMap["running"] += 1 + case 'S': + totalStatusMap["sleeping"] += 1 + case 'I': + totalStatusMap["idle"] += 1 + case '?': + totalStatusMap["unknown"] += 1 + default: + totalStatusMap["other"] += 1 + } } } metricTags := make(map[string]string) From 18dce072fdcdbb021abcafced3181787e4cb4038 Mon Sep 17 00:00:00 2001 From: Caleb Hailey Date: Thu, 10 Mar 2022 00:38:37 -0800 Subject: [PATCH 31/35] update go version; run go mod tidy --- go.mod | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- go.sum | 11 +++++++++++ 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2e6cd25..af14e89 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,60 @@ module github.com/sensu/sensu-processes-check -go 1.14 +go 1.17 require ( github.com/Knetic/govaluate v3.0.0+incompatible - github.com/StackExchange/wmi v1.2.1 // indirect github.com/prometheus/client_model v0.2.0 github.com/prometheus/common v0.32.1 github.com/sensu/sensu-go/api/core/v2 v2.3.0 github.com/sensu/sensu-plugin-sdk v0.15.0 github.com/shirou/gopsutil v3.20.10+incompatible + github.com/stretchr/testify v1.7.0 +) + +require ( + github.com/StackExchange/wmi v1.2.1 // indirect + github.com/coreos/etcd v3.3.22+incompatible // indirect + github.com/coreos/go-semver v0.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect + github.com/echlebek/timeproxy v1.0.0 // indirect + github.com/fsnotify/fsnotify v1.4.7 // indirect + github.com/go-ole/go-ole v1.2.5 // indirect + github.com/gogo/protobuf v1.3.1 // indirect + github.com/golang/protobuf v1.4.3 // indirect + github.com/google/uuid v1.1.1 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/json-iterator/go v1.1.11 // indirect + github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect + github.com/magiconair/properties v1.8.1 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.1.2 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/pelletier/go-toml v1.2.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/robertkrimen/otto v0.0.0-20191219234010-c382bd3c16ff // indirect + github.com/robfig/cron/v3 v3.0.1 // indirect + github.com/sensu/sensu-go/types v0.3.0 // indirect + github.com/sensu/sensu-licensing v0.1.2 // indirect + github.com/sirupsen/logrus v1.6.0 // indirect + github.com/spf13/afero v1.1.2 // indirect github.com/spf13/cast v1.3.1 // indirect + github.com/spf13/cobra v1.0.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/stretchr/testify v1.7.0 + github.com/spf13/pflag v1.0.3 // indirect + github.com/spf13/viper v1.7.0 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + golang.org/x/net v0.0.0-20210525063256-abc453219eb5 // indirect + golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 // indirect + golang.org/x/text v0.3.6 // indirect + google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 // indirect + google.golang.org/grpc v1.31.0 // indirect + google.golang.org/protobuf v1.26.0-rc.1 // indirect + gopkg.in/ini.v1 v1.51.0 // indirect + gopkg.in/sourcemap.v1 v1.0.5 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect ) diff --git a/go.sum b/go.sum index c98122d..0d93369 100644 --- a/go.sum +++ b/go.sum @@ -32,6 +32,7 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Knetic/govaluate v3.0.0+incompatible h1:7o6+MAPhYTCF0+fdvoz1xDedhRb4f6s9Tn1Tt7/WTEg= @@ -79,6 +80,7 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/echlebek/crock v1.0.1 h1:KbzamClMIfVIkkjq/GTXf+N16KylYBpiaTitO3f1ujg= github.com/echlebek/crock v1.0.1/go.mod h1:/kvwHRX3ZXHj/kHWJkjXDmzzRow54EJuHtQ/PapL/HI= github.com/echlebek/timeproxy v1.0.0 h1:V41/v8tmmMDNMA2GrBPI45nlXb3F7+OY+nJz1BqKsCk= github.com/echlebek/timeproxy v1.0.0/go.mod h1:0dg2Lnb8no/jFwoMQKMTU6iAivgoMptGqSTprhnrRtk= @@ -144,6 +146,7 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -160,6 +163,7 @@ github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -199,6 +203,7 @@ github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMW github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= @@ -209,8 +214,10 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= @@ -296,7 +303,9 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -525,6 +534,7 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -608,6 +618,7 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= From 80bc3d340d76b0f04980dc060b6be6a60148ae82 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Wed, 11 May 2022 17:28:08 -0800 Subject: [PATCH 32/35] remove host.name tag --- README.md | 4 ++-- metrics.go | 12 +----------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 2bb400d..e689f81 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ sensu-processes-check -s '[{"search_string": "sshd"}]' # HELP processes summary metrics # TYPE processes gauge -processes{field="total",host.name="carbon",units="count"} 3 1646434587929 +processes{field="total",units="count"} 3 1646434587929 ... ``` @@ -250,7 +250,7 @@ sensu-processes-check -s '[{"search_string": "/usr/sbin/sshd", "full_cmdline": t # HELP processes summary metrics # TYPE processes gauge -processes{field="total",host.name="carbon",units="count"} 1 1646434588019 +processes{field="total",units="count"} 1 1646434588019 ... ``` diff --git a/metrics.go b/metrics.go index b5def18..33dcda2 100644 --- a/metrics.go +++ b/metrics.go @@ -3,7 +3,6 @@ package main import ( "bytes" "fmt" - "os" "sort" "time" @@ -38,10 +37,6 @@ func generateMetrics(found map[string][]*process.Process) error { "other": 0, } totalTags := make(map[string]string) - hostname, err := os.Hostname() - if err == nil { - totalTags["host.name"] = hostname - } for searchStr, processes := range found { totalProcesses += int64(len(processes)) for _, p := range processes { @@ -85,11 +80,6 @@ func generateMetrics(found map[string][]*process.Process) error { } } metricTags := make(map[string]string) - //Set the labels for the metric - hostname, err := os.Hostname() - if err == nil { - metricTags["host.name"] = hostname - } metricTags["field"] = "none" metricTags["search_string"] = searchStr metricTags["process.executable.name"] = name @@ -263,7 +253,7 @@ func generateMetrics(found map[string][]*process.Process) error { if len(family.Metric) > 0 { buf.Reset() encoder := expfmt.NewEncoder(&buf, expfmt.FmtText) - err = encoder.Encode(family) + err := encoder.Encode(family) if err != nil { return err } From 010224e23e14e4c367b289918ebeeb706342c118 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Wed, 11 May 2022 17:30:09 -0800 Subject: [PATCH 33/35] fix invalid tag names --- README.md | 2 +- metrics.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e689f81..111935a 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Metrics output conforms to the Prometheus exposition standard. #### procstat The `procstat` metric family provides individual per-process metrics for each process matching the configured search criteria. Each different per-process metric in this metric family is distinguished by the value of the label named `field`. -Each metric is also labeled with `process.executable.name` and `process.executable.pid` +Each metric is also labeled with `process_executable_name` and `process_executable_pid` | Field | Units | Description | |--------------------------------|-------------|-------------------------------------| diff --git a/metrics.go b/metrics.go index 33dcda2..fa0e714 100644 --- a/metrics.go +++ b/metrics.go @@ -82,8 +82,8 @@ func generateMetrics(found map[string][]*process.Process) error { metricTags := make(map[string]string) metricTags["field"] = "none" metricTags["search_string"] = searchStr - metricTags["process.executable.name"] = name - metricTags["process.executable.pid"] = fmt.Sprintf("%v", (p.Pid)) + metricTags["process_executable_name"] = name + metricTags["process_executable_pid"] = fmt.Sprintf("%v", (p.Pid)) //cpu_usage metric metricTags["field"] = "cpu_usage" From 648535cbf27baaaff2b743914c255f35d9dff4a1 Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Mon, 11 Jul 2022 11:07:35 -1000 Subject: [PATCH 34/35] update to sdk v0.16.0 and go 1.18 --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 4 +- go.mod | 33 ++++++------ go.sum | 97 ++++++++++++++++++++++------------- main.go | 28 +++++----- 5 files changed, 93 insertions(+), 71 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e70827a..3c1179d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v1 with: - go-version: 1.17.x + go-version: 1.18.x - name: Run GoReleaser uses: goreleaser/goreleaser-action@v1 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f0d5800..17a961f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,10 +12,10 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 - - name: Set up Go 1.17 + - name: Set up Go 1.18 uses: actions/setup-go@v1 with: - go-version: 1.17 + go-version: 1.18 id: go - name: Test run: go test -v ./... diff --git a/go.mod b/go.mod index af14e89..068097e 100644 --- a/go.mod +++ b/go.mod @@ -1,58 +1,57 @@ module github.com/sensu/sensu-processes-check -go 1.17 +go 1.18 require ( github.com/Knetic/govaluate v3.0.0+incompatible github.com/prometheus/client_model v0.2.0 github.com/prometheus/common v0.32.1 - github.com/sensu/sensu-go/api/core/v2 v2.3.0 - github.com/sensu/sensu-plugin-sdk v0.15.0 + github.com/sensu/sensu-go/api/core/v2 v2.14.0 + github.com/sensu/sensu-plugin-sdk v0.16.0 github.com/shirou/gopsutil v3.20.10+incompatible github.com/stretchr/testify v1.7.0 ) require ( github.com/StackExchange/wmi v1.2.1 // indirect - github.com/coreos/etcd v3.3.22+incompatible // indirect + github.com/blang/semver/v4 v4.0.0 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect github.com/echlebek/timeproxy v1.0.0 // indirect github.com/fsnotify/fsnotify v1.4.7 // indirect github.com/go-ole/go-ole v1.2.5 // indirect - github.com/gogo/protobuf v1.3.1 // indirect - github.com/golang/protobuf v1.4.3 // indirect - github.com/google/uuid v1.1.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt/v4 v4.0.0 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/go-cmp v0.5.7 // indirect + github.com/google/uuid v1.1.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/json-iterator/go v1.1.11 // indirect github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect github.com/magiconair/properties v1.8.1 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/mapstructure v1.1.2 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect github.com/pelletier/go-toml v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/robertkrimen/otto v0.0.0-20191219234010-c382bd3c16ff // indirect github.com/robfig/cron/v3 v3.0.1 // indirect - github.com/sensu/sensu-go/types v0.3.0 // indirect + github.com/sensu/sensu-go/types v0.10.0 // indirect github.com/sensu/sensu-licensing v0.1.2 // indirect github.com/sirupsen/logrus v1.6.0 // indirect github.com/spf13/afero v1.1.2 // indirect github.com/spf13/cast v1.3.1 // indirect - github.com/spf13/cobra v1.0.0 // indirect + github.com/spf13/cobra v1.4.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.3 // indirect + github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.7.0 // indirect github.com/subosito/gotenv v1.2.0 // indirect + go.etcd.io/etcd/api/v3 v3.5.0 // indirect golang.org/x/net v0.0.0-20210525063256-abc453219eb5 // indirect golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 // indirect golang.org/x/text v0.3.6 // indirect - google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 // indirect - google.golang.org/grpc v1.31.0 // indirect - google.golang.org/protobuf v1.26.0-rc.1 // indirect + google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect + google.golang.org/grpc v1.38.0 // indirect + google.golang.org/protobuf v1.26.0 // indirect gopkg.in/ini.v1 v1.51.0 // indirect gopkg.in/sourcemap.v1 v1.0.5 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 0d93369..96c7bd4 100644 --- a/go.sum +++ b/go.sum @@ -45,8 +45,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -54,6 +54,8 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -62,22 +64,18 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.17+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.22+incompatible h1:AnRMUyVdVvh1k7lHe61YEd227+CLoNogQuAypztGSK4= -github.com/coreos/etcd v3.3.22+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/echlebek/crock v1.0.1 h1:KbzamClMIfVIkkjq/GTXf+N16KylYBpiaTitO3f1ujg= @@ -87,6 +85,7 @@ github.com/echlebek/timeproxy v1.0.0/go.mod h1:0dg2Lnb8no/jFwoMQKMTU6iAivgoMptGq github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= @@ -106,8 +105,11 @@ github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiU github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= +github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -133,8 +135,10 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -146,8 +150,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -159,17 +163,18 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -199,7 +204,6 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -209,6 +213,7 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= @@ -219,7 +224,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -229,7 +233,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= @@ -237,10 +240,8 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -282,23 +283,25 @@ github.com/robertkrimen/otto v0.0.0-20191219234010-c382bd3c16ff/go.mod h1:xvqspo github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sensu/sensu-go/api/core/v2 v2.0.0/go.mod h1:L+ZZ+QzsGTrNldiAdVrrQI/WIo31cq43YnEFt9T/6Pg= -github.com/sensu/sensu-go/api/core/v2 v2.3.0 h1:7RrVfN4dvOMFsEOLotpvYD061s/fhicZQf4JaVoLgaI= -github.com/sensu/sensu-go/api/core/v2 v2.3.0/go.mod h1:97IK4ZQuvVjWvvoLkp+NgrD6ot30WDRz3LEbFUc/N34= +github.com/sensu/sensu-go/api/core/v2 v2.14.0 h1:z4JVqy7z6iFgMDUH0uc1Ns0bqLFKTpc5bi4Iw7qweks= +github.com/sensu/sensu-go/api/core/v2 v2.14.0/go.mod h1:XCgUjY78ApTahizBz/pkc5KU17L/E5BexeZHkGDdTls= +github.com/sensu/sensu-go/api/core/v3 v3.6.1 h1:WJfIE8gIE9TlmkAI14FGALnOKO/O+D0BS68+HxmjmxY= +github.com/sensu/sensu-go/api/core/v3 v3.6.1/go.mod h1:aqNOkJxkrwRq+rPW47XtVWeb5Rk1K5adlCZGBW9nsvM= github.com/sensu/sensu-go/types v0.1.0/go.mod h1:o3tBPy2BUWb3jPvMQ+pBs0CgCyN1vC1/loN4anURxvs= -github.com/sensu/sensu-go/types v0.3.0 h1:nVplWvduq9ArIu2rz3jMrzdVBFAlkm6T9l45UyhrP1s= -github.com/sensu/sensu-go/types v0.3.0/go.mod h1:TyeO3h/82XE1KppZRFg+jKB4QYwY2hE5hbCzjnnGdRo= +github.com/sensu/sensu-go/types v0.10.0 h1:sm+dLuqEEECVxjW5EfXkU5weGPwrg/Jymbm28HdQpl8= +github.com/sensu/sensu-go/types v0.10.0/go.mod h1:vFZJ9TYBAjSPYtYt+82PpS9P6m73Vzr4O23lmJonzrA= github.com/sensu/sensu-licensing v0.1.2 h1:EEZxvbj/pmCCfD4ePAzs9mb6k6IPRDbUJcwAOfSvuUc= github.com/sensu/sensu-licensing v0.1.2/go.mod h1:Xfs4do2c3U+VvuNCjthUH7QJOZ9o6NfbQSb7rrvSXGc= -github.com/sensu/sensu-plugin-sdk v0.15.0 h1:4ukLVY+CwuLDveR67/2tIMCPYQA4AwNiLoRxgLVp6xg= -github.com/sensu/sensu-plugin-sdk v0.15.0/go.mod h1:oOp6HAJR+LfrufCOGv5HmTctHKRzn+E68td6TPNZDbQ= +github.com/sensu/sensu-plugin-sdk v0.16.0 h1:5WGKTenZOL6fHgKyNJ80nrCNAhh8Rrbi7t5FEqtrZ18= +github.com/sensu/sensu-plugin-sdk v0.16.0/go.mod h1:+amRzOmVmw0En3DHrdw/4PGrTew5M6cxo6MB8FPvO6A= github.com/shirou/gopsutil v3.20.10+incompatible h1:kQuRhh6h6y4luXvnmtu/lJEGtdJ3q8lbu9NQY99GP+o= github.com/shirou/gopsutil v3.20.10+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= @@ -314,14 +317,14 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= +github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -329,19 +332,22 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd/api/v3 v3.5.0 h1:GsV3S+OfZEOCNXdtNkBSR7kgLobAa/SO6tCxRa0GAYw= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -379,6 +385,7 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -387,6 +394,7 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -399,7 +407,6 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -419,6 +426,8 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -435,7 +444,9 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -471,9 +482,12 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -482,6 +496,7 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -528,9 +543,12 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -581,16 +599,17 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 h1:PDIOdWxZ8eRizhKa1AAvY53xsvLB1cWorMjslvY3VA8= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= @@ -601,8 +620,10 @@ google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0 h1:T7P4R73V3SSDPhH7WW7ATbfViLtmamH0DKrP3f9AuDI= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -613,8 +634,9 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1 h1:7QnIQpGRHE5RnLKnESfDoxm2dTapTZua5a0kS0A+VXQ= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -629,6 +651,7 @@ gopkg.in/sourcemap.v1 v1.0.5/go.mod h1:2RlvNNSMglmRrcvhfuzp4hQHwOtjxlbjX7UPY/GXb gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/main.go b/main.go index fb7f999..8ff8484 100644 --- a/main.go +++ b/main.go @@ -40,8 +40,8 @@ var ( }, } - options = []*sensu.PluginConfigOption{ - { + options = []sensu.ConfigOption{ + &sensu.PluginConfigOption[string]{ Path: "search", Env: "PROCESSES_CHECK_SEARCH", Argument: "search", @@ -50,7 +50,7 @@ var ( Usage: `An array of JSON search criteria, fields are "search_string", "severity", "number", "comparison", and "full_cmdline"`, Value: &plugin.Search, }, - { + &sensu.PluginConfigOption[bool]{ Path: "suppress-ok-output", Env: "PROCESSES_CHECK_SUPPRESS_OK_OUTPUT", Argument: "suppress-ok-output", @@ -59,7 +59,7 @@ var ( Usage: "Aside from overal status, only output failures", Value: &plugin.SuppressOKOutput, }, - { + &sensu.PluginConfigOption[bool]{ Path: "metrics-only", Env: "PROCESSES_CHECK_METRICS_ONLY", Argument: "metrics-only", @@ -69,17 +69,17 @@ var ( Value: &plugin.MetricsOnly, }, /* - { - Path: "sumologic-compat", - Env: "PROCESSES_CHECK_SUMOLOGIC_COMPAT", - Argument: "sumologic-compat", - Shorthand: "", - Default: false, - Usage: "Add Sumo Logic compatible \"procstat\" metrics family", - Value: &plugin.SumoLogicCompat, - }, + &sensu.PluginConfigOption[bool]{ + Path: "sumologic-compat", + Env: "PROCESSES_CHECK_SUMOLOGIC_COMPAT", + Argument: "sumologic-compat", + Shorthand: "", + Default: false, + Usage: "Add Sumo Logic compatible \"procstat\" metrics family", + Value: &plugin.SumoLogicCompat, + }, */ - { + &sensu.PluginConfigOption[bool]{ Path: "verbose", Env: "PROCESSES_CHECK_SUMOLOGIC_VERBOSE", Argument: "verbose", From 27d27f96f0b02191069fde2c9721af940c31313b Mon Sep 17 00:00:00 2001 From: Jef Spaleta Date: Mon, 11 Jul 2022 11:09:36 -1000 Subject: [PATCH 35/35] add new bonsai notify workflow to run after release finishes --- .github/workflows/notify-bonsai.yml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/notify-bonsai.yml diff --git a/.github/workflows/notify-bonsai.yml b/.github/workflows/notify-bonsai.yml new file mode 100644 index 0000000..46a1b80 --- /dev/null +++ b/.github/workflows/notify-bonsai.yml @@ -0,0 +1,30 @@ +name: Bonsai + +## +# Only run this workflow after goreleaser complets +## +on: + workflow_run: + workflows: + - goreleaser + types: + - completed + +jobs: + ## + # Note: + # The Bonsai GitHub webhook integration looks for a GitHub webhook payload matching a worflow_job named: `bonsai-recompile` with status: `completed` + # To enable automatic Bonsai recompiles after building a new release in github make sure webhook_jobs events are enabled for + # the Bonsai GitHub webhook installed in GitHub repository by Bonsai as part of the asset repository resgistration process + ## + bonsai-recompile: + ## + # Only run this workflow_job after goreleaser completes successfully + ## + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - name: bonsai-webhook + continue-on-error: true + run: echo "Trigger recompile on 'completed' workflow_job event matching workflow_job.name 'bonsai-recompile' and workflow.name 'bonsai'" +