# \[\[inputs.icinga2\]\] - Services object query - specify specfic host and service

**URL:** <https://community.influxdata.com/t/inputs-icinga2-services-object-query-specify-specfic-host-and-service/56793>\
**Category:** Telegraf\
**Tags:** telegraf, query\
**Created:** [March 18, 2025, 11:27pm UTC](https://community.influxdata.com/t/inputs-icinga2-services-object-query-specify-specfic-host-and-service/56793 "2025-03-18T23:27:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![samtommy](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@samtommy](https://community.influxdata.com/u/samtommy)\
**Post date:** [March 18, 2025, 11:27pm UTC](https://community.influxdata.com/t/inputs-icinga2-services-object-query-specify-specfic-host-and-service/56793/1 "2025-03-18T23:27:40Z")

</div>

Hello,

It looks like this plugin doesn’t query all services objects including hosts and their services. Is there a way to make it happen?

e.g. [https://testicinga.com:5665/v1/objects/services/host-name!icinga](https://testicinga.com:5665/v1/objects/services/host-name!icinga)

```auto
[[inputs.icinga2]]
  ## Required Icinga2 server address
  server = "https://testicinga.com:5665"

  ## Collected Icinga2 objects ("services", "hosts")
  ## Specify at least one object to collect from /v1/objects endpoint.
  # objects = ["services"]
  objects = ["services", "hosts"]

  ## Collect metrics from /v1/status endpoint
  ## Choose from:
  ## "ApiListener", "CIB", "IdoMysqlConnection", "IdoPgsqlConnection"
  # status = []
  status = ["ApiListener", "CIB", "IdoMysqlConnection"]

  ## Credentials for basic HTTP authentication
  username = "user"
  password = "pass"

```

Please advise,  
Thanks

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [March 20, 2025, 6:08pm UTC](https://community.influxdata.com/t/inputs-icinga2-services-object-query-specify-specfic-host-and-service/56793/2 "2025-03-20T18:08:29Z")

</div>

Hello @samtommy,  
Im confused, it should collect data from both object types  
since you correctly specified both services and hosts in the objects parameter. Are you finding that its not? Do you have any logs to share? Do you have the right version of telegraf (v1.26.0)? Do you have sufficient permissions?

> **[Telegraf release notes | Telegraf Documentation](https://docs.influxdata.com/telegraf/v1/release-notes/#features-7)**
>
> Important features and changes in the latest version of Telegraf.

---

<div class="post-metadata">

**Author:** ![samtommy](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@samtommy](https://community.influxdata.com/u/samtommy)\
**Post date:** [March 20, 2025, 10:00pm UTC](https://community.influxdata.com/t/inputs-icinga2-services-object-query-specify-specfic-host-and-service/56793/3 "2025-03-20T22:00:11Z")

</div>

Hi @Anaisdg Thank you for replying.

I’ve Telegraf v1.34 running. The user has all API permissions.

Ok, I think I was mistaken on the results returned for “objects”. Telegraf does provide the “status” of all of them. I was looking for “performance\_data” for services like “icinga”, “cluster” etc. Maybe it is not supported I guess. Please advise. Thank you.

```auto
{
                            "counter": false,
                            "crit": null,
                            "label": "num_services_problem",
                            "max": null,
                            "min": null,
                            "type": "PerfdataValue",
                            "unit": "",
                            "value": 0,
                            "warn": null
                        },
                        {
                            "counter": false,
                            "crit": null,
                            "label": "uptime",
                            "max": null,
                            "min": null,
                            "type": "PerfdataValue",
                            "unit": "",
                            "value": 517952.94497299194,
                            "warn": null
                        },
                        {
                            "counter": false,
                            "crit": null,
                            "label": "num_hosts_up",
                            "max": null,
                            "min": null,
                            "type": "PerfdataValue",
                            "unit": "",
                            "value": 8,
                            "warn": null
                        },

```

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [March 21, 2025, 4:55pm UTC](https://community.influxdata.com/t/inputs-icinga2-services-object-query-specify-specfic-host-and-service/56793/4 "2025-03-21T16:55:02Z")

</div>

Let me share your question with the telegraf team, I’m not sure.

---

<div class="post-metadata">

**Author:** ![srebhan](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/srebhan/32/8572_2.png) [@srebhan](https://community.influxdata.com/u/srebhan)\
**Post date:** [March 24, 2025, 9:53am UTC](https://community.influxdata.com/t/inputs-icinga2-services-object-query-specify-specfic-host-and-service/56793/5 "2025-03-24T09:53:28Z")

</div>

@samtommy we are currently gathering the endpoints `/v1/objects/services` and `/v1/objects/hosts` if both objects are specified. We then should collect the performance data above.  
Could you please outline which endpoint you get the data above from **and** the full (redacted) JSON you get as a response?

---

<div class="post-metadata">

**Author:** ![samtommy](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@samtommy](https://community.influxdata.com/u/samtommy)\
**Post date:** [March 24, 2025, 4:53pm UTC](https://community.influxdata.com/t/inputs-icinga2-services-object-query-specify-specfic-host-and-service/56793/6 "2025-03-24T16:53:37Z")

</div>

Here is the “curl” result -

```auto
/usr/bin/curl -k -s -S -u user 'https://testicinga.com:5665/v1/objects/services/testicinga.com!icinga?pretty=1'

```

[https://pastebin.com/W3SdUxZH](https://pastebin.com/W3SdUxZH)

---

<div class="post-metadata">

**Author:** ![samtommy](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@samtommy](https://community.influxdata.com/u/samtommy)\
**Post date:** [May 14, 2025, 2:10am UTC](https://community.influxdata.com/t/inputs-icinga2-services-object-query-specify-specfic-host-and-service/56793/7 "2025-05-14T02:10:51Z")

</div>

Any possibility of adding the performance data of the Icinga2 services in the plugin? Thanks
