Skip to content

Commit 54acc90

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 0104e28 + df4dde4 commit 54acc90

File tree

12 files changed

+301
-150
lines changed

12 files changed

+301
-150
lines changed

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
# Changelog
22

3+
## 0.47.0 (2024-06-12)
4+
5+
* return CRITICAL instead of UNKNOWN when check-redis reachable is failed #865 (kmuto)
6+
* Bump the golang-x group with 3 updates #863 (dependabot[bot])
7+
* use go 1.22.x on build phase #862 (lufia)
8+
* update dependencies #861 (lufia)
9+
* [check-mailq] fix pattern #857 (lufia)
10+
* Bump github.com/docker/docker from 25.0.4+incompatible to 25.0.5+incompatible #839 (dependabot[bot])
11+
12+
13+
## 0.46.3 (2024-04-23)
14+
15+
* Revert "Bump github.com/miekg/dns from 1.1.50 to 1.1.59" #840 (ne-sachirou)
16+
* Bump github.com/go-ldap/ldap/v3 from 3.4.4 to 3.4.8 #838 (dependabot[bot])
17+
* Bump github.com/miekg/dns from 1.1.50 to 1.1.59 #837 (dependabot[bot])
18+
* Bump golang.org/x/net from 0.17.0 to 0.23.0 #836 (dependabot[bot])
19+
* Fix: check-log panic with invalid memory address or nil pointer dereference #834 (ne-sachirou)
20+
* Bump the golang-x group with 2 updates #833 (dependabot[bot])
21+
* Bump github.com/docker/docker from 23.0.0+incompatible to 24.0.9+incompatible #831 (dependabot[bot])
22+
* Bump github.com/fsouza/go-dockerclient from 1.9.4 to 1.11.0 #830 (dependabot[bot])
23+
* Bump mackerelio/workflows from 1.0.2 to 1.1.0 #828 (dependabot[bot])
24+
* Bump the testlibs group with 1 update #827 (dependabot[bot])
25+
* Bump github.com/opencontainers/runc from 1.1.2 to 1.1.12 #819 (dependabot[bot])
26+
* Bump actions/cache from 3 to 4 #817 (dependabot[bot])
27+
* Bump github.com/beevik/ntp from 0.3.0 to 1.3.1 #812 (dependabot[bot])
28+
* Bump github.com/containerd/containerd from 1.6.18 to 1.6.26 #810 (dependabot[bot])
29+
* Bump actions/upload-artifact from 3 to 4 #808 (dependabot[bot])
30+
* Bump actions/download-artifact from 3 to 4 #807 (dependabot[bot])
31+
* Bump actions/setup-go from 4 to 5 #806 (dependabot[bot])
32+
* Bump github.com/go-ole/go-ole from 1.2.6 to 1.3.0 #779 (dependabot[bot])
33+
34+
335
## 0.46.2 (2024-02-27)
436

537
* Reduce check-log errors when a file in the log directory has been removed at the moment of running check-log #823 (ne-sachirou)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = 0.46.2
1+
VERSION = 0.47.0
22
CURRENT_REVISION = $(shell git rev-parse --short HEAD)
33
ifeq ($(OS),Windows_NT)
44
GOPATH_ROOT:=$(shell cygpath ${GOPATH})

check-log/lib/check-log.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,9 @@ func findFileByInode(inode uint, dir string) (string, error) {
571571
if err != nil && !errors.Is(err, os.ErrNotExist) {
572572
return "", err
573573
}
574+
if fi == nil {
575+
continue
576+
}
574577
if detectInode(fi) == inode {
575578
return filepath.Join(dir, fi.Name()), nil
576579
}

check-mailq/lib/check_mailq.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func run(args []string) *checkers.Checker {
7575
outs := strings.Split(string(out), "\n")
7676
line := outs[len(outs)-2]
7777

78-
re := regexp.MustCompile(`-- \d+ Kbytes in (\d+) Requests.`)
78+
re := regexp.MustCompile(`-- \d+ Kbytes in (\d+) (?:Request|Requests)\.`)
7979
if re.MatchString(line) {
8080
queueStr = re.ReplaceAllString(line, "$1")
8181
queue, err = strconv.ParseInt(queueStr, 10, 64)

check-redis/lib/check-redis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func checkReachable(args []string) *checkers.Checker {
139139

140140
c, info, err := connectRedisGetInfo(opts)
141141
if err != nil {
142-
return checkers.Unknown(err.Error())
142+
return checkers.Critical(err.Error())
143143
}
144144
defer c.Close()
145145

check-redis/test.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ password=passpass
2020
port=16379
2121
image=redis:5
2222

23+
RET=$($plugin reachable --port $port --password $password)
24+
# check-redis should return CRITICAL (exit code 2) when the server is unreachable
25+
if [ $? -ne 2 ]; then
26+
echo "$prog: $plugin returned $? (2 is expected)" >&2
27+
exit 2
28+
fi
29+
echo "$RET"
30+
2331
docker run --name "test-$plugin" -p "$port:6379" -d "$image" --requirepass "$password"
2432
trap 'docker stop test-$plugin; docker rm test-$plugin; exit' EXIT
2533
sleep 10

go.mod

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,71 @@
11
module github.com/mackerelio/go-check-plugins
22

3-
go 1.20
3+
go 1.22.3
44

55
require (
66
github.com/StackExchange/wmi v1.2.1
7-
github.com/aws/aws-sdk-go v1.47.9
8-
github.com/beevik/ntp v0.3.0
9-
github.com/bradfitz/gomemcache v0.0.0-20221031212613-62deef7fc822
10-
github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819
11-
github.com/elazarl/goproxy/ext v0.0.0-20221015165544-a0805db90819
12-
github.com/fsouza/go-dockerclient v1.9.4
13-
github.com/go-ldap/ldap/v3 v3.4.4
14-
github.com/go-ole/go-ole v1.2.6
15-
github.com/go-sql-driver/mysql v1.7.1
16-
github.com/gomodule/redigo v1.8.9
7+
github.com/aws/aws-sdk-go v1.53.14
8+
github.com/beevik/ntp v1.3.1
9+
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874
10+
github.com/elazarl/goproxy v0.0.0-20231117061959-7cc037d33fb5
11+
github.com/elazarl/goproxy/ext v0.0.0-20231117061959-7cc037d33fb5
12+
github.com/fsouza/go-dockerclient v1.11.0
13+
github.com/go-ldap/ldap/v3 v3.4.8
14+
github.com/go-ole/go-ole v1.3.0
15+
github.com/go-sql-driver/mysql v1.8.1
16+
github.com/gomodule/redigo v1.9.2
1717
github.com/jessevdk/go-flags v1.5.0
18-
github.com/jmoiron/sqlx v1.3.5
18+
github.com/jmoiron/sqlx v1.4.0
1919
github.com/lib/pq v1.10.9
2020
github.com/mackerelio/checkers v0.2.0
21-
github.com/mackerelio/go-osstat v0.2.4
21+
github.com/mackerelio/go-osstat v0.2.5
2222
github.com/mackerelio/golib v1.2.1
2323
github.com/mattn/go-encoding v0.0.2
2424
github.com/mattn/go-zglob v0.0.4
2525
github.com/miekg/dns v1.1.50
2626
github.com/natefinch/atomic v1.0.1
27-
github.com/shirou/gopsutil/v3 v3.23.10
28-
github.com/stretchr/testify v1.8.4
27+
github.com/shirou/gopsutil/v3 v3.24.5
28+
github.com/stretchr/testify v1.9.0
2929
github.com/tatsushid/go-fastping v0.0.0-20160109021039-d7bb493dee3e
30-
golang.org/x/crypto v0.19.0
31-
golang.org/x/sys v0.17.0
32-
golang.org/x/text v0.14.0
30+
golang.org/x/crypto v0.24.0
31+
golang.org/x/sys v0.21.0
32+
golang.org/x/text v0.16.0
3333
)
3434

3535
require (
36+
filippo.io/edwards25519 v1.1.0 // indirect
3637
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
37-
github.com/Azure/go-ntlmssp v0.0.0-20220621081337-cb9428e4ac1e // indirect
38-
github.com/Microsoft/go-winio v0.6.0 // indirect
39-
github.com/containerd/containerd v1.6.18 // indirect
38+
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
39+
github.com/Microsoft/go-winio v0.6.1 // indirect
40+
github.com/containerd/containerd v1.6.26 // indirect
41+
github.com/containerd/log v0.1.0 // indirect
4042
github.com/davecgh/go-spew v1.1.1 // indirect
41-
github.com/docker/docker v23.0.0+incompatible // indirect
43+
github.com/docker/docker v25.0.5+incompatible // indirect
4244
github.com/docker/go-connections v0.4.0 // indirect
4345
github.com/docker/go-units v0.5.0 // indirect
44-
github.com/go-asn1-ber/asn1-ber v1.5.4 // indirect
46+
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
4547
github.com/gogo/protobuf v1.3.2 // indirect
48+
github.com/google/uuid v1.6.0 // indirect
4649
github.com/jmespath/go-jmespath v0.4.0 // indirect
47-
github.com/klauspost/compress v1.11.13 // indirect
50+
github.com/klauspost/compress v1.15.9 // indirect
4851
github.com/kr/text v0.2.0 // indirect
49-
github.com/moby/patternmatcher v0.5.0 // indirect
52+
github.com/moby/patternmatcher v0.6.0 // indirect
5053
github.com/moby/sys/sequential v0.5.0 // indirect
54+
github.com/moby/sys/user v0.1.0 // indirect
5155
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
5256
github.com/morikuni/aec v1.0.0 // indirect
5357
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
5458
github.com/opencontainers/go-digest v1.0.0 // indirect
55-
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect
56-
github.com/opencontainers/runc v1.1.2 // indirect
59+
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect
5760
github.com/pkg/errors v0.9.1 // indirect
5861
github.com/pmezard/go-difflib v1.0.0 // indirect
5962
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
60-
github.com/sirupsen/logrus v1.8.1 // indirect
61-
github.com/yusufpapurcu/wmi v1.2.3 // indirect
62-
golang.org/x/mod v0.8.0 // indirect
63-
golang.org/x/net v0.17.0 // indirect
64-
golang.org/x/tools v0.6.0 // indirect
63+
github.com/sirupsen/logrus v1.9.3 // indirect
64+
github.com/yusufpapurcu/wmi v1.2.4 // indirect
65+
golang.org/x/mod v0.17.0 // indirect
66+
golang.org/x/net v0.25.0 // indirect
67+
golang.org/x/sync v0.7.0 // indirect
68+
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
6569
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
6670
gopkg.in/yaml.v3 v3.0.1 // indirect
6771
)

0 commit comments

Comments
 (0)