When trying to setup disk checks in nagios for a new VPS, I came across the error “(Return code of 255 is out of bounds)”. Searching around a few forums I wasn’t able to figure out why Nagios was giving me this error…
As it turns out it was quite a simple problem! Having never actually used the Nagios user account to SSH into the server for which I was trying to check the disk, when running the command
ssh user@host /usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /
the ssh client was asking
The authenticity of host '\[host\]:22 (\[xxx.xxx.xxx.xxx\]:22)' can't be established.
RSA key fingerprint is xx:xx:xx.
Are you sure you want to continue connecting (yes/no)?
so the ssh command wasn’t able to return the result from the Nagios Disk Check plugin.
So simply logging in as the nagios user and connecting to the remote server via SSH and adding the remote host to the known hosts my nagios plugin worked fine! I know this isn’t going to be the solution to this error code for everyone, but it does give something simple to check that is quite easy to overlook.