go-check-plugins

repository·master·Indexed 42 days ago

https://github.com/mackerelio/go-check-plugins

A collection of monitoring plugins written in Go for use with Mackerel to perform custom checks on system metrics and services. Includes plugins such as check-aws-cloudwatch-logs, check-aws-sqs-queue-size, check-cert-file, check-disk, check-dns, check-elasticsearch, and check-file-age.

Tokens
26.9K
Snippets
148
Records
161
Agent score
51%

What's inside go-check-plugins

  1. Understand check plugin exit status specifications

    master

    The check plugins follow a specification similar to Nagios and Sensu. The exit status returned by the plugin command determines the monitoring state in Mackerel:

    exit statusmeaning
    0OK
    1WARNING
    2CRITICAL
    other than 0, 1, or 2UNKNOWN
  2. Use check-masterha subcommands

    master

    The check-masterha tool provides three main subcommands to monitor different aspects of MasterHA:

    • status: Checks the overall status (wraps masterha_check_status).
    • repl: Checks replication status (wraps masterha_check_repl).
    • ssh: Checks SSH connectivity (wraps masterha_check_ssh).
    check-masterha status --all
    check-masterha repl --conf /path/to/masterha_cluster.cnf
    check-masterha ssh --conf /path/to/masterha_cluster.cnf
  3. Install check-masterha

    master

    You can install check-masterha by building it from source using Go or by installing the official Mackerel package.

    To build from source:

    1. Fetch the repository.
    2. Navigate to the check-masterha directory within the repository.
    3. Run go install.
    go get github.com/mackerelio/go-check-plugins
    cd $(go env GOPATH)/src/github.com/mackerelio/go-check-plugins/check-masterha
    go install
  4. Install the check-uptime plugin

    master

    You can install the check-uptime plugin by building it from source using Go, or by installing the official Mackerel package for your operating system.

    To build from source:

    1. Fetch the repository.
    2. Navigate to the check-uptime directory within your GOPATH.
    3. Run go install.
    go get github.com/mackerelio/go-check-plugins
    cd $(go env GOPATH)/src/github.com/mackerelio/go-check-plugins/check-uptime
    go install
  5. Install the check-http plugin

    master

    You can install the check-http plugin either by building it from the source repository or by using official Mackerel packages.

    To build from source, navigate to the check-http directory within the go-check-plugins repository and run go install.

    go get github.com/mackerelio/go-check-plugins
    cd $(go env GOPATH)/src/github.com/mackerelio/go-check-plugins/check-http
    go install
  6. Install check-jmx-jolokia

    master

    You can install check-jmx-jolokia by building it from source using Go, or by installing the official Mackerel package.

    To build from source:

    1. Fetch the repository.
    2. Navigate to the check-jmx-jolokia directory within the repository.
    3. Run go install.
    go get github.com/mackerelio/go-check-plugins
    cd $(go env GOPATH)/src/github.com/mackerelio/go-check-plugins/check-jmx-jolokia
    go install
  7. Install check-windows-eventlog

    master

    You can install the check-windows-eventlog plugin using two methods:

    Method 1: Build from source

    Use go install within the plugin directory:

    go get github.com/mackerelio/go-check-plugins
    cd $(go env GOPATH)/src/github.com/mackerelio/go-check-plugins/check-windows-eventlog
    go install

    Method 2: Mackerel Agent MSI package

    If you install the mackerel-agent using the MSI package on Windows, this plugin is included automatically in the installation folder.

    go get github.com/mackerelio/go-check-plugins
    cd $(go env GOPATH)/src/github.com/mackerelio/go-check-plugins/check-windows-eventlog
    go install
  8. Install check-mysql

    master

    You can install check-mysql by building it from source using Go, or by using official Mackerel packages.

    To build from source:

    1. Fetch the repository.
    2. Navigate to the check-mysql directory within the repository.
    3. Run go install.

    Alternatively, use the official Mackerel package installation method described in the Mackerel documentation.

    go get github.com/mackerelio/go-check-plugins
    cd $(go env GOPATH)/src/github.com/mackerelio/go-check-plugins/check-mysql
    go install
  9. Install the check-file-size plugin

    master

    You can install the check-file-size plugin by building it from source using Go, or by installing the official Mackerel package via your OS package manager.

    To build from source:

    1. Fetch the repository.
    2. Navigate to the check-file-size directory within your GOPATH.
    3. Run go install.
    go get github.com/mackerelio/go-check-plugins
    cd $(go env GOPATH)/src/github.com/mackerelio/go-check-plugins/check-file-size
    go install