The host record returned from the API is incomplete. There are several required
fields missing. Most notably, contacts, check_period, etc. How do I discover those
using the API?
Thx.
Keywords:
nagios xi api get host object
Code: Select all
curl --insecure -XGET "http://<naghost>/nagiosxi/api/v1/objects/host?apikey=<longkey>&host_name=hostxxx&pretty=1"
{
"hostlist": {
"recordcount": "1",
"host": {
"@attributes": {
"id": "907"
},
"instance_id": "1",
"host_name": "hostxxx",
"is_active": "1",
"config_type": "1",
"alias": "City, ST",
"display_name": "hostxxx",
"address": "hostxxx.xxx.com",
"check_interval": "5",
"retry_interval": "1",
"max_check_attempts": "3",
"first_notification_delay": "0",
"notification_interval": "0",
"passive_checks_enabled": "1",
"active_checks_enabled": "1",
"notifications_enabled": "1",
"notes": "",
"notes_url": "",
"action_url": "",
"icon_image": "",
"icon_image_alt": "",
"statusmap_image": ""
}
}
}