patricegautier / unifiZabbix

Zabbix templates to monitor pretty much all Unifi devices
183 stars 36 forks source link

Exit code 127 from mca-dump-short.sh on Docker Zabbix Server #48

Closed kastrm01 closed 2 years ago

kastrm01 commented 2 years ago

Hi,

I tried to execute the test command:

_docker exec zabbix-server /usr/lib/zabbix/externalscripts/mca-dump-short.sh -d -u -i /var/lib/zabbix/ssh_keys/zb_id_rsa -t <UDMP|AP|SWITCH|CK>_

from a docker image of Official Zabbix Server (Alpine Linux 3.15). I ensured that the jq package was installed by issuing the jq --version command (returned v1.6), from inside the docker instance (i extended the docker image myself, to include the JQ package).

However, i get the following error: {"mcaDumpError":"Error", "reason":"time out with exit code 127" }

Am i missing something during configuration, for a dockerized version of zabbix server? PS: From the host VM itself, i get a JSON answer successfully.

UntestedEngineer commented 2 years ago

So a couple of things for clarity.

You need both jq and openssh-server installed into the docker image. Neither the zabbix-server alpine or ubuntu image come with them by default. You mentioned jq so just wanted to make sure you have openssh-server installed as well.

What container runtime are you using?

With all that said I have personally had better results using the zabbix-server ubuntu base image as it has been more reliable for successful ssh connections.

Then again it could produce variable results based on the container runtime. I have been using a k3s cluster.

On Tue, Jun 7, 2022, 9:52 AM Marios Kastrinakis @.***> wrote:

Hi,

I tried to execute the test command: docker exec zabbix-server /usr/lib/zabbix/externalscripts/mca-dump-short.sh -d -u -i /var/lib/zabbix/ssh_keys/zb_id_rsa -t <UDMP|AP|SWITCH|CK> from a docker image of Official Zabbix Server (Alpine Linux 3.15). I ensured that the jq package was installed first by issuing the jq --version command (returned v1.6). However, i get the following error: {"mcaDumpError":"Error", "reason":"time out with exit code 127" }

Am i missing something during configuration, for a dockerized version of zabbix server? PS: From the host VM itself, i get a JSON answer successfully.

— Reply to this email directly, view it on GitHub https://github.com/patricegautier/unifiZabbix/issues/48, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZPBTVGEW6I3K2LRHRFYT2TVN5HY7ANCNFSM5YDAY44A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

kastrm01 commented 2 years ago

Yes! That was what i missed to include. After installing openssh-server, it worked instantly.

Till now, it works with no problems. If i observe any issues, i will change to ubuntu server base image, as you suggested.

Thank you for your help!

PS: I use docker engine ce.