Solutions provided by the OP5 Monitor Community for the benefit of other clients. These solutions or documents are NOT maintained, tested or supported by ITRS Client Services and just provided as they are written by the original submitter.
OP5 ships with the Kubernetes plugin check_k8s. This plugin has limited 'Best Effort' support, but would be preferred to the alternative 3rd party plugin described in the latter part of this document.
The bundled plugin is accessible via the Mange => Configure => Plugins GUI menu items.
The remainder of this document describes the use of a 3rd party Kubernetes Nagios compatible plugin that can be found at https://github.com/colebrooke/kubernetes-nagios. Additional information and updates for this plugin may be found at that GitHub site and should be used as this documentation is incomplete.
- The checks/plugins used are basic shell scripts that can be found on https://github.com/colebrooke/kubernetes-nagios/blob/master/README.md
- These scripts were downloaded to a server that has network access to our Demo Kubernetes cluster.
- These dependencies had to be installed on the server in order for the script to work:
- Kubectl ? used by the scripts to fetch metrics from the kubernetes cluster
- google-cloud-sdk ? used for authenticating and getting credentials. Gcloud also creates a kube_config file that is then passed on to the scripts.
- The scripts were copied to the /opt/plugins/custom and were given the appropriate rights.
- Once that is done, we need to configure the NRPE commands (the scripts can be used without NRPE directly on a poller or an OP5 server) on the server that will be used by our OP5 server. In this example, we are just executing the kube_scripts with no parameters. Using the default thresholds.
Add this block to your NRPE config. If you are not using NRPE, simply exclude everything before the "=" sign and use that as your command for the check.
-k <KUBE_CONFIG> # Path to kube config file, created when running gcloud.
command[check_kube_nodes]=/opt/plugins/custom/kubernetes-nagios/check_kube_nodes.sh -k /opt/plugins/custom/kubernetes-nagios/config
command[check_kube_deployments]=/opt/plugins/custom/kubernetes-nagios/check_kube_deployments.sh -k /opt/plugins/custom/kubernetes-nagios/config
command[check_kube_pods]=/opt/plugins/custom/kubernetes-nagios/check_kube_pods.sh -k /opt/plugins/custom/kubernetes-nagios/config
command[check_kubernetes_api]=/opt/plugins/custom/kubernetes-nagios/check_kubernetes_api.sh -k /opt/plugins/custom/kubernetes-nagios/config
Once that is configured on the server, we need to connect our OP5 server to our server with the Kubernetes scripts.