Method to list active Nagios XI users and activity
Method to list active Nagios XI users and activity
Hi. Is there a way to list the current Nagios XI users and their activity?
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Method to list active Nagios XI users and activity
@awilson, There is a way to list all XI users via the API command:
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.
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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Method to list active Nagios XI users and activity
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!
Thanks!
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Method to list active Nagios XI users and activity
@awilson, You could look into the xi_session table in the database and match active sessions with the user ID's.
Or you could use this query to get the last login time for the users:echo "SELECT * FROM xi_sessions\G;" | mysql -uroot -pnagiosxi nagios
Other than that I can't think of anything.echo "SELECT * FROM xi_users\G;" | mysql -uroot -pnagiosxi nagiosxi
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Method to list active Nagios XI users and activity
Thank you. This is a great help. You can close this topic.
Cheers.
Cheers.
Re: Method to list active Nagios XI users and activity
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
With postgres, you can use the following command instead:
Code: Select all
echo "SELECT * FROM xi_users\G;" | psql nagiosxi nagiosxiBe sure to check out our Knowledgebase for helpful articles and solutions!
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Method to list active Nagios XI users and activity
@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:
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?echo "SELECT * FROM xi_users\G;" | psql nagiosxi nagiosxi
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.