I want to export username along with Auth level information from nagiosxi. can some one help me on how to pull this data.
I have tried pulling data using API, but its displaying data in json format, Is there any way that we can get only usernames from this json data format.
or is there any other way to get this information
curl -XGET "http://nagioshostname/nagiosxi/api/v1/s ... &&pretty=1"
Is it possible to pull this data from xi database. can someone help on querying this
Appreciate a quick help here
Export Users list along with auth level information
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Export Users list along with auth level information
Hello, @mohan23. Please try the following query and let me know if that's what you were looking for:
echo "select xi_users.username as username,xi_usermeta.keyvalue as 'AuthLevel(255=admin,1=regular user)' from xi_usermeta inner join xi_users on xi_usermeta.user_id = xi_users.user_id where keyname = 'userlevel';"| mysql -u root -pnagiosxi nagiosxi
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Export Users list along with auth level information
Yes, this is working for me. Provided query provides me user list including admins and read only users. I want to pull only user list of admins . How to modify the query to pull only admin users list
-
swolf
Re: Export Users list along with auth level information
Sure!
Let us know if you have any other concerns
Code: Select all
echo select xi_users.username as username, xi_usermeta.keyvalue as AuthLevel from xi_usermeta inner join xi_users on xi_usermeta.user_id = xi_users.user_id where keyname = 'userlevel' and xi_usermeta.keyvalue = 255;" | mysql -u root -pnagiosxi nagiosxiPull Admin user list using Nagios API
Hi Team,
Using below API query, im able to get users information but I don't see auth level information.
http://hostname/nagiosxi/api/v1/system/ ... x&pretty=1
{
"records": 107,
"users": [
{
"user_id": "123",
"username": "smadhuk",
"name": "Madhukar, Shubhendu - Shubhendu",
"email": "[email protected]",
"enabled": "1"
}
Can some one help me with pulling users information like above along with AuthLevel information?
Appreciate quick help on this!
Using below API query, im able to get users information but I don't see auth level information.
http://hostname/nagiosxi/api/v1/system/ ... x&pretty=1
{
"records": 107,
"users": [
{
"user_id": "123",
"username": "smadhuk",
"name": "Madhukar, Shubhendu - Shubhendu",
"email": "[email protected]",
"enabled": "1"
}
Can some one help me with pulling users information like above along with AuthLevel information?
Appreciate quick help on this!
Re: Export Users list along with auth level information
If I want to export user list along with Auth level information using Nagios Rest API, how can I use this,. Below query gives user list with all information like name, email id and username but not the auth level information for the users
http://hostname/nagiosxi/api/v1/system/ ... x&pretty=1
{
"records": 107,
"users": [
{
"user_id": "123",
"username": "smadhuk",
"name": "Madhukar, Shubhendu - Shubhendu",
"email": "[email protected]",
"enabled": "1"
}
Can you tell me what modifications to be done for above API query so that I can get username, name , email, and AuthLevel information.
????
http://hostname/nagiosxi/api/v1/system/ ... x&pretty=1
{
"records": 107,
"users": [
{
"user_id": "123",
"username": "smadhuk",
"name": "Madhukar, Shubhendu - Shubhendu",
"email": "[email protected]",
"enabled": "1"
}
Can you tell me what modifications to be done for above API query so that I can get username, name , email, and AuthLevel information.
????
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Export Users list along with auth level information
@mohan23, Currently the API command only returns the list of users. It doesn't provide any info about the authorization level. So for now, the only option is to use MySQL queries or Web Interface.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Export Users list along with auth level information
So from web interface how can we export user list along with Auth level info?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Export Users list along with auth level information
This is not currently available from the web interface, the only current way to get the info would be from the SQL provided earlier in the threadmohan23 wrote:So from web interface how can we export user list along with Auth level info?