Page 1 of 1

Kubernetes Check, WEB check not working

Posted: Tue Jun 06, 2023 5:07 pm
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

Re: Kubernetes Check, WEB check not working

Posted: Thu Jun 08, 2023 10:00 pm
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.