Page 1 of 1
Nagios Manage users
Posted: Wed May 07, 2014 3:50 am
by sureshkraj2012
Hello Team,
Is there a way to export users that we have under (Admin -> Users -> Manage Users) to excel/pdf with the settings/permissions they have been configured?
Re: Nagios Manage users
Posted: Wed May 07, 2014 9:45 am
by slansing
You would need to sculpt a command to pull them from the postgres database. You can also view their permissions in the following file:
Re: Nagios Manage users
Posted: Thu May 08, 2014 1:19 am
by sureshkraj2012
Great!
Do we have any document / instruction to pull that info from Postgres?
Re: Nagios Manage users
Posted: Thu May 08, 2014 9:24 am
by technick
sureshkraj2012 wrote:Great!
Do we have any document / instruction to pull that info from Postgres?
I've never found any solid documentation but can give you this information...
You can dump the nagiosxi user table with this command.
Code: Select all
echo "SELECT * FROM xi_users" | psql -U nagiosxi
OR log in with
Code: Select all
nagiosxi=> select * from xi_users;
user_id | username | password | name | email | backend_ticket | enabled
---------+--------------------+----------------------------------+----------------------------+------------------------------------+------------------------------------------------------------------+---------
59 | jwhite | a176b5e115197a1454b0ed36e6c32d5e | Jack White | [email protected] | fqg876mp6utc8dpd66mvfg04l60d8u4kmjqqogjrce5kqtut2irg3pjluh24e3o2 | 1
Code: Select all
select keyname,keyvalue from xi_usermeta where user_id='59';
You can describe the table using \d tablename
and just do joins off user_id across the xi_users and xi_usermeta tables.
Re: Nagios Manage users
Posted: Thu May 08, 2014 9:27 am
by tmcdonald
We generally don't provide documentation for the backend database stuff, because if we did that and someone made a mistake things can get *seriously* broken very fast. We usually prefer for people to submit a feature request or worst case have us craft a reply we know to be safe. That said, follow technick's advice and run the describe and select on the tables. They are not incredibly complicated and that select all should get you what you need.
Re: Nagios Manage users
Posted: Thu May 08, 2014 10:04 am
by technick
tmcdonald wrote:We generally don't provide documentation for the backend database stuff, because if we did that and someone made a mistake things can get *seriously* broken very fast. We usually prefer for people to submit a feature request or worst case have us craft a reply we know to be safe. That said, follow technick's advice and run the describe and select on the tables. They are not incredibly complicated and that select all should get you what you need.
tmcdonald is a gazillion times correct with this... mucking around in the database can break your environment if mistakes are made.. Which is why I recommend double.. no triple checking your backups exist and are good plus do all of your development of this stuff in a test environment.
Also make sure you know how to reload the nagios xi backups in case of an emergency.
Re: Nagios Manage users
Posted: Thu May 08, 2014 12:22 pm
by slansing
Yep, be very careful, nagios sources a lot of data from the MySQL and PostgresQL databases on your server.
Re: Nagios Manage users
Posted: Mon May 12, 2014 10:10 pm
by sureshkraj2012
Got it. Thank you

Re: Nagios Manage users
Posted: Tue May 13, 2014 9:26 am
by slansing
Yep!

Are we all good to lock this up? Or do you have followup questions on this topic?