Can anyone clarify for me why the following code is not running when I place it in command_line for a custom Nagios command? It works when I run it in terminal.
command_name notify-host-by-sms
commnad_line echo -e "AT+CMGS="$CONTACTPAGER$"\r" | socat -t3 - TCP:XXX.XXX.XXX.XXX:10002 && echo -e "$HOSTNAME$ $HOSTSTATE$ $HOSTADDRESS$ $LONGDATETIME$\x1A" | socat - TCP:XXX.XXX.XXX.XXX:10002