Hi Icinga Team,
my icinga installation is HA Master <=> Master with a number of satellites.
Icinga2 latest (version: 2.11.4-1)
I created a new host using the API and directed the request to a satellite icinga instance.
The curl request was initiated from a node in a zone that cannot reach the master directly, but it can reach the satellite.
Here is the curl request to the API:-
curl -k -s -u 'user-name:password' -H 'Accept: application/json' \
-X PUT 'https://satellite01.somedomain.net:5665/v1/objects/hosts/pgApiTest2FromSat.testdomain' \
-d '{ "templates": [ "K8S Kube Icinga" ], "attrs": { "address": "192.168.5.1", "check_command": "hostalive", "vars.os" : "Linux" }, "pretty": true }'
{
"results": [
{
"code": 200.0,
"status": "Object was created"
}
]
}
Successfull creation of the host!
But wait… The host never turns up in the Icingaweb2 UI?
Also, the IP address I gave it will fail the ‘hostalive’ check, This was intentional to see if I get an alert.
So after a successfull creation of a new host that should now be alerting, I see nothing in my Icingaweb2 UI, no node, no alerts?
As a final check to see if the node was really created I called for a list of hosts from the satellite node.
curl -k -u "username:password" https://https://satellite01.somedomain.net:5665/v1/objects/hosts?attrs=address
{"results":[
...OTHER HOSTS REMOVED FOR BREVITY..
{"attrs":{"address":"192.168.1.1"},"joins":{},"meta":{},"name":"pgApiTestFromSat.localdomain","type":"Host"}]}
So the host is being reported as present.
The status now is.
-
A new host has been created.
-
The new host is not reporting any errors (although its IP address is not reachable for the ‘hostalive’ check)
-
The new host does not appear anywhere on IcingaWeb2
-
A host exists in our Icinga monitoring system that does not appear or alert?
Icinga Web 2 Version 2.8.1
Git commit 233bd29e4104125b4e5ef631e8c16dde33dadd9a
PHP Version 7.3.11
Git commit date 2020-06-29
Can any explain why the host never really gets created although it is present in the API
Thank you
Peter