New API question

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

New API question

Post by BanditBBS »

Right now, for adding new hosts or services, is there any way to say "dont require fields" so I can supply a template so I don't get

Code: Select all

{
    "error": "Missing required variables",
    "missing": [
        "max_check_attempts",
        "check_period",
        "notification_interval",
        "notification_period",
        "contacts OR contact_groups"
    ]
}
I really want to use the API for something I am doing, but I have to be able to use templates and not require those fields as they are all supplied by templates.

EDIT: I guess I could write the host cfg to the import folder, use the API to run the import, then write the services file and do the import again as a work around, but using the curl commands would be awesome!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

Re: New API question

Post by jomann »

That is actually a good point. I'll add something here for this because you can use the "use" attribute.

Edit: Added a parameter to pass called "force" so you can add &force=1 to skip the check.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: New API question

Post by BanditBBS »

jomann wrote:That is actually a good point. I'll add something here for this because you can use the "use" attribute.

Edit: Added a parameter to pass called "force" so you can add &force=1 to skip the check.
Also for the services as well since we can use a template there please :)

You can close this thread.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

Re: New API question

Post by jomann »

It'll be in there for both of them this coming release (this week).
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked