Are Free (Custom) Variables via the REST API supported?
-
MrWoodward
- Posts: 66
- Joined: Fri Jan 06, 2017 1:58 pm
Are Free (Custom) Variables via the REST API supported?
Noticed that about a year ago, it was not yet possible to add Free (Custom) Variables via the API.
Is that possible now?
Thanks.
Is that possible now?
Thanks.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Are Free (Custom) Variables via the REST API supported?
Yes it does.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.
For example if I tack the following on the example host creation
Code: Select all
&_testfree=yesCode: Select all
Name Value
_testfree yes- tacolover101
- Posts: 432
- Joined: Mon Apr 10, 2017 11:55 am
Re: Are Free (Custom) Variables via the REST API supported?
this is awesome - opens up a lot of custom functionality!scottwilkerson wrote:Yes it does.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.
For example if I tack the following on the example host creationI see the following in the CCM under the Free VariablesCode: Select all
&_testfree=yesCode: Select all
Name Value _testfree yes
-
MrWoodward
- Posts: 66
- Joined: Fri Jan 06, 2017 1:58 pm
Re: Are Free (Custom) Variables via the REST API supported?
Excellent! I'll start testing it now!
Thanks.
Thanks.
Re: Are Free (Custom) Variables via the REST API supported?
Let us know if you have any other questions.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
MrWoodward
- Posts: 66
- Joined: Fri Jan 06, 2017 1:58 pm
Re: Are Free (Custom) Variables via the REST API supported?
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?
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?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Are Free (Custom) Variables via the REST API supported?
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.
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.
- tacolover101
- Posts: 432
- Joined: Mon Apr 10, 2017 11:55 am
Re: Are Free (Custom) Variables via the REST API supported?
This kind of opens the doors to.... Nagios CMDB™! 
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Are Free (Custom) Variables via the REST API supported?
Not to derail @MrWoodward topic, you are right. Many people have been using Nagios this way for a long time, although not through the APItacolover101 wrote:This kind of opens the doors to.... Nagios CMDB™!
Actually, usually it often used for asset management, keeping track of serial numbers, mac address, etc...
-
MrWoodward
- Posts: 66
- Joined: Fri Jan 06, 2017 1:58 pm
Re: Are Free (Custom) Variables via the REST API supported?
Are you guys talking about communicating directly with the Nagios Database?