# Icingaweb kicks back exit code 127 when running a check

**URL:** <https://community.icinga.com/t/icingaweb-kicks-back-exit-code-127-when-running-a-check/4053>\
**Category:** Service Monitoring\
**Created:** [April 9, 2020, 5:02pm UTC](https://community.icinga.com/t/icingaweb-kicks-back-exit-code-127-when-running-a-check/4053 "2020-04-09T17:02:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbgoins](https://community.icinga.com/letter_avatar_proxy/v4/letter/j/eb8c5e/32.png) [@jbgoins](https://community.icinga.com/u/jbgoins)\
**Post date:** [April 9, 2020, 5:02pm UTC](https://community.icinga.com/t/icingaweb-kicks-back-exit-code-127-when-running-a-check/4053/1 "2020-04-09T17:02:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![stevie-sy](https://community.icinga.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@stevie-sy](https://community.icinga.com/u/stevie-sy)\
**Post date:** [April 10, 2020, 8:50am UTC](https://community.icinga.com/t/icingaweb-kicks-back-exit-code-127-when-running-a-check/4053/2 "2020-04-10T08:50:49Z")

</div>

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](https://stackoverflow.com/questions/1763156/127-return-code-from)

---

<div class="post-metadata">

**Author:** ![jbgoins](https://community.icinga.com/letter_avatar_proxy/v4/letter/j/eb8c5e/32.png) [@jbgoins](https://community.icinga.com/u/jbgoins)\
**Post date:** [April 10, 2020, 12:11pm UTC](https://community.icinga.com/t/icingaweb-kicks-back-exit-code-127-when-running-a-check/4053/3 "2020-04-10T12:11:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![stevie-sy](https://community.icinga.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@stevie-sy](https://community.icinga.com/u/stevie-sy)\
**Post date:** [April 14, 2020, 5:01am UTC](https://community.icinga.com/t/icingaweb-kicks-back-exit-code-127-when-running-a-check/4053/4 "2020-04-14T05:01:35Z")

</div>

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

> [@jbgoins](#):
>
> Remote command “/opt/monitoring/check\_service.sh -s docker” returned status 127”

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

---

<div class="post-metadata">

**Author:** ![jbgoins](https://community.icinga.com/letter_avatar_proxy/v4/letter/j/eb8c5e/32.png) [@jbgoins](https://community.icinga.com/u/jbgoins)\
**Post date:** [April 14, 2020, 11:27am UTC](https://community.icinga.com/t/icingaweb-kicks-back-exit-code-127-when-running-a-check/4053/5 "2020-04-14T11:27:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ls440](https://community.icinga.com/user_avatar/community.icinga.com/ls440/32/5923_2.png) [@ls440](https://community.icinga.com/u/ls440)\
**Post date:** [September 16, 2022, 6:41am UTC](https://community.icinga.com/t/icingaweb-kicks-back-exit-code-127-when-running-a-check/4053/6 "2022-09-16T06:41:54Z")

</div>

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
