NagiosXI API URL

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Gonela
Posts: 135
Joined: Wed Jan 10, 2018 5:23 am

NagiosXI API URL

Post by Gonela »

Hi Team,

May i know the API URL for adding the comments on particular host and service ? Using API URL.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NagiosXI API URL

Post by lmiltchev »

You can see an example here:

Help > REST API Docts > System Reference > POST system/corecommand

Code: Select all

curl -XPOST "http://x.x.x.x/nagiosxi/api/v1/system/corecommand?apikey=LTltbjobR0X3V5ViDIitYaI8hjsjoFBaOcWYukamF7oAsD8lhJRvSPWq8I3PjTf7" -d "cmd=ADD_HOST_COMMENT;localhost;1;%user%;This is a test comment"

{
    "cmd": "ADD_HOST_COMMENT;localhost;1;nagiosadmin;This is a test comment",
    "success": "Core command submitted"
}
Be sure to check out our Knowledgebase for helpful articles and solutions!
Gonela
Posts: 135
Joined: Wed Jan 10, 2018 5:23 am

Re: NagiosXI API URL

Post by Gonela »

Hi ,

i'm trying to running the below command . getting following error

Syntax : curl -XPOST "http://xxxxx/nagiosxi/api/v1/system/cor ... y=hsa7lrke" -d "cmd=ADD_HOST_COMMENT;lanpcorp01.ffx.jfh.com.au;1;nagiostosnow;This is a test comment"

output :

{
"error": "Invalid API Key"
}

But using same API key : GET command is working
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NagiosXI API URL

Post by lmiltchev »

Are you running the GET command in a browser after you authenticated (logged in as the "nagiostosnow" user)? Please show us the GET command, run from the CLI along with the output of it.

What is the version of Nagios XI that you are currently using? What kind of permissions the "nagiostosnow" user has?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked