Ubuntu client's added on icinga2 web via icinga2 api

i have installed 20-25 servers in my icinga2 server using API. used a set of templates and all have showing the metrics but all the servers are showing same metrics
example
server 1 Disk = free ok DISK OK - free space: / 18704 MB (38% inode=28%):





server 25 Disk = free ok DISK OK - free space: / 18704 MB (38% inode=28%):
same goes with load average etc too.

1.)why this is happening? how i can use api to install clients fastly and get correct values for each metric

2.) for using api what is to be installed on ubuntu client server? does it require icinga2 to be installed? etc need list to verify what are the actually requirements for clients to work properly.

This sounds like you have set the command_endpoint to be the master Icinga
server instead of each of the monitored clients.

That means the master Icinga server is monitoring itself and nothing is
monitoring the client machines.

Show us at least some parts of your configuration files and we might be able to
point out where the problem is. Suggestions for what might be helpful:

a) zones.conf on the master and at least one client

b) the service check definition for at least one service which is behaving as
described

c) any output you can find in /var/log/icinga2/icinga2.log, on one of the
client machines, relating to a service check actually being performed

Regards,

Antony.

@Pooh
Thanks for replying
here what curl api command i ran

HOST=ip_of_client_machine
IP=ip_address_of_client_machine
localhost=this_was_icinga2_monitoring_server_localhost

A=`curl -k -s -u username:password -H ‘Accept: application/json’ \

-X PUT ‘https://localhost:5665/v1/objects/hosts/’$HOST-$IP’’ \

-d ‘{ “templates”: [ “generic-hostalive” ], “attrs”: { “address”: "’$IP’", “check_command”: “hostalive”, “vars.os” : “Linux” }, “pretty”: true }’`

echo $A

then it added all servers on icinga server. so i guess you are right it was pointing to icinga2 monitoring server itself.

few Questions:
1.) what things to be configured at both client and server end.
2.) what curl command should be running on client so that it pop up on icinga2 web dashboard with actual its own metrics etc ?

For agent based monitoring like you’re attempting here, the clients running the Icinga agent need to have zone and endpoint objects as well, and then the services should specify the command endpoint as being the client rather than the master.

This may sound like a mouthful, but try getting a few servers working the manual way in the configuration and then look at automation for all the host and service variables you need from there.

https://icinga.com/docs/icinga2/latest/doc/06-distributed-monitoring/

@blakehartshorn thanks for reply
i followed the link you shared
agent machine setup using icinga2 node wizard followed the complete setup but on master log i am getting below error:

New client connection for identity ‘agent_ip’ from [x.x.x.x]:51476 (no Endpoint object found for identity)

[2020-04-23 23:11:58 +0000] information/IdoMysqlConnection: Query queue items: 1, query rate: 2.91667/s (175/min 878/5min 1073/15min);

[2020-04-23 23:12:00 +0000] information/JsonRpcConnection: No messages for identity ‘ip’ have been received in the last 60 seconds.

[2020-04-23 23:12:00 +0000] warning/JsonRpcConnection: API client disconnected for identity ‘agent_ip’

[2020-04-23 23:12:00 +0000] warning/JsonRpcConnection: API client disconnected for identity ‘agent_ip’

on client i am getting:
[2020-04-23 23:15:37 +0000] warning/JsonRpcConnection: API client disconnected for identity ‘master_zone_dns_name’

[2020-04-23 23:15:37 +0000] information/JsonRpcConnection: No messages for identity ‘master_zone_name’ have been received in the last 60 seconds.

[2020-04-23 23:15:37 +0000] warning/JsonRpcConnection: API client disconnected for identity ‘master_zone_name’

[2020-04-23 23:15:42 +0000] information/JsonRpcConnection: Reconnecting to API endpoint ‘master_fqdb’ via host ‘master_ip’ and port ‘5665’

[2020-04-23 23:15:42 +0000] information/ApiListener: New client connection for identity ‘master_zone_name’

i have added zones info as per you shared in your message into client (zone and agent )and master(zone and agent ) both. then i restarted master icinga2 and hostname was showing in icingaweb dashboard. and on other hand i was getting above logs on both master and agent.

i removed master and agent ca certificates too and generated them again. but no benefit same above error