Define service config_name from REST API

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
smcgregor
Posts: 4
Joined: Tue Aug 16, 2016 10:41 pm

Define service config_name from REST API

Post by smcgregor »

We're running XI 5.4.9 and trying to set the Config Name field shown in the image below via the REST API
nagus.png
We have a working service creation via API using the following, however the hostname is used as the config_name every time

Code: Select all

/nagiosxi/api/v1/config/service?apikey=####
Using a POST payload of

Code: Select all

'host_name' := 'server.tld'
'service_description' := 'Check thing.service'
'check_command' := 'check_systemctl!thing.service!!!!!!!'
'max_check_attempts' := 3
'check_interval' := 15
'retry_interval' := 5
'check_period' := '24x7'
'contact_groups' := 'oncall_grp'
'notification_interval' := 5
'notification_period' := '24x7'
'notes' := 'Service config created via Puppet'
'force' := 1
'applyconfig' := 1
From some reading through the XI internals we've tried setting config_name as well as _config_name but don't seem to be having much luck.
Is there a parameter we can set to specify the Config Name for a service?
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Define service config_name from REST API

Post by npolovenko »

Hello, @smcgregor. Unfortunately, you can't assign the config_name via rest API. If you'd like I could put a feature request to add this functionality in the future versions of XI. This feature request may or may not get approved by our dev team.
Also, I don't think this is supported either: 'notes' := 'Service config created via Puppet'.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
smcgregor
Posts: 4
Joined: Tue Aug 16, 2016 10:41 pm

Re: Define service config_name from REST API

Post by smcgregor »

I would appreciate it. At the moment we're using the description as our unique constraint in Puppet, but the config_name would make a lot more sense if we could use it.

The notes parameter seems very much supported as per the nagioscore documentation for service definitions
notes.png
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Define service config_name from REST API

Post by npolovenko »

@smcgregor, Agreed. I was looking at the API reference and didn't see mentioning of 'notes' so I assumed they can't be passed via API. But they can indeed :)
I submitted a feature request on your behalf. You may check back with our technicians in a couple weeks - a month, to see if it was approved and if so we'll provide you with a feature tracking number.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
tsquillario
Posts: 1
Joined: Wed Oct 25, 2017 11:17 am

Re: Define service config_name from REST API

Post by tsquillario »

Did "config_name" ever get added as a feature request? I'm trying to automate service adds via the REST API. It sets the config_name to the host_name.
smcgregor
Posts: 4
Joined: Tue Aug 16, 2016 10:41 pm

Re: Define service config_name from REST API

Post by smcgregor »

npolovenko wrote: I submitted a feature request on your behalf.
I believe one was made, as to where it was made or how to check up on it no idea.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Define service config_name from REST API

Post by npolovenko »

@smcgregor and @tsquillario, I apologize for the confusion. Generally, we submit feature requests to the special FR pool where they need to get approved. With that said, the feature was indeed approved and should be added in the XI 5.4.13 - XI 5.5. releases.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
smcgregor
Posts: 4
Joined: Tue Aug 16, 2016 10:41 pm

Re: Define service config_name from REST API

Post by smcgregor »

Excellent!

Thanks for clearing that up.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Define service config_name from REST API

Post by npolovenko »

Not a problem! I will go ahead and lock this thread as resolved.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked