Nagios 'check_by_ssh' error "Remote command execution failed: stdin: is not a tty"
We run Nagios to monitor our servers and services. While I was setting up a new server to be monitored via 'check_by_ssh', I kept getting an error "Remote command execution failed: stdin: is not a tty". I could ssh into the server just fine with the nagios user and execute the remote command manually, however, it would not run using the 'check_by_ssh' command. I finanly found my problem.
We run Nagios to monitor our servers and services. While I was setting up a new server to be monitored via 'check_by_ssh', I kept getting an error "Remote command execution failed: stdin: is not a tty". I could ssh into the server just fine with the nagios user and execute the remote command manually, however, it would not run using the 'check_by_ssh' command. I finanly found my problem.
The setup was the same as most of our other servers and they were all working fine. Something about this server was causing the remote check to fail. One major difference was that this server had been hardened with Bastille. I assumed Bastille had changed something for security reasons but I didn't know what.
After an hour or so of googling I came across a random post that a guy was having a similar issue while using 'scp'. Although it didn't directly apply, he mentioned something in the bash profile or bash rc file was causing the issues.
After much trial and error, the problem was that, in my case, Bastille had set a bash message. Something to the effect of "No unathorized use", etc. Commenting out the 'mesg y' line in my /etc/bashrc fixed the issue.
I'm assuming that the remote command execution was getting hung up in the message prompt.
Odin Development Drupal Partners


