You can try running the command as the nagios user again but enabling verbose mode by adding the -vvv to the command like the example below. That may tell you why it it not working.
Code: Select all
su - nagios
sshpass -p 'P@ssword123*' ssh -vvv -tt -l [email protected] 10.0.254.4 'schtasks /Run /TN Shutdown_ALL_INFRA'