Nagios : event handle for container restart

36 Views Asked by At
  1. I am trying to restart my test-container with shell script. The script works well when directly executing but not working with Nagios.

  2. 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'
0

There are 0 best solutions below