unable to add new users in nagios Web interface

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

unable to add new users in nagios Web interface

Post by ravish78 »

We re facing issue while adding user to nagios web GUI.

ERROR: UNABLE TO ADD USERID
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: unable to add new users in nagios Web interface

Post by abrist »

1. Are you trying to add the user as an admin user?
2. Is postgres running?

Code: Select all

service postgresql status
3. Does this error happen from any user, for any new user, or is it specific to just a particular admin and potential username?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: unable to add new users in nagios Web interface

Post by ravish78 »

It happens for all new users.

We are doing as admin user

postgres is running

tmproot@usa7061lv955>service postgresql status
postmaster (pid 31150 25048 23649 21448 21058 20532 19250 17387 12859 11638 11485 11353 9945 9790 9488 9487 9486 9484 9469 8101 6835 5095 2885 2695 2665 2652 2628 539) is running...
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: unable to add new users in nagios Web interface

Post by slansing »

Is this happening for other users you try to add as well? Try a new user, with no current contact or any associations. The problem we may be seeing here is the user is already listed in the postgres database but it is not being pulled into XI properly. We may have to list the table and manually remove that user if it is there.
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: unable to add new users in nagios Web interface

Post by ravish78 »

We have problem with one user account which is already created who is unable to acknowledge alerts.

So we removed his id with following commands:

echo "select object_id from nagios_objects,nagios_contacts where object_id=contact_object_id and name1='w3y6rm70';"|mysql -pnagiosxi nagios
echo "select object_id from nagios_objects where name1='w3y6rm70';"|mysql -pnagiosxi nagios

echo "DELETE from nagios_objects where object_id=4780;"|mysql -pnagiosxi nagios

Remove contact from hosts and services
Then we tried to create his id again and we got this error.Also now we are not able to create other users too.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: unable to add new users in nagios Web interface

Post by abrist »

The user information is stored in postgres, not mysql. . .
Can you run a repair on mysql, and then try to create a user again?
Additionally, the object configs are in the nagiosql mysql database, not the nagios mysql database. You may have removed historical information . . . .

Code: Select all

service mysqld stop
/usr/local/nagiosxi/scripts/repairmysql.sh nagios
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: unable to add new users in nagios Web interface

Post by sreinhardt »

How long ago has this happened? The user information, short of contacts for nagios core, is not contained in mysql but in postgres. Likely if you have backups or if it has happened within a few days where our automated backups might still be in place with a good copy, it would be a good suggestion to restore from the most recent backup, prior to these commands.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: unable to add new users in nagios Web interface

Post by ravish78 »

We have old backups but we did many modifications after that

-bash-3.2$ ls -lrt /store/backups/
total 12
drwx------ 6 root root 4096 Jul 29 13:30 nagiosxi
drwxr-xr-x 5 root root 4096 Sep 8 07:01 mysql
drwxr-xr-x 5 root root 4096 Sep 8 08:00 postgresql

Do we need to redo again all changes if we restore .


Note:we faced issue couple of days back. It worked fine till then
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: unable to add new users in nagios Web interface

Post by abrist »

What changed a couple of days ago? Any new packages, updates, etc? Any errors, power issues, etc?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: unable to add new users in nagios Web interface

Post by ravish78 »

we had issue with some users who are unable to acknowledge alerts and schedule downtime.
So we tried removing one user id and recreating it again.After that we got this issue.
We did not try for other users.
We cannot create the removed id as well as any new id in manage users.
Locked