I am trying to restart my test-container with shell script. The script works well when directly executing but not working with Nagios.
This command is working while executing with Nagios:
echo -e "\n$DATE: ML flow container restarted ." >> /var/log/container-restart.log
Just wants to provide info: The service state change and script execution is working. But the following command is not working:
echo "xxxx" | sshpass -p 'xxxx' ssh -tt abc@host 'sudo -S docker start test-container'
Need help in figuring out the issue with following command:
echo "xxxx" | sshpass -p 'xxxx' ssh -tt abc@host 'sudo -S docker start test-container'