Page 1 of 2

Are Free (Custom) Variables via the REST API supported?

Posted: Mon Aug 28, 2017 2:44 pm
by MrWoodward
Noticed that about a year ago, it was not yet possible to add Free (Custom) Variables via the API.

Is that possible now?

Thanks.

Re: Are Free (Custom) Variables via the REST API supported?

Posted: Mon Aug 28, 2017 3:06 pm
by scottwilkerson
MrWoodward wrote:Noticed that about a year ago, it was not yet possible to add Free (Custom) Variables via the API.

Is that possible now?

Thanks.
Yes it does.

For example if I tack the following on the example host creation

Code: Select all

&_testfree=yes
I see the following in the CCM under the Free Variables

Code: Select all

Name        Value 	
_testfree	yes

Re: Are Free (Custom) Variables via the REST API supported?

Posted: Mon Aug 28, 2017 3:16 pm
by tacolover101
scottwilkerson wrote:
MrWoodward wrote:Noticed that about a year ago, it was not yet possible to add Free (Custom) Variables via the API.

Is that possible now?

Thanks.
Yes it does.

For example if I tack the following on the example host creation

Code: Select all

&_testfree=yes
I see the following in the CCM under the Free Variables

Code: Select all

Name        Value 	
_testfree	yes
this is awesome - opens up a lot of custom functionality!

:mrgreen:

Re: Are Free (Custom) Variables via the REST API supported?

Posted: Mon Aug 28, 2017 3:44 pm
by MrWoodward
Excellent! I'll start testing it now!

Thanks.

Re: Are Free (Custom) Variables via the REST API supported?

Posted: Mon Aug 28, 2017 4:29 pm
by tgriep
Let us know if you have any other questions.

Re: Are Free (Custom) Variables via the REST API supported?

Posted: Tue Aug 29, 2017 2:23 pm
by MrWoodward
Ok, I'm able to get Free (Custom) Variables into Nagios XI via the API.

How do I get them out, via the API?

Right now, I'm querying the Service List and passing in a query dictionary, but the Free Custom variable doesn't get returned in the JSON object.

Ideas?

Re: Are Free (Custom) Variables via the REST API supported?

Posted: Tue Aug 29, 2017 2:44 pm
by scottwilkerson
You are correct, I actually don't see them as being part of the output in any of the API's.

I queried our senior XI developer to see if this is a feasible feature that we could add into a future version, and we believe it is possible so I am adding a feature request as I believe the API should return all of the data for the objects.

Re: Are Free (Custom) Variables via the REST API supported?

Posted: Tue Aug 29, 2017 5:12 pm
by tacolover101
This kind of opens the doors to.... Nagios CMDB™! ;)

Re: Are Free (Custom) Variables via the REST API supported?

Posted: Wed Aug 30, 2017 8:47 am
by scottwilkerson
tacolover101 wrote:This kind of opens the doors to.... Nagios CMDB™! ;)
Not to derail @MrWoodward topic, you are right. Many people have been using Nagios this way for a long time, although not through the API

Actually, usually it often used for asset management, keeping track of serial numbers, mac address, etc...

Re: Are Free (Custom) Variables via the REST API supported?

Posted: Wed Aug 30, 2017 9:48 am
by MrWoodward
Are you guys talking about communicating directly with the Nagios Database?