NLS 2.1.9 Fresh install can't login using nagiosadmin

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

NLS 2.1.9 Fresh install can't login using nagiosadmin

Post 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.
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

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

Post by gsmith »

Hi

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

Thanks
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

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

Post by benhank »

nothing. no errors when i run the script. and all I get from the gui is the standard "incorrect password".
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

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

Post 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
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

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

Post 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?
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

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

Post 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
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

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

Post 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
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

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

Post by benhank »

i've pmed my system profile to you
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

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

Post 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?
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post 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.
Locked