Page 1 of 1

NagiosXI - schedule reports and other config via "API"

Posted: Tue Oct 04, 2016 3:28 pm
by zarkomd
Hi All,

In general is there an API of some sort that I can use to configure NagiosXI?
Im trying to automate user creating, reports sending for the new users etc... so that I dont need to logon to the gui to do that.

But those settings aren't in any cfg files, like for the hosts, contacts, services...

Thanks,
Zarko

Re: NagiosXI - schedule reports and other config via "API"

Posted: Tue Oct 04, 2016 4:02 pm
by dwhitfield
You'll find "Backend REST API" information at https://support.nagios.com/kb/article.php?id=176. The "Backend API" will not do what you want it to do. Please let us know if you have any additional questions.

Re: NagiosXI - schedule reports and other config via "API"

Posted: Wed Oct 05, 2016 3:06 pm
by lmiltchev
To add to what @dwhitfield said - this is "partially" possible. You can add users via the REST API, however, you cannot create reports, and add them to these users, at least not yet.

Example of adding users:

Code: Select all

curl -XPOST "http://x.x.x.x/nagiosxi/api/v1/system/user?apikey=xxx&pretty=1" -d "username=robertdeniro&password=test&name=Robert%20De%20Niro&email=robertdeniro@localhost&auth_level=admin&monitoring_contact=1"
{
    "success": "User account robertdeniro was added successfully!",
    "userid": "5"
example01.PNG
To view the REST API usage, go to the "Help" menu in Nagios XI, then click on "Backend API Docs".

As for the reports, I could add an internal feature request if you want me to. I know that we are going to add a lot more functionality to the REST API, so this could be added as well.