Read Only User for CCM that can access json cgi

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Read Only User for CCM that can access json cgi

Post by WillemDH »

Hello,

I'm experimenting with the new json cgi's. So I would like to create a script that queries a json url, saves it into a Powershell object and then do some stuff with it. But I need to enter the nagios admin username and password.
What would be the best way to access his json cgi remotely? I would think a read-only user is required, as I would prefer not to use nagiosadmin in my Powershell scripts. How would I make a read-only account for CCM?

Thanks again!

Grtz

Willem
Nagios XI 5.8.1
https://outsideit.net
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Read Only User for CCM that can access json cgi

Post by abrist »

The json cgis and the ccm are different things.
The ccm is a frontend to our fork of nagiosql - it provides an interface to configure nagios monitoring objects.
The json cgis are provided through a get/post api from core. You can query the cgis without logging into the ccm or xi. Just create an XI user and log in once to set up the account and change the password. Make this user read only but allow it to see all objects. Afterwards you can query the json cgis with:

Code: Select all

http://<username>:<password>@<ip>/nagios/cgi-bin/<cgi>?<query>
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Read Only User for CCM that can access json cgi

Post by WillemDH »

Got this working Andy. Thanks for the help. Thread can be closed.
Nagios XI 5.8.1
https://outsideit.net
Locked