nagiosadmin script does not work
Posted: Wed Apr 03, 2024 4:59 am
Hello
This isnt the first time this has happened but when moving the data directory, I get a "Invalid username or password."
I run the script to reset the password and still same thing.
The pass could be simple, could be complex. It does not work.
When I manually run the commands in the script:
[root@server ~]# newpass="12345"
[root@server ~]# $newpass
-bash: 12345: command not found
[root@server ~]# passhash=$(printf "$newpass" | openssl sha256)
[root@server ~]# passhash=${passhash:9}
[root@server ~]# update="{\"doc\":{\"password\":\"$passhash\"}}"
[root@server ~]# curl -XPOST http://localhost:9200/nagioslogserver/user/1/_update -d "$update"
{"error":"DocumentMissingException[[nagioslogserver][0] [user][1]: document missing]","status":404}[root@server ~]#
So it doesnt even find the nagiosadmin user?
Please do not make me reinstall Nagios Log Server AGAIN.
On a side note, how do I get old logs/indexes imported back to another Nagios Log Server? I already have a bunch of logs and wouldnt like to lose them.
This isnt the first time this has happened but when moving the data directory, I get a "Invalid username or password."
I run the script to reset the password and still same thing.
The pass could be simple, could be complex. It does not work.
When I manually run the commands in the script:
[root@server ~]# newpass="12345"
[root@server ~]# $newpass
-bash: 12345: command not found
[root@server ~]# passhash=$(printf "$newpass" | openssl sha256)
[root@server ~]# passhash=${passhash:9}
[root@server ~]# update="{\"doc\":{\"password\":\"$passhash\"}}"
[root@server ~]# curl -XPOST http://localhost:9200/nagioslogserver/user/1/_update -d "$update"
{"error":"DocumentMissingException[[nagioslogserver][0] [user][1]: document missing]","status":404}[root@server ~]#
So it doesnt even find the nagiosadmin user?
Please do not make me reinstall Nagios Log Server AGAIN.
On a side note, how do I get old logs/indexes imported back to another Nagios Log Server? I already have a bunch of logs and wouldnt like to lose them.