Tag Archives: Ubuntu

Check_mk: UNKNOWN – Agent exited with code 255: Pseudo-terminal will not be allocated because stdin is not a terminal.

I had this error pop up today:

UNKNOWN – Agent exited with code 255: Pseudo-terminal will not be allocated because stdin is not a terminal.

On a remote agent over SSH. Which I described here in check_mk_agent over SSH Host key verification failed

Turns out that the box in question could contact the outside world (a simple ping google.com was able to tell me that).

The problem? I had recently tighten the firewall rules on ufw

ufw allow out http
ufw allow out https
ufw allow out 53

Resolved the issue.

Thanks to TWright for the answer that pointed me in the right direction on Serverfault

check_mk_agent over SSH Host key verification failed

Service discovery failed for this host: Agent exited with code 255: Pseudo-terminal will not be allocated because stdin is not a terminal. Host key verification failed.

Current Setup: Ubuntu 14.04 running OMD

Solution: Running the ssh command from the OMD user appears to fix the problem by allowing them into the known hosts list.

Here’s how:

[email protected]_vm:~$ sudo su
[sudo] password for linuxuser:
[email protected]_vm:/home/scadmin# su [omd-site-name]
ubuntu_vm[[omd-site-name]]:~$

then run your remote command eg:

ubuntu_vm[[omd-site-name]]:~$ ssh -l root -i /etc/check_mk/check_mk.key [ip]

It will ask to save the host to the known hosts, type yes and enter. It should then output the status from the check_mk agent.