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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
MrWoodward
Posts: 66
Joined: Fri Jan 06, 2017 1:58 pm

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

Post 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.
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?

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

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

Post 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:
MrWoodward
Posts: 66
Joined: Fri Jan 06, 2017 1:58 pm

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

Post by MrWoodward »

Excellent! I'll start testing it now!

Thanks.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

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

Post by tgriep »

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?

Post 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?
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?

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

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

Post by tacolover101 »

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?

Post 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...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
MrWoodward
Posts: 66
Joined: Fri Jan 06, 2017 1:58 pm

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

Post by MrWoodward »

Are you guys talking about communicating directly with the Nagios Database?
Locked