Without knowing exactly what you’re doing and without any comments on whether this is the right way to do it:
STBY=$(ssh db0.dev.ng.keepit.com) sudo crm node show $(hostname) | awk '/standby/ {gsub("standby=","");print$2}'
should probably be:
STBY=$(ssh db0.dev.ng.keepit.com sudo crm node show $(hostname) | awk '/standby/ {gsub("standby=","");print$2}')
(the closing )
is in the wrong place).