Kubernetes Check, WEB check not working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
bancoatlas
Posts: 2
Joined: Tue Feb 25, 2020 9:19 am

Kubernetes Check, WEB check not working

Post by bancoatlas »

Hi there.

I'm facing a situation while trying to monitor a simple check regarding Kubernetes. So, here's what's happening: I configured a command and logged into my Azure account. When I run the command via CLI, whether logged in as root or as nagios, I receive a good response. Here are the outputs I get:

As root:

Code: Select all

[root@v-svr /]# ./usr/local/nagios/libexec/check_kube_nodes.sh
OK - Kubernetes nodes all OK
As nagios:

Code: Select all

[nagios@v-svr /]$ ./usr/local/nagios/libexec/check_kube_nodes.sh
OK - Kubernetes nodes all OK
However, the problem arises when I try to run the same command through Nagios Web. I don't receive any response there. The error message displayed on the Nagios Dashboard is as follows:

Error Message on Nagios Dashboard

Code: Select all

CRITICAL - unable to connect to Kubernetes via kubectl!
Moreover, when I run the check command through CCM (Nagios Web), here's the output I get:
CCM Run Check Command

Code: Select all

[nagios@v-svr.something.com.jp ~]$ /usr/local/nagios/libexec/check_kube_nodes.sh
BLANK RESULT
Can you please assist me with this issue?

Thank very much in advance

Command used to check kubernetes:
github.com/colebrooke/kubernetes-nagios
kg2857
Posts: 233
Joined: Wed Apr 12, 2023 5:48 pm

Re: Kubernetes Check, WEB check not working

Post by kg2857 »

Manually running a check via ccm runs it as apache or some other user. Running it from the nagios scheduler runs as nagios.
Post Reply