Page 2 of 2
Re: Using Nagios API updating(XPUT) hostgroup is failing
Posted: Thu Mar 18, 2021 9:01 am
by lmiltchev
So, with limited user permission GET command also won't execute?
Unfortunately no - I already tried, then talked to our developers. "Regular" users won't be able to access this endpoint.
Re: Using Nagios API updating(XPUT) hostgroup is failing
Posted: Tue Mar 23, 2021 9:39 am
by bseuser
Hi,
Is there any feature enhancement to allow the users to use API to change/modify/delete the hosts and services owned by users( Teams/Groups ) instead of admin to use API?
Our use case here is that we need to give multiple teams access to their self-service to their owned systems. We feel that API is a good way to provide access, but I see API has very little functionality.
I tried with Multy-Tenancy way with Limited access to CCM, and the users can modify the host and services but not create the services.
Thanks,
Re: Using Nagios API updating(XPUT) hostgroup is failing
Posted: Tue Mar 23, 2021 6:24 pm
by ssax
I have created the request:
Code: Select all
FR: XI - API - Add config endpoint access to regular users to allow them to configure the things they are allowed to - Allow them to access the system/scheduleddowntime one as well
Please keep in mind that the decision to implement the enhancement is at the discretion of our development team.
Currently non-admin users can only access the objects API endpoint, the config/system ones are reserved for admins.
I tried with Multy-Tenancy way with Limited access to CCM, and the users can modify the host and services but not create the services.
I just tried this in XI 5.8.2 and I can create hosts/services as the regular user when Limited is selected for the CCM permissions.
Re: Using Nagios API updating(XPUT) hostgroup is failing
Posted: Tue Mar 23, 2021 10:45 pm
by bseuser
Thanks for submitting the feature request. We will wait to see this.
And, I tried with the non-admin user to access the endpoint it says Authentication error. As per lmiltchev said GET/POST/PUT/DELETE will work only for admin.
What are the object endpoints? objects mean: host, service, contact, group, timeperiod, etc., is this correct?
I tried with the GET command and not able to get the request. I got the below error.
Code: Select all
% curl -XGET "http://nagiosxidev/nagiosxi/api/v1/config/host?apikey=DD2CSVkL2TmpCGhlVNbLt5snuTYXeo77h8Z9jjbFsQk4sFJIITprfbSM47KhO7H5&pretty=1"
{
"error": "Authenticiation failed."
}
Is anything I am missing here?
Thanks
Re: Using Nagios API updating(XPUT) hostgroup is failing
Posted: Wed Mar 24, 2021 1:01 pm
by benjaminsmith
Hi,
What are the object endpoints? objects mean: host, service, contact, group, timeperiod, etc., is this correct
The objects endpoints are the following:
GET objects/hoststatus
GET objects/servicestatus
GET objects/logentries
GET objects/statehistory
GET objects/comment
GET objects/downtime
GET objects/contact
GET objects/host
GET objects/service
GET objects/hostgroup
GET objects/servicegroup
GET objects/contactgroup
GET objects/timeperiod
Unconfigured Objects
GET objects/unconfigured
Group Members
GET objects/hostgroupmembers
GET objects/servicegroupmembers
GET objects/contactgroupmembers
Data Exporting
GET objects/rrdexport
GET objects/cpexport
GET objects/hostavailability
GET objects/serviceavailability
GET objects/sla
GET objects/bpi
The command is running against the config endpoint so this will not work with a user account. Try running the following (change the IP and API key to your settings).
Code: Select all
curl -XGET "https://192.168.23.112/nagiosxi/api/v1/objects/hoststatus?apikey=AAXHBIAkAHq5L7nnrHdgah5RKMi7b4uKDrIrqu5ZcukdFKTmH7FRnZInLhtdk0dd&pretty=1"
--Benjamin