Hello Dear customer,
Thank you for contacting PRTG support.
To filter for multiple groups in your API call using the PRTG API, you can make use of the filter_group parameter with multiple values separated by a comma. Here's an example of how you can modify your code to filter for both "Group-A" and "Group-B":
{{{import requests
api_url = "https://server/api/table.xml?content=sensors&columns=objid,group,device,sensor,status,uptimetime,uptime,knowntime&apitoken=KEY"
query = {'filter_type': 'ping', 'filter_group': 'GROUP-A,GROUP-B'}
response = requests.get(api_url, verify=False, params=query)}}}
In the filter_group parameter, you can provide a comma-separated list of the groups you want to filter for. In the example above, it filters for both "Group-A" and "Group-B". You can modify the list to include any additional groups you require.
Make sure to replace 'GROUP-A' and 'GROUP-B' with the actual names of the groups you want to filter. Also, ensure that the API token (KEY) is properly replaced with your actual PRTG API token.
This modified code will retrieve the sensors that belong to either "Group-A" or "Group-B" based on the provided filter criteria.
Add comment