login user gone??

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
itsupport_sgp
Posts: 19
Joined: Fri Aug 15, 2014 12:06 am

login user gone??

Post by itsupport_sgp »

Hi,

I have just added a new nagios log server instance and after rebooting both instance, I'm not able to login anymore.
It says users do not exist??
Have tried the default 'nagiosadmin' account and it is not working too.

Any help would be appreciated.

Thanks.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: login user gone??

Post by lmiltchev »

You can try resetting the nagiosadmin password by running in the CLI:

Code: Select all

cd /usr/local/nagioslogserver/scripts
./reset_nagiosadmin_password.sh -p <your new password>
where you substitute the <your new password> with your actual password. Let me know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
itsupport_sgp
Posts: 19
Joined: Fri Aug 15, 2014 12:06 am

Re: login user gone??

Post by itsupport_sgp »

lmiltchev wrote:You can try resetting the nagiosadmin password by running in the CLI:

Code: Select all

cd /usr/local/nagioslogserver/scripts
./reset_nagiosadmin_password.sh -p <your new password>
where you substitute the <your new password> with your actual password. Let me know if this helped.

Hi,

It seems like even the nagiosadmin userid is gone as it says 'The username specified does not exist.'
It is not working even after doing the password reset.

Any ideas on how to create an userid via the CLI?

Thanks.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: login user gone??

Post by scottwilkerson »

Can you execute the following from the CLI and see if any users exist

Code: Select all

curl "http://localhost:9200/nagioslogserver/user/_search?pretty"
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
itsupport_sgp
Posts: 19
Joined: Fri Aug 15, 2014 12:06 am

Re: login user gone??

Post by itsupport_sgp »

scottwilkerson wrote:Can you execute the following from the CLI and see if any users exist

Code: Select all

curl "http://localhost:9200/nagioslogserver/user/_search?pretty"
User not found.

[root@sgpnagioslog1 nagioslogserver]# curl "http://localhost/nagioslogserver/user/_ ... agiosadmin"
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /nagioslogserver/user/_search was not found on this server.</p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at localhost Port 80</address>
</body></html>
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: login user gone??

Post by tgriep »

Can you run this command exactly like it is and post the results?

Code: Select all

curl "http://localhost:9200/nagioslogserver/user/_search?pretty"
Be sure to check out our Knowledgebase for helpful articles and solutions!
itsupport_sgp
Posts: 19
Joined: Fri Aug 15, 2014 12:06 am

Re: login user gone??

Post by itsupport_sgp »

tgriep wrote:Can you run this command exactly like it is and post the results?

Code: Select all

curl "http://localhost:9200/nagioslogserver/user/_search?pretty"
[root@sgpnagioslog1 ~]# curl "http://localhost:9200/nagioslogserver/u ... rch?pretty"
{
"took" : 0,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
}
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: login user gone??

Post by tmcdonald »

Run this from the CLI as root exactly as written, with the newline after "-d":

Code: Select all

curl -XPUT 'http://localhost:9200/nagioslogserver/user/2' -d '{"username":"someuser","password":"c678bcf3b5138b9263a95c44d28097f22c2e02877193d2c25313478821d45c19","auth_type":"admin","email":"[email protected]","language":"default","apiaccess":"1","apikey":"1396e08757545557073844695e5b64caa0bd3ad3","created":"2015-01-23 10:00:00","created_by":0,"default_dashboard":"/dashboard/elasticsearch/default"}'
This will create a user named "someuser" with the password "nagiosls". You can use this account to log in and optionally create the accounts that you need, then delete the "someuser" account as one of the other users when done.
Former Nagios employee
riconeo
Posts: 35
Joined: Mon Oct 14, 2013 8:32 am

Re: login user gone??

Post by riconeo »

Great tip!

Issue resolved now.

However, I still don't get it why the accounts are gone by itself. :(
Locked