Problem:
I have setup and configured Foreman plugin smart proxy for icinga monitoring according to the doc: https://github.com/theforeman/smart_proxy_monitoring. But I cannot see the configured hosts from Icinga in the Foreman dashboard.
I am able to use the configured api user “foreman” to run API calls with cURL on the server Foreman is installed. And also I can confirm that the results are non-empty, that’s to say there are hosts to query. Furthermore, the smart proxy creates a connection to the Icinga API and registers a listener (see output at the end).
example:
root@server1100:/etc/icinga2# curl -k -s -u foreman:*** 'https://10.35.147.100:5665/v1'
<html><head><title>Icinga 2</title></head><h1>Hello from Icinga 2 (Version: r2.8.4-1)!</h1><p>You are authenticated as <b>foreman</b>. Your user has the following permissions:</p> <ul><li>*</li></ul><p>More information about API requests is available in the <a href="https://docs.icinga.com/icinga2/latest" target="_blank">documentation</a>.</p></html>root@server1100:/etc/icinga2# curl -s -u foreman:foreman 'https://10.35.147.100:5665/v1'
I’m really lost on what to try next as both components seem to work by themselves but the connection seems off.
I would be greatful for any hints or additional tests I could run to circle in the issue.
Best regards, Nic
icinga and icingaweb
icinga2: r2.8.4-1
web: 2.5.3
Foreman and Proxy versions:
foreman_proxy: 1.17.1
Foreman and Proxy plugin versions:
foreman monitoring: 1.0.1
Other relevant data:
monitoring.yaml
:enabled: true
:use_provider:
- monitoring_icinga2
- monitoring_icingadirector
:collect_status: true
monitoring_icinga2.yaml:
:enabled: true
:server: server1100.cs.technik.fhnw.ch
# The CA certificate from icinga2 server
:api_cacert: /etc/foreman-proxy/monitoring/ca.crt
# The name of API User
:api_user: foreman
:api_password: ***
# SSL Verfification mode (boolean value)
:verify_ssl: false
output from proxy.log:
D, [2018-07-13T12:13:06.398754 ] DEBUG -- : 'monitoring' settings: 'collect_status': true (default), 'enabled': true, 'use_provider': ["monitoring_icinga2", "monitoring_icingadirector"]
D, [2018-07-13T12:13:06.398855 ] DEBUG -- : 'monitoring' ports: 'http': true, 'https': true
D, [2018-07-13T12:13:06.402602 ] DEBUG -- : 'tftp' settings: 'enabled': https, 'tftproot': /var/lib/tftpboot (default)
D, [2018-07-13T12:13:06.402674 ] DEBUG -- : 'tftp' ports: 'http': false, 'https': true
D, [2018-07-13T12:13:06.404527 ] DEBUG -- : 'puppetca' settings: 'autosignfile': /etc/puppetlabs/puppet/autosign.conf, 'enabled': https, 'ssldir': /etc/puppetlabs/puppet/ssl
D, [2018-07-13T12:13:06.404582 ] DEBUG -- : 'puppetca' ports: 'http': false, 'https': true
D, [2018-07-13T12:13:06.407636 ] DEBUG -- : 'puppet' settings: 'enabled': https, 'puppet_version': 5.5.2, 'use_provider': [:puppet_proxy_puppet_api]
D, [2018-07-13T12:13:06.407698 ] DEBUG -- : 'puppet' ports: 'http': false, 'https': true
D, [2018-07-13T12:13:06.409698 ] DEBUG -- : 'logs' settings: 'enabled': https
D, [2018-07-13T12:13:06.409754 ] DEBUG -- : 'logs' ports: 'http': false, 'https': true
D, [2018-07-13T12:13:06.409989 ] DEBUG -- : Providers ['monitoring_icinga2', 'monitoring_icingadirector'] are going to be configured for 'monitoring'
D, [2018-07-13T12:13:06.410058 ] DEBUG -- : Providers ['puppet_proxy_puppet_api'] are going to be configured for 'puppet'
D, [2018-07-13T12:13:06.415878 ] DEBUG -- : 'monitoring_icinga2' settings: 'api_cacert': /etc/foreman-proxy/monitoring/ca.crt, 'api_password': ***, 'api_port': 5665 (default), 'api_user': foreman, 'collect_status': true, 'enabled': t
rue, 'server': server1100.cs.technik.fhnw.ch, 'use_provider': ["monitoring_icinga2", "monitoring_icingadirector"], 'verify_ssl': false
D, [2018-07-13T12:13:06.418753 ] DEBUG -- : 'monitoring_icingadirector' settings: 'collect_status': true, 'director_cacert': /etc/foreman-proxy/monitoring/ca.crt, 'director_password': ***, 'director_url': https://server1100.cs.techni
k.fhnw.ch/icingaweb2/director, 'director_user': foreman, 'enabled': true, 'use_provider': ["monitoring_icinga2", "monitoring_icingadirector"], 'verify_ssl': false
D, [2018-07-13T12:13:06.423574 ] DEBUG -- : 'puppet_proxy_puppet_api' settings: 'api_timeout': 30 (default), 'classes_retriever': apiv3, 'environments_retriever': apiv3, 'puppet_ssl_ca': /etc/puppetlabs/puppet/ssl/certs/ca.pem, 'puppet_s
sl_cert': /etc/puppetlabs/puppet/ssl/certs/server1110.cs.technik.fhnw.ch.pem, 'puppet_ssl_key': /etc/puppetlabs/puppet/ssl/private_keys/server1110.cs.technik.fhnw.ch.pem, 'puppet_url': https://server1110.cs.technik.fhnw.ch:8140, 'puppet_
version': 5.5.2, 'use_provider': [:puppet_proxy_puppet_api]
D, [2018-07-13T12:13:06.424606 ] DEBUG -- : Starting initial icinga import.
I, [2018-07-13T12:13:06.424765 ] INFO -- : Successfully initialized 'monitoring_icinga2'
I, [2018-07-13T12:13:06.424864 ] INFO -- : Starting Task: Initial Host Import.
D, [2018-07-13T12:13:06.425754 ] DEBUG -- : Connecting to Icinga event monitoring api: https://server1100.cs.technik.fhnw.ch:5665/v1.
I, [2018-07-13T12:13:06.425901 ] INFO -- : Successfully initialized 'monitoring_icingadirector'
I, [2018-07-13T12:13:06.425966 ] INFO -- : Successfully initialized 'monitoring'
I, [2018-07-13T12:13:06.426030 ] INFO -- : Successfully initialized 'foreman_proxy'
I, [2018-07-13T12:13:06.460355 ] INFO -- : Icinga event api monitoring started.