Page 1 of 1

User report / dump / export with Security Settings - how?

Posted: Wed Oct 17, 2018 1:16 pm
by stefanw
Hi all --

I'm looking to do something similar to what was brought up in at least two previous topics:
https://support.nagios.com/forum/viewto ... 16&t=34671
https://support.nagios.com/forum/viewto ... 16&t=38794

At a minimum I need to be able to get:
- username
- admin or user
- Can (re)configure hosts and services? yes/no
- Can control all objects? yes/no
- Can see/control monitoring engine? yes/no
- Can access advanced features? yes/no
- Has API access? yes/no

In the near term (until that cited feature request ID 8787 gets handled) I'd be satisfied with being able to dump out from the database, but we're on MySQL so the psql example from that topic doesn't apply.

By the way I can get some value from parsing the "authorized_for_" entries in /usr/local/nagios/etc/cgi.cfg but I'm fairly sure that is not the complete picture.

Can someone supply me with a MySQL CLI query to accomplish this?

By the way we're on XI 5.5.5, MySQL 5.1.73, on RHEL & CentOS 6.10.

Thanks!

Re: User report / dump / export with Security Settings - how

Posted: Wed Oct 17, 2018 2:48 pm
by npolovenko
Hello, @stefanw. Nagios uses two queries to pull users information.
#1
echo "SELECT * FROM xi_users\G;" | mysql -uroot -pnagiosxi nagiosxi
#2
echo "SELECT * FROM xi_usermeta\G;" | mysql -uroot -pnagiosxi nagiosxi
Query number 2 doesn't show the actual usernames and is using user_id from the first query.


It may be easier to parse the information from the cgi.cfg file.