-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check_by_ssh unknown command returns 255 #1022
Comments
Are you sure your Nagios user has proper ssh host keys for the remote servers? |
More specifically, you have to run the command on your Nagios box as the nagios user. I'm guessing you're running it as root. |
The ssh key is working. because i can ssh in to the remote client servers using nagios user without password |
I am running the command as a naios user, not as aroot |
Dumb it down a bit and see what happens when you do this on your Nagios server, as root:
This will tell you if there are any problems with the SSH connection itself. If there are not, then log out of the remote host and do this (this assumes you're still the nagios user on your Nagios box):
This will tell you if you're able to execute remote commands properly on the remote host. I'll wait for further response, because I still believe you have a basic SSH connection issue of some sort. |
ssh - i /usr/local/nagios/.ssh/id_ecdsa ssh -i /usr/local/nagios/.ssh/id_ecdsa /usr/local/nagios/libexec/check_dummy 0 |
Whoops, yes, I forgot the -i part. :-) So I'm wrong - you do have a working SSH connection, which is great! So then (as the nagios user):
If that works, then we have something really weird going on. |
No worries, it happens |
So everything works when you pretend to be nagios, but when Nagios itself does the check, you get a timeout? Are any of your check_by_ssh checks working or are they all returning 255? |
None of them are working. All check_by_ssh checks are returning a status of 255. Ports like 22 and 53, as well as DNS services, are functioning correctly since they are not utilizing the check_by_ssh command. |
You might want to try without Have you verified that the connections are being made to the sshd server? Also check For example, put this as
Hopefully something here will give some more info to go on. |
I migrated Nagios Core 4.x from a retired CentOS server to rocky 9, and I mirrored all the configuration files after installing and configuring Nagios on the new rocky 9 server. However, on the web monitoring portal, all the client server services show " UNKNOWN" status
UNKNOWN - check_by_ssh: Remote command '/usr/local/nagios/libexec/check_disk -w 10% -c 5% -u MB -p /boot -p /boot/efi' returned status 255$HOSTADDRESS$ -C "/usr/local/nagios/libexec/check_disk -w 10% -c 5% -u GB -p /" -E -t 60, it works,
I ran this command manually using a nagios user for each client server, and the command returned as expected.
Also, I ran the whole command from /usr/local/nagios/libexex to the remote servers, and it works as expected, which means it shows the status of the disk of the client server.
./check_by_ssh -o User=nagios -i /usr/local/nagios/.ssh/id_ecdsa -H
Does anyone know why it shows UNKNOWN status on the web interface?
The text was updated successfully, but these errors were encountered: