I am trying to use the XI API to create services that rely upon service templates to provide values for items like max check attempts, notification timesframe and other mandatory values in the API for the service definition.
I've tried not listing the items in the REST call and it's rejected for missing items. I've tried providing the None value as part of the python object definition for the paylog which python is properly interpreting to null, but Nagios refuses to apply the service and puts invalid values in the fields. I've tried just doing '' so they are sent over as blank strings. None of the above work.
How can I get Nagios to allow me to submit empty values for the following and use the values that are inherited from the service template via the use parameter which IS properly relating the new service to an existing service template? This is entirely possible via the UI and is working correctly.
'check_interval': None,
'retry_interval': None,
'max_check_attempts': None,
'check_period': None,
'contacts': None,
'notification_interval': None,
'notification_period': None,
XI API to Create a service using blank/null values for some
Re: XI API to Create a service using blank/null values for s
If you add force=1 to the parameters to bypass the verification, it should do what you want.
https://assets.nagios.com/downloads/nag ... gement.pdf
(search for "force=1" in the document, and you'll find it)
--Jeffrey
https://assets.nagios.com/downloads/nag ... gement.pdf
(search for "force=1" in the document, and you'll find it)
--Jeffrey
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: XI API to Create a service using blank/null values for s
THANK YOU! I did not see a force parameter available on the online version of the help in the XI UI. I will update my python shortly and give this a whirl.
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: XI API to Create a service using blank/null values for s
Sounds good.THANK YOU! I did not see a force parameter available on the online version of the help in the XI UI. I will update my python shortly and give this a whirl.
Let us know if you need anything else.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!