Nagios Manage users

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sureshkraj2012
Posts: 65
Joined: Tue Aug 06, 2013 11:06 pm

Nagios Manage users

Post 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?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios Manage users

Post 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:

Code: Select all

/usr/local/nagios/etc/cgi.cfg
sureshkraj2012
Posts: 65
Joined: Tue Aug 06, 2013 11:06 pm

Re: Nagios Manage users

Post by sureshkraj2012 »

Great!
Do we have any document / instruction to pull that info from Postgres?
technick
Posts: 49
Joined: Tue Feb 04, 2014 10:30 am
Location: Denver, CO

Re: Nagios Manage users

Post 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

psql -U nagiosxi

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.
----------------------
Nagios Jedi in training.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios Manage users

Post 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.
Former Nagios employee
technick
Posts: 49
Joined: Tue Feb 04, 2014 10:30 am
Location: Denver, CO

Re: Nagios Manage users

Post 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.
----------------------
Nagios Jedi in training.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios Manage users

Post by slansing »

Yep, be very careful, nagios sources a lot of data from the MySQL and PostgresQL databases on your server.
sureshkraj2012
Posts: 65
Joined: Tue Aug 06, 2013 11:06 pm

Re: Nagios Manage users

Post by sureshkraj2012 »

Got it. Thank you :)
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios Manage users

Post by slansing »

Yep! :) Are we all good to lock this up? Or do you have followup questions on this topic?
Locked