Page 1 of 1
Manage unconfigured objects with api
Posted: Wed Apr 16, 2025 9:19 am
by dslaughter
I have nagiosxi 5.10.0. (I can't upgrade until end of year)
I'm trying to use the api to list unconfigured objects then remove based on a filter. I've written a script and it is able to get the list of unconfigured objects but it gets a 403 when the delete is attempted.
I'm an admin and my token is working. I can't find manage api under admin menu to check the permissions for the token.
Can you help me find where I can check/change permissions for my token.
Re: Manage unconfigured objects with api
Posted: Wed Apr 16, 2025 9:35 am
by sgardil
dslaughter wrote: ↑Wed Apr 16, 2025 9:19 am
I have nagiosxi 5.10.0. (I can't upgrade until end of year)
I'm trying to use the api to list unconfigured objects then remove based on a filter. I've written a script and it is able to get the list of unconfigured objects but it gets a 403 when the delete is attempted.
I'm an admin and my token is working. I can't find manage api under admin menu to check the permissions for the token.
Can you help me find where I can check/change permissions for my token.
I don't believe there are granular permissions like that for api tokens within Nagios. It's more of if you have admin or api access then you have a token that will work for api linked to the account.
Re: Manage unconfigured objects with api
Posted: Wed Apr 16, 2025 3:24 pm
by dslaughter
Thank you for your quick response. Do you know if there is a log that might help identify what permissions are needed? I'm an admin. I get the list of unconfigured objects so the connect is good and the token works. I only get the 403 when I try to remove from unconfigured objects.
Re: Manage unconfigured objects with api
Posted: Fri Apr 18, 2025 12:25 pm
by jsimon
Hi @dslaughter,
I've included a link to our REST API documentation here:
https://assets.nagios.com/downloads/nag ... ST-API.pdf
At this time, the Object API is read-only, and I'm not seeing any Core commands that are able to delete objects either.
Re: Manage unconfigured objects with api
Posted: Sun Apr 20, 2025 12:51 pm
by dslaughter
Thank you for your response. My problem is I have a lot of unconfigured objects. I have so many because I have traps that come in with a service name that I don't define so I have to configure only some of the unconfigured objects. I thought I found a way to delete unconfigured objects using the api based on a service name filter. My script works except that the delete doesn't work and your response explains why.
Do you know of a way to select individual unconfigured objects for configuration? I only see a a way to configure all unconfigured objects for a host when I only need few to config. As of now I have to delete as many as a thousand objects to configure 30. It's not optimal but until I can get the service name before I start receiving the unconfigured objects this is what I have to work with. Any ideas would be appreciated.
Thank you
Re: Manage unconfigured objects with api
Posted: Wed May 14, 2025 2:37 pm
by dslaughter
If anyone is interested...
I wrote a selenium script to access unconfigured objects page. I was able to collect the objects, and delete the ones that didn't match my filter.