Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
teutat3s committed Nov 6, 2024
2 parents 0104e28 + df4dde4 commit 54acc90
Show file tree
Hide file tree
Showing 12 changed files with 301 additions and 150 deletions.
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Changelog

## 0.47.0 (2024-06-12)

* return CRITICAL instead of UNKNOWN when check-redis reachable is failed #865 (kmuto)
* Bump the golang-x group with 3 updates #863 (dependabot[bot])
* use go 1.22.x on build phase #862 (lufia)
* update dependencies #861 (lufia)
* [check-mailq] fix pattern #857 (lufia)
* Bump github.com/docker/docker from 25.0.4+incompatible to 25.0.5+incompatible #839 (dependabot[bot])


## 0.46.3 (2024-04-23)

* Revert "Bump github.com/miekg/dns from 1.1.50 to 1.1.59" #840 (ne-sachirou)
* Bump github.com/go-ldap/ldap/v3 from 3.4.4 to 3.4.8 #838 (dependabot[bot])
* Bump github.com/miekg/dns from 1.1.50 to 1.1.59 #837 (dependabot[bot])
* Bump golang.org/x/net from 0.17.0 to 0.23.0 #836 (dependabot[bot])
* Fix: check-log panic with invalid memory address or nil pointer dereference #834 (ne-sachirou)
* Bump the golang-x group with 2 updates #833 (dependabot[bot])
* Bump github.com/docker/docker from 23.0.0+incompatible to 24.0.9+incompatible #831 (dependabot[bot])
* Bump github.com/fsouza/go-dockerclient from 1.9.4 to 1.11.0 #830 (dependabot[bot])
* Bump mackerelio/workflows from 1.0.2 to 1.1.0 #828 (dependabot[bot])
* Bump the testlibs group with 1 update #827 (dependabot[bot])
* Bump github.com/opencontainers/runc from 1.1.2 to 1.1.12 #819 (dependabot[bot])
* Bump actions/cache from 3 to 4 #817 (dependabot[bot])
* Bump github.com/beevik/ntp from 0.3.0 to 1.3.1 #812 (dependabot[bot])
* Bump github.com/containerd/containerd from 1.6.18 to 1.6.26 #810 (dependabot[bot])
* Bump actions/upload-artifact from 3 to 4 #808 (dependabot[bot])
* Bump actions/download-artifact from 3 to 4 #807 (dependabot[bot])
* Bump actions/setup-go from 4 to 5 #806 (dependabot[bot])
* Bump github.com/go-ole/go-ole from 1.2.6 to 1.3.0 #779 (dependabot[bot])


## 0.46.2 (2024-02-27)

* Reduce check-log errors when a file in the log directory has been removed at the moment of running check-log #823 (ne-sachirou)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = 0.46.2
VERSION = 0.47.0
CURRENT_REVISION = $(shell git rev-parse --short HEAD)
ifeq ($(OS),Windows_NT)
GOPATH_ROOT:=$(shell cygpath ${GOPATH})
Expand Down
3 changes: 3 additions & 0 deletions check-log/lib/check-log.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,9 @@ func findFileByInode(inode uint, dir string) (string, error) {
if err != nil && !errors.Is(err, os.ErrNotExist) {
return "", err
}
if fi == nil {
continue
}
if detectInode(fi) == inode {
return filepath.Join(dir, fi.Name()), nil
}
Expand Down
2 changes: 1 addition & 1 deletion check-mailq/lib/check_mailq.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func run(args []string) *checkers.Checker {
outs := strings.Split(string(out), "\n")
line := outs[len(outs)-2]

re := regexp.MustCompile(`-- \d+ Kbytes in (\d+) Requests.`)
re := regexp.MustCompile(`-- \d+ Kbytes in (\d+) (?:Request|Requests)\.`)
if re.MatchString(line) {
queueStr = re.ReplaceAllString(line, "$1")
queue, err = strconv.ParseInt(queueStr, 10, 64)
Expand Down
2 changes: 1 addition & 1 deletion check-redis/lib/check-redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func checkReachable(args []string) *checkers.Checker {

c, info, err := connectRedisGetInfo(opts)
if err != nil {
return checkers.Unknown(err.Error())
return checkers.Critical(err.Error())
}
defer c.Close()

Expand Down
8 changes: 8 additions & 0 deletions check-redis/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ password=passpass
port=16379
image=redis:5

RET=$($plugin reachable --port $port --password $password)
# check-redis should return CRITICAL (exit code 2) when the server is unreachable
if [ $? -ne 2 ]; then
echo "$prog: $plugin returned $? (2 is expected)" >&2
exit 2
fi
echo "$RET"

docker run --name "test-$plugin" -p "$port:6379" -d "$image" --requirepass "$password"
trap 'docker stop test-$plugin; docker rm test-$plugin; exit' EXIT
sleep 10
Expand Down
68 changes: 36 additions & 32 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,67 +1,71 @@
module github.com/mackerelio/go-check-plugins

go 1.20
go 1.22.3

require (
github.com/StackExchange/wmi v1.2.1
github.com/aws/aws-sdk-go v1.47.9
github.com/beevik/ntp v0.3.0
github.com/bradfitz/gomemcache v0.0.0-20221031212613-62deef7fc822
github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819
github.com/elazarl/goproxy/ext v0.0.0-20221015165544-a0805db90819
github.com/fsouza/go-dockerclient v1.9.4
github.com/go-ldap/ldap/v3 v3.4.4
github.com/go-ole/go-ole v1.2.6
github.com/go-sql-driver/mysql v1.7.1
github.com/gomodule/redigo v1.8.9
github.com/aws/aws-sdk-go v1.53.14
github.com/beevik/ntp v1.3.1
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874
github.com/elazarl/goproxy v0.0.0-20231117061959-7cc037d33fb5
github.com/elazarl/goproxy/ext v0.0.0-20231117061959-7cc037d33fb5
github.com/fsouza/go-dockerclient v1.11.0
github.com/go-ldap/ldap/v3 v3.4.8
github.com/go-ole/go-ole v1.3.0
github.com/go-sql-driver/mysql v1.8.1
github.com/gomodule/redigo v1.9.2
github.com/jessevdk/go-flags v1.5.0
github.com/jmoiron/sqlx v1.3.5
github.com/jmoiron/sqlx v1.4.0
github.com/lib/pq v1.10.9
github.com/mackerelio/checkers v0.2.0
github.com/mackerelio/go-osstat v0.2.4
github.com/mackerelio/go-osstat v0.2.5
github.com/mackerelio/golib v1.2.1
github.com/mattn/go-encoding v0.0.2
github.com/mattn/go-zglob v0.0.4
github.com/miekg/dns v1.1.50
github.com/natefinch/atomic v1.0.1
github.com/shirou/gopsutil/v3 v3.23.10
github.com/stretchr/testify v1.8.4
github.com/shirou/gopsutil/v3 v3.24.5
github.com/stretchr/testify v1.9.0
github.com/tatsushid/go-fastping v0.0.0-20160109021039-d7bb493dee3e
golang.org/x/crypto v0.19.0
golang.org/x/sys v0.17.0
golang.org/x/text v0.14.0
golang.org/x/crypto v0.24.0
golang.org/x/sys v0.21.0
golang.org/x/text v0.16.0
)

require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20220621081337-cb9428e4ac1e // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/containerd/containerd v1.6.18 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/containerd/containerd v1.6.26 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/docker v23.0.0+incompatible // indirect
github.com/docker/docker v25.0.5+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.4 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/compress v1.11.13 // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/moby/patternmatcher v0.5.0 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect
github.com/opencontainers/runc v1.1.2 // indirect
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/tools v0.6.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 54acc90

Please sign in to comment.