Page 1 of 1

Method to list active Nagios XI users and activity

Posted: Fri Nov 16, 2018 12:02 pm
by awilson
Hi. Is there a way to list the current Nagios XI users and their activity?

Re: Method to list active Nagios XI users and activity

Posted: Fri Nov 16, 2018 2:14 pm
by npolovenko
@awilson, There is a way to list all XI users via the API command:
You'll need to replace my API key with yours.

As far as the user activity goes, you can view some of it in the Event Log. (Homepage -> bottom of the left column).
But it would be limited to Acknowledgments and Downtime. Any modifications to the host/service configs in the CCM are not associated with the users' activity and not logged. That is something we're looking into adding in the future.

Re: Method to list active Nagios XI users and activity

Posted: Fri Nov 16, 2018 2:17 pm
by awilson
Thanks!

Re: Method to list active Nagios XI users and activity

Posted: Fri Nov 16, 2018 2:40 pm
by awilson
Thank you for the API reference. The information I'm trying to get is who are the active logged on users to the Nagios XI platform. I didn't see an endpoint for that. Is that information in one of the databases?

Thanks!

Re: Method to list active Nagios XI users and activity

Posted: Fri Nov 16, 2018 3:12 pm
by npolovenko
@awilson, You could look into the xi_session table in the database and match active sessions with the user ID's.
echo "SELECT * FROM xi_sessions\G;" | mysql -uroot -pnagiosxi nagios
Or you could use this query to get the last login time for the users:
echo "SELECT * FROM xi_users\G;" | mysql -uroot -pnagiosxi nagiosxi
Other than that I can't think of anything.

Re: Method to list active Nagios XI users and activity

Posted: Fri Nov 16, 2018 4:39 pm
by awilson
Thank you. This is a great help. You can close this topic.

Cheers.

Re: Method to list active Nagios XI users and activity

Posted: Fri Nov 16, 2018 4:41 pm
by awilson
I was too fast. xi_sessions must be in PostgreSQL on my system. We are on 5.4.4

Re: Method to list active Nagios XI users and activity

Posted: Mon Nov 19, 2018 10:29 am
by lmiltchev
With postgres, you can use the following command instead:

Code: Select all

echo "SELECT * FROM xi_users\G;" | psql nagiosxi nagiosxi

Re: Method to list active Nagios XI users and activity

Posted: Mon Nov 19, 2018 10:45 am
by npolovenko
@awilson, I checked the database tables on the XI 5.4.12 and didn't see the xi_sessions either. On the XI 5.5 the table is present. Here's the PSQL version of the second query that I gave you:
echo "SELECT * FROM xi_users\G;" | psql nagiosxi nagiosxi
Can you go to the Admin menu, then click on Manage users in the left column and see if the "Last Login" column is populated with timestamps?