Icingaweb kicks back exit code 127 when running a check

Icinga2 version 2.11.3-1 running on RHEL version 7.8
kernel version: 3.10.0-1127.el7.x86_64
Check works fine when executed from Icingaserver command line. Icingaweb result from /var/log/icinga2/debug.log output:

terminated with exit code 127.

Could you show us the output from the debug log? So which check, how icinga calls it etc.

Because exit code 127 means “command not found” - look at here https://stackoverflow.com/questions/1763156/127-return-code-from

OK, thank you for the error code explanation. Am I missing something in debug that would have told me more?
2020-04-10 04:27:24 warning/PluginCheckTask: Check command for object '“host” PID…"/usr/lib64/nagios/plugins/check_by_ssh -C “opt/monitoring/check_service.sh -s “docker” -E -H XX.XX.XX.XX terminated with exit code 127.output:
UNKNOWN - check_by_ssh: Remote command “/opt/monitoring/check_service.sh -s docker” returned status 127” was the debug log output…

I could not find a good explanation across Google that explained the error code. I noticed that for my check_service.sh check, I had it as check_service"s".sh, even though I was doing it correct from the command line. Cut and paste would have saved me some pain.

it seems that this is the problem - the remote server:

das this script exists there? are the (file) permissions correct?

Solution was simple. I had added an “s” to the end of the filename when setting it up in director…

1 Like

Hi i am facing same error

/usr/lib64/nagios/plugins/check_by_ssh -C “/usr/local/check_script.sh -E
UNKNOWN - check_by_ssh: Remote command returned status 127

you added s to the file name means to the script ?

when i pass -s parameter, then it asks for password

can you please help