Page 1 of 2

NLS 2.1.9 Fresh install can't login using nagiosadmin

Posted: Thu Sep 16, 2021 9:37 am
by benhank
I did a fresh install of NLS 2.1.9 on two clean centos7 servers , created the cluster, installed license keys, but the Nagiosadmin password I made does not work.
I logged into the cli and ran

Code: Select all

/usr/local/nagioslogserver/scripts/reset_nagiosadmin_password.sh
on both servers but it still doesn't work.


to make it even more confusing, I also installed nls on my clean test server as stated above, and the password works fine.
So I have one server that works fine and two that don't.

Re: NLS 2.1.9 Fresh install can't login using nagiosadmin

Posted: Thu Sep 16, 2021 4:47 pm
by gsmith
Hi

Did you get any error messages? Or any messages at all?

Thanks

Re: NLS 2.1.9 Fresh install can't login using nagiosadmin

Posted: Fri Sep 17, 2021 1:31 pm
by benhank
nothing. no errors when i run the script. and all I get from the gui is the standard "incorrect password".

Re: NLS 2.1.9 Fresh install can't login using nagiosadmin

Posted: Fri Sep 17, 2021 2:29 pm
by gsmith
Hi,

Ok let's deconstruct the script to see what's going on.

In a CLI execute:

Code: Select all

service elasticsearch status
The output should be similar to:
[root@GS-Centos8-LSmaster-23-89 ~]# service elasticsearch status
● elasticsearch.service - LSB: This service manages the elasticsearch daemon
Loaded: loaded (/etc/rc.d/init.d/elasticsearch; generated)
Active: active (running) since Thu 2021-09-09 10:14:09 CDT; 1 weeks 1 days ago
Docs: man:systemd-sysv-generator(8)
Process: 1160 ExecStart=/etc/rc.d/init.d/elasticsearch start (code=exited, status=0/SUCCESS)
Tasks: 49 (limit: 49760)
Memory: 5.1G
CGroup: /system.slice/elasticsearch.service
└─1576 /bin/java -Xms3905m -Xmx3905m -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSw>
with the key being "Active: active (running)", if it shows as stopped then the script won't work.

Next run the following commands in the CLI. If you get an error message at any point please send a screenshot of the
CLI with the command and error message. In the first command substitute your desired password for "new123"

Code: Select all

set newpass=new123
passhash=$(printf "$newpass" | openssl sha256)
passhash=${passhash:9}
update="{\"doc\":{\"password\":\"$passhash\"}}"curl -XPOST http://localhost:9200/nagioslogserver/user/1/_update -d "$update" > /dev/null 2>&1
curl -XPOST http://localhost:9200/nagioslogserver/_refresh > /dev/null 2>&1
Thanks

Re: NLS 2.1.9 Fresh install can't login using nagiosadmin

Posted: Fri Sep 17, 2021 3:08 pm
by benhank

Code: Select all

service elasticsearch status
● elasticsearch.service - LSB: This service manages the elasticsearch daemon
   Loaded: loaded (/etc/rc.d/init.d/elasticsearch; bad; vendor preset: disabled)
   Active: active (running) since Fri 2021-09-17 15:56:47 EDT; 3min 38s ago
     Docs: man:systemd-sysv-generator(8)
   CGroup: /system.slice/elasticsearch.service
           └─28116 /bin/java -Xms32132m -Xmx32132m -Djava.awt.headless=true -...
I ran the cli instructions you gave me by cutting and pasting and it did not work.

On a side note, is it possible to uninstall NLS and start fresh from scratch?

Re: NLS 2.1.9 Fresh install can't login using nagiosadmin

Posted: Fri Sep 17, 2021 4:10 pm
by gsmith
HI

When you say:
I ran the cli instructions you gave me by cutting and pasting and it did not work.
Does that mean all the commands ran with no errors but you couldn't log in with the password "new123" ?


Take a look at the logs in /var/log/elasticsearch and see if you can see any errors.
On a side note, is it possible to uninstall NLS and start fresh from scratch?
There really isn't a way to perform an uninstall of NLS. To start fresh you would need to re-install
a minimal image of Centos 7, and then run a fullinstall of NLS.

Thanks

Re: NLS 2.1.9 Fresh install can't login using nagiosadmin

Posted: Mon Sep 20, 2021 8:49 am
by benhank
gsmith wrote:When you say:

I ran the cli instructions you gave me by cutting and pasting and it did not work.



Does that mean all the commands ran with no errors but you couldn't log in with the password "new123" ?
yes.
I checked the log files . They are blank

Re: NLS 2.1.9 Fresh install can't login using nagiosadmin

Posted: Mon Sep 20, 2021 10:56 am
by benhank
i've pmed my system profile to you

Re: NLS 2.1.9 Fresh install can't login using nagiosadmin

Posted: Mon Sep 20, 2021 12:35 pm
by benhank
so good news . I did a restore from my working test server. now I can login. But the test server was not attached to a cluster, so each of the Prod servers now are standalone. How do I manually add a server to the cluster?

Re: NLS 2.1.9 Fresh install can't login using nagiosadmin

Posted: Mon Sep 20, 2021 4:54 pm
by ssax
I think by doing that on the second one now you'll need to spin up a new one and freshly connect it as my research indicates it it can impact your existing cluster so is not recommended/supported.