Icingaweb2 doesn't show the results of checks run from shell

Hi there,

I’m pretty new to icinga and monitoring at all, please be patient with me. :slight_smile:
I hope this is the correct category for this problem/question.
I’ve come across an issue where I can’t find ressources to guide me towards a solution.

The problem I run into is that if I run checks via icinga server on a remote host, the results are as expected. BUT it doesn’t show the results on the icingaweb2 page, i.e. either it shows a standard “OK” or “UNKNOWN” state, even though the check returns “Critical” or whatever.
Further it’s not on every host that’s running the mentioned checks, which complicates the issue even more.

The even more fun part of this issue is, that there is an old deprecated icingaweb2 server which shows the results perfectly.

The command run via icinga server and it’s result which should also be viewable on icingaweb:

usr@icinga: /usr/lib/nagios/plugins/check_nrpe -H x.x.x.x -c check_service_xyz
Service XYZ is Running!
 . . . . . . . . . . . . . . . . . . . . . . . . . . .

Resource                 Resource State
--------                       --------------
Service XYZ             Running

On another check, there should be a critical result, but on icingaweb the status is “OK” and the result is shown as:

I (0.4.4.19 2015-12-08) seem to be doing fine...

Things that may help to circle the problem:
Since it’s an custom check I modified the output to return the nrpe arguments, but icingaweb only shows empty variables i.e. “$”, on the deprecated icingaweb or when run from shell it shows the arguments as expected.

That seemed really odd to me and I can’t put my finger on it why that happens

Any guesses why that happens?

I’m thankfull for every hint, because this issue is driving me nuts.

Thank you all and kind regards,
Markus

Hi @mawolff

some questions:

How do you know it returns ‘critical’? Did you test it locally? Keep in mind that icinga2 is run as another user (nagios or icinga depending on your distribution). You can try to test the plugin script with:

sudo -u nagios /path/to/script -H x.x.x.x -c ...
# or
sudo -u icinga /path/to/script -H x.x.x.x -c ...

Do the old and the new icingaweb2 instances connect to the same icinga2 instance?

Can you show us the service and command definition for the check?

Kind regards

1 Like

Hi @ritzgu

thank you for your reply, and sorry for my late reply.
You led me to a solution, after revisiting the command and service definitions I could finally fix this behavior.

Somehow the definitions from the old system didn’t work reliably on the new one and had to be slightly changed.
On the old system the definitions worked with a simple

apply = true

which i now changed to:

apply: identifier => config in vars.check

It’s now showing the correct results in icingaweb2.

Kind regards,
Markus

1 Like