Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mackerelio/go-check-plugins
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.1
Choose a base ref
...
head repository: mackerelio/go-check-plugins
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 16,961 additions and 1,029 deletions.
  1. +26 −0 .github/dependabot.yml
  2. +40 −0 .github/workflows/create-release-pr.yml
  3. +94 −0 .github/workflows/test.yml
  4. +3 −0 .gitignore
  5. +21 −0 .golangci.yml
  6. +0 −32 .travis.yml
  7. +827 −0 CHANGELOG.md
  8. +84 −34 Makefile
  9. +66 −8 README.md
  10. +69 −0 check-aws-cloudwatch-logs/README.md
  11. +228 −0 check-aws-cloudwatch-logs/lib/check-aws-cloudwatch-logs.go
  12. +245 −0 check-aws-cloudwatch-logs/lib/check-aws-cloudwatch-logs_test.go
  13. +9 −0 check-aws-cloudwatch-logs/lib/check-aws-cloudwatch-logs_unix.go
  14. +7 −0 check-aws-cloudwatch-logs/main.go
  15. +55 −0 check-aws-sqs-queue-size/README.md
  16. +112 −0 check-aws-sqs-queue-size/lib/check-aws-sqs-queue-size.go
  17. +7 −0 check-aws-sqs-queue-size/main.go
  18. +53 −0 check-cert-file/README.md
  19. +60 −0 check-cert-file/lib/check-cert-file.go
  20. +32 −0 check-cert-file/lib/check-cert-file_test.go
  21. +7 −0 check-cert-file/main.go
  22. +58 −0 check-disk/README.md
  23. +6 −0 check-disk/UPDATE.md
  24. +352 −0 check-disk/lib/check-disk.go
  25. +60 −0 check-disk/lib/check-disk_test.go
  26. +7 −0 check-disk/main.go
  27. +16 −0 check-disk/test.sh
  28. +75 −0 check-dns/README.md
  29. +133 −0 check-dns/lib/check_dns.go
  30. +128 −0 check-dns/lib/check_dns_test.go
  31. +32 −0 check-dns/lib/nameserver.go
  32. +48 −0 check-dns/lib/nameserver_windows.go
  33. +7 −0 check-dns/main.go
  34. +51 −0 check-elasticsearch/README.md
  35. +76 −0 check-elasticsearch/lib/check_elasticsearch.go
  36. +7 −0 check-elasticsearch/main.go
  37. +43 −6 check-file-age/README.md
  38. +6 −4 check-file-age/{ → lib}/check_file_age.go
  39. +7 −0 check-file-age/main.go
  40. +14 −0 check-file-age/test.sh
  41. +53 −0 check-file-size/README.md
  42. +133 −0 check-file-size/lib/check_file_size.go
  43. +88 −0 check-file-size/lib/check_file_size_test.go
  44. 0 check-file-size/lib/test_dir/depth1/depth2/file3
  45. 0 check-file-size/lib/test_dir/depth1/file2
  46. 0 check-file-size/lib/test_dir/file1
  47. +7 −0 check-file-size/main.go
  48. +15 −0 check-file-size/test.sh
  49. +81 −4 check-http/README.md
  50. +0 −59 check-http/check_http.go
  51. +0 −14 check-http/check_http_test.go
  52. +399 −0 check-http/lib/check_http.go
  53. +388 −0 check-http/lib/check_http_test.go
  54. +7 −0 check-http/main.go
  55. +51 −0 check-http/test.sh
  56. +11 −0 check-http/testdata/index.html
  57. +58 −0 check-jmx-jolokia/README.md
  58. +95 −0 check-jmx-jolokia/lib/check_jmx_jolokia.go
  59. +7 −0 check-jmx-jolokia/main.go
  60. +57 −0 check-ldap/README.md
  61. +11 −0 check-ldap/UPDATE.md
  62. +85 −0 check-ldap/lib/check_ldap.go
  63. +81 −0 check-ldap/lib/check_ldap_test.go
  64. +7 −0 check-ldap/main.go
  65. +31 −0 check-ldap/test.sh
  66. +47 −6 check-load/README.md
  67. +0 −17 check-load/check_load_linux.go
  68. +16 −10 check-load/{ → lib}/check_load.go
  69. +1 −1 check-load/{ → lib}/check_load_darwin.go
  70. +25 −0 check-load/lib/check_load_linux.go
  71. +12 −0 check-load/lib/check_load_netbsd.go
  72. +8 −0 check-load/lib/check_load_windows.go
  73. +7 −0 check-load/main.go
  74. +129 −0 check-log/README.md
  75. +611 −0 check-log/lib/check-log.go
  76. +202 −0 check-log/lib/check-log_state_test.go
  77. +932 −0 check-log/lib/check-log_test.go
  78. +19 −0 check-log/lib/check-log_unix.go
  79. +174 −0 check-log/lib/check-log_unix_test.go
  80. +9 −0 check-log/lib/check-log_windows.go
  81. +1 −0 check-log/lib/testdata/invalid_json.json
  82. +1 −0 check-log/lib/testdata/old-state.txt
  83. +1 −0 check-log/lib/testdata/plain.txt
  84. +1 −0 check-log/lib/testdata/unexpected_json.json
  85. +7 −0 check-log/main.go
  86. +55 −0 check-mailq/README.md
  87. +117 −0 check-mailq/lib/check_mailq.go
  88. +7 −0 check-mailq/main.go
  89. +83 −0 check-masterha/README.md
  90. +148 −0 check-masterha/lib/check_masterha.go
  91. +55 −0 check-masterha/lib/check_masterha_repl.go
  92. +146 −0 check-masterha/lib/check_masterha_repl_test.go
  93. +41 −0 check-masterha/lib/check_masterha_ssh.go
  94. +100 −0 check-masterha/lib/check_masterha_ssh_test.go
  95. +45 −0 check-masterha/lib/check_masterha_status.go
  96. +36 −0 check-masterha/lib/check_masterha_status_test.go
  97. +113 −0 check-masterha/lib/check_masterha_test.go
  98. +30 −0 check-masterha/lib/mock/masterha.go
  99. +7 −0 check-masterha/main.go
  100. +54 −0 check-memcached/README.md
  101. +48 −0 check-memcached/lib/check-memcached.go
  102. +7 −0 check-memcached/main.go
  103. +26 −0 check-memcached/test.sh
  104. +138 −0 check-mysql/README.md
  105. +118 −0 check-mysql/lib/check-mysql.go
  106. +48 −0 check-mysql/lib/connection.go
  107. +50 −0 check-mysql/lib/readonly.go
  108. +132 −0 check-mysql/lib/replication.go
  109. +56 −0 check-mysql/lib/uptime.go
  110. +7 −0 check-mysql/main.go
  111. +39 −0 check-mysql/test-tls.sh
  112. +11 −0 check-mysql/test.sh
  113. +31 −0 check-mysql/test_57/docker-compose.yml
  114. +3 −0 check-mysql/test_57/docker-entrypoint-initdb.d/init.sql
  115. +91 −0 check-mysql/test_57/test.sh
  116. +31 −0 check-mysql/test_8/docker-compose.yml
  117. +2 −0 check-mysql/test_8/docker-entrypoint-initdb.d/init.sql
  118. +91 −0 check-mysql/test_8/test.sh
  119. +12 −0 check-mysql/wait.sh
  120. +56 −0 check-ntpoffset/README.md
  121. +254 −0 check-ntpoffset/lib/check-ntpoffset.go
  122. +169 −0 check-ntpoffset/lib/check-ntpoffset_test.go
  123. +7 −0 check-ntpoffset/main.go
  124. +54 −0 check-ntservice/README.md
  125. +87 −0 check-ntservice/lib/check_ntservice.go
  126. +11 −0 check-ntservice/lib/check_ntservice_others.go
  127. +139 −0 check-ntservice/lib/check_ntservice_test.go
  128. +16 −0 check-ntservice/lib/check_ntservice_windows.go
  129. +7 −0 check-ntservice/main.go
  130. +51 −0 check-ping/README.md
  131. +74 −0 check-ping/lib/check-ping.go
  132. +43 −0 check-ping/lib/check-ping_test.go
  133. +7 −0 check-ping/main.go
  134. +69 −0 check-postgresql/README.md
  135. +11 −0 check-postgresql/UPDATE.md
  136. +66 −0 check-postgresql/lib/check-postgresql.go
  137. +47 −0 check-postgresql/lib/connection.go
  138. +7 −0 check-postgresql/main.go
  139. +31 −0 check-postgresql/test.sh
  140. +68 −6 check-procs/README.md
  141. +0 −211 check-procs/check_procs.go
  142. +201 −0 check-procs/lib/check_procs.go
  143. +80 −0 check-procs/lib/check_procs_test.go
  144. +71 −0 check-procs/lib/check_procs_unix.go
  145. +39 −0 check-procs/lib/check_procs_windows.go
  146. +7 −0 check-procs/main.go
  147. +88 −0 check-redis/README.md
  148. +11 −0 check-redis/UPDATE.md
  149. +236 −0 check-redis/lib/check-redis.go
  150. +7 −0 check-redis/main.go
  151. +35 −0 check-redis/test.sh
  152. +60 −0 check-smtp/README.md
  153. +120 −0 check-smtp/lib/check-smtp.go
  154. +136 −0 check-smtp/lib/check-smtp_test.go
  155. +7 −0 check-smtp/main.go
  156. +61 −0 check-solr/README.md
  157. +61 −0 check-solr/lib/check_solr.go
  158. +44 −0 check-solr/lib/ping.go
  159. +7 −0 check-solr/main.go
  160. +58 −0 check-ssh/README.md
  161. +184 −0 check-ssh/lib/check-ssh.go
  162. +7 −0 check-ssh/main.go
  163. +57 −0 check-ssl-cert/README.md
  164. +108 −0 check-ssl-cert/lib/check-ssl-cert.go
  165. +172 −0 check-ssl-cert/lib/check-ssl-cert_test.go
  166. +7 −0 check-ssl-cert/main.go
  167. +71 −0 check-tcp/README.md
  168. +340 −0 check-tcp/lib/check-tcp.go
  169. +458 −0 check-tcp/lib/check-tcp_test.go
  170. +7 −0 check-tcp/main.go
  171. +55 −0 check-uptime/README.md
  172. +75 −0 check-uptime/lib/check-uptime.go
  173. +56 −0 check-uptime/lib/check-uptime_test.go
  174. +7 −0 check-uptime/main.go
  175. +102 −0 check-windows-eventlog/README.md
  176. +544 −0 check-windows-eventlog/lib/check-windows-eventlog.go
  177. +8 −0 check-windows-eventlog/lib/check-windows-eventlog_other.go
  178. +399 −0 check-windows-eventlog/lib/check_windows_eventlog_test.go
  179. +128 −0 check-windows-eventlog/lib/internal/eventlog/syscall_windows.go
  180. +125 −0 check-windows-eventlog/lib/internal/eventlog/zsyscall_windows.go
  181. +7 −0 check-windows-eventlog/main.go
  182. +73 −0 go.mod
  183. +271 −0 go.sum
  184. +77 −0 mackerel-check.go
  185. +130 −0 mackerel-check_gen.go
  186. +25 −1 packaging/config.json
  187. +1,002 −0 packaging/deb-v2/debian/changelog
  188. +1 −0 packaging/deb-v2/debian/compat
  189. +12 −0 packaging/deb-v2/debian/control
  190. +20 −0 packaging/deb-v2/debian/copyright
  191. +18 −0 packaging/deb-v2/debian/rules
  192. +1 −0 packaging/deb-v2/debian/source/format
  193. +1 −0 packaging/deb-v2/debian/source/include-binaries
  194. +0 −11 packaging/deb/debian/changelog
  195. +0 −9 packaging/deb/debian/control
  196. +0 −1 packaging/deb/debian/copyright
  197. +0 −16 packaging/deb/debian/rules
  198. BIN packaging/mackerel-check-plugins_0.48.0.orig.tar.gz
  199. +503 −0 packaging/rpm/mackerel-check-plugins-v2.spec
  200. +0 −44 packaging/rpm/mackerel-check-plugins.spec
  201. +32 −0 t/convention.t
  202. +23 −0 t/plugins.t
  203. +40 −0 test.bash
  204. +0 −99 tool/autotag
  205. +0 −29 tool/cover.sh
  206. +134 −0 tool/gen_mackerel_check.pl
  207. +61 −0 tool/packagize.pl
  208. +0 −391 tool/releng
  209. +0 −16 tool/travis/autotag.sh
  210. BIN tool/travis/go-check-plugins.pem.enc
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: weekly
time: "01:00"
timezone: Asia/Tokyo
open-pull-requests-limit: 10
groups:
golang/x:
patterns:
- "golang.org/x/*"
mackerelio:
patterns:
- "github.com/mackerelio/*"
testlibs:
patterns:
- "github.com/elazarl/goproxy*"
- "github.com/stretchr/testify"
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
time: "01:00"
timezone: Asia/Tokyo
40 changes: 40 additions & 0 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Create Release PR"
on:
workflow_dispatch:
inputs:
release_version:
description: "next release version"
required: true
env:
GIT_AUTHOR_NAME: mackerelbot
GIT_AUTHOR_EMAIL: mackerelbot@users.noreply.github.com
GIT_COMMITTER_NAME: mackerelbot
GIT_COMMITTER_EMAIL: mackerelbot@users.noreply.github.com

jobs:
create:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: mackerelio/mackerel-create-release-pull-request-action@main
id: start
with:
github_token: ${{ secrets.MACKERELBOT_GITHUB_TOKEN }}
next_version: ${{ github.event.inputs.release_version }}
package_name: mackerel-check-plugins
version_go_file_path: mackerel-check.go

- run: |
CURRENT=${{ steps.start.outputs.currentVersion }}
NEXT=${{ steps.start.outputs.nextVersion }}
mv packaging/mackerel-check-plugins_$CURRENT.orig.tar.gz packaging/mackerel-check-plugins_$NEXT.orig.tar.gz
- uses: mackerelio/mackerel-create-release-pull-request-action@main
with:
github_token: ${{ secrets.MACKERELBOT_GITHUB_TOKEN }}
finished: "true"
package_name: mackerel-check-plugins
next_version: ${{ steps.start.outputs.nextVersion }}
branch_name: ${{ steps.start.outputs.branchName }}
pull_request_infos: ${{ steps.start.outputs.pullRequestInfos }}
94 changes: 94 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
name: test

on:
push:
branches:
- master
tags:
- v*
pull_request:
env:
DEBIAN_FRONTEND: noninteractive
jobs:
lint:
uses: mackerelio/workflows/.github/workflows/go-lint.yml@v1.4.0
test:
uses: mackerelio/workflows/.github/workflows/go-test.yml@v1.4.0
test-linux:
uses: mackerelio/workflows/.github/workflows/setup-go-matrix.yml@v1.4.0
with:
run: |
./test.bash
make testconvention
os-versions: '["ubuntu-24.04"]'
test-windows:
uses: mackerelio/workflows/.github/workflows/setup-go-matrix.yml@v1.4.0
with:
run: |
go build -o check-log/check-log.exe ./check-log
go build -o check-procs/check-procs.exe ./check-procs
go build -o check-windows-eventlog/check-windows-evenglog.exe ./check-windows-eventlog
go build -o check-ntservice/check-ntservice.exe ./check-ntservice
go build -o check-disk/check-disk.exe ./check-disk
go build -o check-uptime/check-uptime.exe ./check-uptime
go build -o check-tcp/check-tcp.exe ./check-tcp
go build -o check-file-age/check-file-age.exe ./check-file-age
os-versions: '["windows-2022", "windows-2025"]' # When windows-2025 become stable, remove windows-2022
# TODO: use workflows repo
build:
needs: [test, test-linux]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
steps:
- run: |
sudo apt-get update
sudo apt-get install -y rpm devscripts debhelper fakeroot crossbuild-essential-arm64 build-essential
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/setup-go@v5
with:
go-version: 1.23.x
- uses: actions/checkout@v4
- run: make clean build rpm deb
- uses: actions/upload-artifact@v4
with:
name: linux-build-artifacts
path: |
~/rpmbuild/RPMS/*/*.rpm
packaging/*.deb
# TODO: use workflows repo
release:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
name: linux-build-artifacts
path: artifacts/
- uses: mackerelio/staging-release-update-action@main
if: github.ref == 'refs/heads/master'
with:
directory: artifacts/
github-token: ${{ secrets.GITHUB_TOKEN }}
tag: staging
- uses: mackerelio/create-release-action@main
if: startsWith(github.ref, 'refs/tags/v')
with:
directory: artifacts/
github-token: ${{ secrets.GITHUB_TOKEN }}
tag-prefix: "refs/tags/v"
bump-up-branch-prefix: "bump-version-"
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,commit,action,eventName,ref,workflow,job,took
username: go-check-plugins-release
env:
SLACK_WEBHOOK_URL: ${{ secrets.MACKEREL_SLACK_WEBHOOK_URL }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.*
!/.dependabot
!/.github
!.gitignore
!.goxc.json
!.travis.yml
/build
check-*/check-*
21 changes: 21 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
linters:
# Detected a number of cases that could not be handled after the switchover,
# TODO remove this rule.
disable:
- errcheck
- staticcheck
linters-settings:
govet:
enable-all: true
disable:
# Detected a number of cases that could not be handled after the switchover,
# TODO remove this rule.
- fieldalignment
- shadow
issues:
exclude-rules:
- path: _test\.go
linters:
- errcheck
- staticcheck
- ineffassign
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

Loading