Service Update API(Put Method)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dca_admin
Posts: 18
Joined: Wed Jun 20, 2018 1:53 pm

Service Update API(Put Method)

Post by dca_admin »

Hello Team,

We are trying to run service update API(Put Method). We are unable to get the response.
Please find below is the API and response.

http://${SERVERNAME}/nagiosxi/api/v1/config/service/${HOSTNAME}/{SERVICENAME}?apikey={APIKEY}'&'display_name=testing 123456'&'applyconfig=1

RESPONSE:

{
"error": "Invalid API Key"
}

But API what we provided is correct only. We are able to work with post and get methods but not put method.

currently we are using Nagios Core 4.4.2

in nagios help--->Config Reference in "REST API - Config Reference" put method is not showing.
how can we work with put method for service update

Please find the attachment and do needful.
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Service Update API(Put Method)

Post by scottwilkerson »

I believe the PUT method was added in 5.6.0 of Nagios XI, you would need to upgrade to the latest
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
dca_admin
Posts: 18
Joined: Wed Jun 20, 2018 1:53 pm

Re: Service Update API(Put Method)

Post by dca_admin »

Hello Scott,

Thanks for your response.

If we upgrade new version what you suggested? Is there any impact on the existing server? We are trying to upgrade the production environment. We want to make sure that the existing production environment should not have any impact. Please confirm.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Service Update API(Put Method)

Post by scottwilkerson »

dca_admin wrote:Hello Scott,

Thanks for your response.

If we upgrade new version what you suggested? Is there any impact on the existing server? We are trying to upgrade the production environment. We want to make sure that the existing production environment should not have any impact. Please confirm.
The upgrade is designed to be able to be performed inline, however you can feel free to test the upgrade in yout testing environment first.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
dca_admin
Posts: 18
Joined: Wed Jun 20, 2018 1:53 pm

Re: Service Update API(Put Method)

Post by dca_admin »

Hello scott,

Thanks for your quick response.

We are trying to integrate nagios with ticketing system by developing API. API Creation is done but we are facing issue like "We have configured one host in Nagios production server with the API to generate tickets. The ticket is generating in ticketing tool when the service state is critical.

While the Nagios server is executing the ticketing service and at the same time trying to execute other services, then at that point in time some of the services state is changing to unhandled state due to the server response time. After a certain time the services are back into its previous state. This might be happening due to load balancing. Do we have any solution for this".

FYI We moinitored totals 1200 devices with 8000 services in nagios.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Service Update API(Put Method)

Post by scottwilkerson »

The solution may be to resolve the issues with another event handler call on recovery.

This all depends on your business requirements.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
dca_admin
Posts: 18
Joined: Wed Jun 20, 2018 1:53 pm

Re: Service Update API(Put Method)

Post by dca_admin »

Hi Scott,

We are trying to upgrade the version from current version to new version.

currently we are using Nagios Core 4.4.2 and need to upgrade new version as per suggestion like 5.6.0 for getting put method. So we need your help for upgradation without any failures.

Please help me how can i upgrade the new version? Need some document or your suggestions.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Service Update API(Put Method)

Post by lmiltchev »

If you have a manual install or you are using one of our pre-build VMs, you can upgrade your Nagios XI instance by following the document below:

https://assets.nagios.com/downloads/nag ... ctions.pdf

If you used the RPM install method, you could upgrade XI by running:

Code: Select all

yum update nagiosxi
See more here:

https://repo.nagios.com/

If your Nagios XI server is in an offline environment, you could upgrade by following this document (see the "Upgrading Nagios XI Offline" section):

https://assets.nagios.com/downloads/nag ... onment.pdf

Important: Regardless of the method you use, don't forget to backup your Nagios XI instance, prior to upgrading it:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

If this is a VM, create a snapshot. Try upgrading in a test environment first, before doing it in production. Each Nagios XI license is approved for up to three installations: one primary monitoring/production, one backup/failover, and one test environment. As long as you are only using one install for production monitoring, you are within the boundaries of our licensing policy.

https://support.nagios.com/kb/article/n ... s-145.html

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked