We are working on ability to enable/disable monitoring for multiple Hosts at once and need a way to identify current monitoring status for all Hosts in environment.
with fields=+properties.monitoringMode in /api/v2/entities call we can easily to identify monitoring mode, however, only way we found so far to identify if monitoring is enabled or not is to call /api/config/v1/hosts/ API for every single HOST.
Is there any better way to do this? not doing 5000 calls for 5000 Hosts?
Solved! Go to Solution.
Thanks for information. I have tow painpoints with this solution:
- it is v1 API. Will it be kept for the future?
- it allows me to get information for one HOST. SO, if I have 10.000 hosts I have to loop it 10.000 times if I need to get an overview about status.
it is not a problem to get Monitoring mode with v2 entities call as it is part of entity Type HOST properties. However, I am talking about monitoringEnable property for which I would need to use v1 call in loop.... 😞
Any other option?
The API I linked returns multiple hosts, II just verified that, not one so it won't need a separate call to get every host. I'm not aware of any plans to get rid of any v1 endpoints, most likely they just won't get any enhancements.
hi James, you are absolutelly right, sorry for confusion, /api/v1/entity/infrastructure/hosts returns all hosts, however, it doesnot return monitoringEnable property, just monitoringMode.
However, I found meanwhile that /api/v1/oneagents is able toprovide this information via configuredMonitoringEnabled property, hence my problem too get montoringenabled state for all hosts in one call is solved by now.
Thanks for support!