check-rancher

command module
v2.0.0-...-779d152 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2021 License: MIT Imports: 9 Imported by: 0

README

build GoDoc codecov

Check-Rancher

It's a general purpose to monitore Rancher plateform with external monitoring tools like Nagios, Centreon, Shinken, Sensu, etc.

The following program must be called by your monitoring tools and it return the status (nagios status normalization) with human messages and some times perfdatas. This program called Rancher API to compute the state of your Rancher plateform.

You can use it to monitore the following bloc or your Rancher2 plateform:

  • snapshot: ETCD backup state

Contribute

Your PR are welcome, but please use 2.x branch and not the master branch. You can open issues or enhance ;)

Usage

Global parameters

You need to set the Rancher API informations for all checks.

./check-rancher --url https://rancher.company.com --access-key my-key --secret-key ... 

You need to specify the following parameters:

  • --url: It's your rancher URL. If you use https with enterprise PKI, you need to add your enterprise CA in the host certificate store or disable the certificate check.
  • --access-key: It's the rancher API key that you have generated from Rancher UI
  • --secret-key: It's the secret associated to your API key.
Check snapshot (ETCD backup)

You can check that the last backup is OK and not older than.

You need to lauch the following command:

./check-rancher --url https://rancher.company.com --access-key my-key --secret-key check-snapshot --cluster-name my-k8s-cluster max-older-than 24h

You need to specify the following parameters:

  • --cluster-name: The kubernetes cluster managed by rancher where you should to check ETCD backups.
  • --max-older-then: The maxiumum duration the last backup can be not older than. Default to 24h.

This check follow this logic:

  • OK when last backup is OK and not older than
  • CRITICAL when last backup is KO, or older than or no backup

It's return the following perfdata:

  • nbBackupOk: the number of backup on active state
  • nbBackupFailed: the number of backup failed

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL