I have been using the http service for 1 year (example live.valami.hu). Today we added 2 subdomains (test.valami.hu and dfg.valami.hu) to the monitored server (nginx). Since then, the following error message appears on the icinga2 web: HTTP CRITICAL: HTTP/1.1 502 Bad Gateway. If I try check_http --ssl -H web_address in the console, I get HTTP OK: HTTP/1.1 200 OK. I realized that if I enter an ip address, I get the error message, so check_http --ssl -I 213.253.210.180.
The reason for this is that these two subdomains are not yet issuing a valid website because a developer application is sending the 502 code.
However, in Icinga2âs config, I do not enter ip, but the working web address, which is currently used by the operators, but according to them, Icinga2 can still monitor ip, or I donât know what is going on in the background.
My config:
- Server host config:
object Zone âserver nameâ {
endpoints = [ âserver nameâ ]
parent = âmasterâ
}
object Endpoint âserver nameâ {
host = âip addressâ
}
object Host âserver nameâ {
import âgeneric-hostâ
display_name = âNGINX1â
vars.os = âLinuxâ
groups = [ âlinux-serversâ ]
address = âip addressâ
vars.http_vhosts[âhttpâ] = {
http_uri = â/â
}
vars.client_endpoint = name
}
- service config:
apply Service âhttpâ {
check_command = âhttpâ
command_endpoint = host.vars.client_endpoint
vars.http_address = âlive.valami.huâ
vars.http_ssl = âtrueâ
// vars += config
assign where host.name == âserver nameâ
}
Whats wrong?
Version used (icinga2 --version
): The Icinga 2 network monitoring daemon (version: r2.13.5-1)
- Operating System and version: Debian 11.5
- Enabled features (
icinga2 feature list
): api checker ido-mysql mainlog notification - Icinga Web 2 version and modules (System - About): 2.9.6 loaded module monitoring 2.9.6
- Config validation (
icinga2 daemon -C
):
root@icinga2:/usr/lib/nagios/plugins# icinga2 daemon -C
[2022-10-21 12:10:54 +0200] information/cli: Icinga application loader (version: r2.13.5-1)
[2022-10-21 12:10:54 +0200] information/cli: Loading configuration file(s).
[2022-10-21 12:10:54 +0200] information/ConfigItem: Committing config item(s).
[2022-10-21 12:10:54 +0200] information/ApiListener: My API identity: icinga2.telemedia.cc
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 1 IcingaApplication.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 3 HostGroups.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 15 Hosts.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 1 FileLogger.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 1 CheckerComponent.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 104 Notifications.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 18 Zones.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 16 Endpoints.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 1 ApiUser.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 1 ApiListener.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 1 NotificationComponent.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 245 CheckCommands.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 4 UserGroups.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 10 ServiceGroups.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 3 Users.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 89 Services.
[2022-10-21 12:10:54 +0200] information/ConfigItem: Instantiated 4 NotificationCommands.
[2022-10-21 12:10:54 +0200] information/ScriptGlobal: Dumping variables to file â/var/cache/icinga2/icinga2.varsâ
[2022-10-21 12:10:54 +0200] information/cli: Finished validating the configuration file(s).