Check_HTTP nagios plugin gives different results for same server

Version: CMK 2.0.0p24 CRE

Situation:
If i run a check_http on the command line of the checkMK server, I get below outcome (both with and without SSL)

If I run the same settings on the web interface

Where can I find what command CheckMK actually uses behind the webinterface so I can check both are equal?
What is going on here?

Ok, I found it, after posting here, so I’ll share the solution.
The webserver was set to receive only requests coming in on the specific name of that website (which is good practise)
So there was a difference between entering hostname and entering the IP address in the form in CheckMK’s webserver.
It turns out, I need to use the ‘virtual host’ option and leave the ‘hostname’ blank (I didn’t know that was an option)

Yes, not setting “virtual host” is a common pitfall in http checks.

To address your initial question: You can find the check command when display the service details (in Monitoring, not in Setup). Look for the “Service check command”, starting with check_mk_active-http!

This corresponds to ~/lib/nagios/plugins/check_http followed by the same command line arguments you see in the service check command (macros like '$_HOSTADDRESS_4$' expanded, of course).

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.