Hi,
Ok let's deconstruct the script to see what's going on.
In a CLI execute:
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