The configuration key:value pair for this is "is_active" it's bool set to 0 for inactive objects to be created and stored in the db.
Here are the templates I use for reference when developing for host and service objects. It's everything plus a couple
Hosts
Code: Select all
{
"host_name": "the.host.fqdn",
"alias": "the.host.fqdn",
"display_name": "the.host.fqdn",
"address": "IP/the.host.fqdn",
"use": "template name",
"check_command": "check_command!$ARG1$!$ARG2$!$ARG3$!$ARG4$!$ARG5$!$ARG6$!$ARG7$!$ARG8$",
"max_check_attempts": "#",
"check_interval": "3",
"retry_interval": "3",
"check_period": "check_period",
"notification_period": "notification_period",
"notification_interval": "#",
"contacts": "",
"contact_groups": "",
"is_active": "[1/0]",
"_hostImpact":"",
"_hostUrgency":"",
"_onCall":"",
"notes":"HOST OBJECT EXAMPLE (ALL FIELDS)",
"notes_url":"url",
"action_url":"url",
"parents":"fqdns",
"importance":"",
"first_notification_delay":"",
"notification_options":"[d,u,r,f,s]",
"notifications_enabled":"[0/1]",
"hostgroups":"hostgroup_names",
"initial_state":"[o,d,u]",
"active_checks_enabled":"[0/1]",
"passive_checks_enabled":"[0/1]",
"obsess_over_host|obsess":"[0/1]",
"check_freshness":"[0/1]",
"freshness_threshold":"",
"event_handler":"command_name",
"event_handler_enabled":"[0/1]",
"low_flap_threshold":"",
"high_flap_threshold":"",
"flap_detection_enabled":"[0/1]",
"flap_detection_options":"[o,d,u]",
"process_perf_data":"[0/1]",
"retain_status_information":"[0/1]",
"retain_nonstatus_information":"[0/1]",
"stalking_options":"[o,d,u,N]",
"icon_image":"image_file",
"icon_image_alt":"alt_string",
"vrml_image":"image_file",
"statusmap_image":"image_file",
"2d_coords":"x_coord,y_coord",
"3d_coords":"x_coord,y_coord,z_coord"
}
Services
Code: Select all
{
"host_name": "the.host.fqdn",
"service_description": "Os.Class.Category.Metric",
"use": "nagiosxi-template-name",
"check_command" : "check_command!$ARG1$!$ARG2$!$ARG3$!$ARG4$!$ARG5$!$ARG6$!$ARG7$!$ARG8$",
"max_check_attempts": "#",
"check_interval": "#",
"retry_interval": "#",
"check_period": "xi_timeperiod",
"notification_period": "xi_timeperiod",
"notification_interval": "#",
"contacts": "contacts",
"contact_groups":"contact_groups",
"is_active": "[0/1]",
"_serviceImpact":"",
"_serviceUrgency":"",
"_onCall":"",
"hostgroup_name":"hostgroup_name",
"display_name":"display_name",
"parents":"service_descriptions",
"importance":"#",
"servicegroups":"servicegroup_names",
"is_volatile":"[0/1]",
"initial_state":"[o,w,u,c]",
"active_checks_enabled":"[0/1]",
"passive_checks_enabled":"[0/1]",
"obsess_over_service|obsess":"[0/1]",
"check_freshness":"[0/1]",
"freshness_threshold":"#",
"event_handler":"command_name",
"event_handler_enabled":"[0/1]",
"low_flap_threshold":"#",
"high_flap_threshold":"#",
"flap_detection_enabled":"[0/1]",
"flap_detection_options":"[o,w,c,u]",
"process_perf_data":"[0/1]",
"retain_status_information":"[0/1]",
"retain_nonstatus_information":"[0/1]",
"first_notification_delay":"#",
"notification_options":"[w,u,c,r,f,s]",
"notifications_enabled":"[0/1]",
"stalking_options":"[o,w,u,c,N]",
"notes":"note_string",
"notes_url":"url",
"action_url":"url",
"icon_image":"image_file",
"icon_image_alt":"alt_string"
}
Happy monitoring,
--SN