Unable to create user out of XI web UI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
karthek
Posts: 64
Joined: Fri Aug 14, 2015 5:55 am
Location: INDIA

Unable to create user out of XI web UI

Post by karthek »

Hi,

I'm trying to create a user out of xi web, but couldn't figure out a way. Steps i did:

1) added the user

Code: Select all

htpasswd /usr/local/nagiosxi/etc/htpasswd.users test.nagios
2) added the read only authorization in cgi.cfg file

Code: Select all

authorized_for_read_only=test.nagios
3) Created a contact file contacts.cfg in static folder.

Code: Select all

define contact {
        contact_name                            test.nagios
        alias                                   tn
        host_notification_period                test_notification_times
        service_notification_period             test_notification_times
        host_notification_options               d,u,r,f,s
        service_notification_options            w,u,c,r,f,s
        email                                   tn@123.com
        use                                     xi_contact_generic
        }
4) restarted apache

everything runs without any errors, but the user doesn't show up in xi interface

am i missing something here?
"Machines don't make mistakes, we do."
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Unable to create user out of XI web UI

Post by tmcdonald »

Users in XI are very different from Contacts, which is what you have just made. To make an XI User, simply go to Admin -> Manage Users. It will make the associated contact and all the changes that go with it, so I would undo the changes you listed here.

https://assets.nagios.com/downloads/nag ... ntacts.pdf
Former Nagios employee
karthek
Posts: 64
Joined: Fri Aug 14, 2015 5:55 am
Location: INDIA

Re: Unable to create user out of XI web UI

Post by karthek »

tmcdonald wrote:To make an XI User, simply go to Admin -> Manage Users.
I do not want to create user from the xi interface. Is there a option to create by editing config files?
"Machines don't make mistakes, we do."
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Unable to create user out of XI web UI

Post by lmiltchev »

I do not want to create user from the xi interface. Is there a option to create by editing config files?
This is not possible as there are no configs for the "xi users". This info is in the database. It used to be in postgresql. Now (on new installs anyway) it is in the mysql. We don't recommend modifying stuff directly in the database, so if you decide to go this route, you would be on your own as this is not going to be a supported instance.
Be sure to check out our Knowledgebase for helpful articles and solutions!
karthek
Posts: 64
Joined: Fri Aug 14, 2015 5:55 am
Location: INDIA

Re: Unable to create user out of XI web UI

Post by karthek »

Thank you lmiltchev for the confirmation.

You may lock the thread.

#######EDIT#########

I was able to successfully add the user in ps DB and the user shows up in xi console :) , but the only problem is the user is not able to login :( .

what i found is basically the user doesn't have any authorizations to login. (see attached screenshot)
user.JPG
How do i provide the required rights?
note:I have added the user in htpasswd.users file as well and added to read only users in cgi.cfg

I totally understand this is not officially supported, but what we are doing is just for testing purpose in test env.
You do not have the required permissions to view the files attached to this post.
"Machines don't make mistakes, we do."
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

Re: Unable to create user out of XI web UI

Post by jomann »

You won't be able to log in because the password is a hash that is saved in the database - it doesn't use the local system users for the web interface.

The officially supported way would be to create the user inside XI and uncheck the "Create as monitoring contact" checkbox which will not set up the user in core or the system itself it basically just creates the DB entry and lets them long in along with setting the permissions (user or admin). You can then manage the monitoring contacts from there.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
karthek
Posts: 64
Joined: Fri Aug 14, 2015 5:55 am
Location: INDIA

Re: Unable to create user out of XI web UI

Post by karthek »

jomann wrote:You won't be able to log in because the password is a hash that is saved in the database
Thank you for that piece of information, i have added a hash value of a test password and the user is able to login successfully.

Now there are only few things that i need to add/set.

force the user for password change. Any idea where this flag can be set in db/config files?

I have given the permissions to view all the hosts and services to the user in the cgi.cfg file and yet user is not able to see any hosts/services. Any suggestions what else needs to be done?
"Machines don't make mistakes, we do."
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

Re: Unable to create user out of XI web UI

Post by jomann »

Unfortunately the rest of this is outside the scope of our support. If you'd like to proceed you'll have to look through and find out what you want to add yourself -- we won't be able to support this method of adding users.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
karthek
Posts: 64
Joined: Fri Aug 14, 2015 5:55 am
Location: INDIA

Re: Unable to create user out of XI web UI

Post by karthek »

Well, I'll try to find a way then.

Thank you for your support. You may lock the thread.
"Machines don't make mistakes, we do."
Locked