petrushinvs / mongodb-zabbix-templates-4.0

mongodb zabbix templates rewritten in python with mongodb 4 support
MIT License
19 stars 14 forks source link

getting this error!!! Pls help on this #3

Open prabhinmp opened 5 years ago

prabhinmp commented 5 years ago

Traceback (most recent call last): File "/usr/lib/zabbix/externalscripts/mongod-db.py", line 35, in r = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) File "/usr/lib64/python2.7/subprocess.py", line 711, in init errread, errwrite) File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

petrushinvs commented 5 years ago

Hello, prabhinmp, please install latest mongodb-org-tools and mongodb-org-shell packages. It tries to find and execute mongostat command in PATH.

prabhinmp commented 5 years ago

As you said installed the required package, still no data fetched from the mongodb server.

mihica123 commented 5 years ago

I confirm this problem. Traceback (most recent call last): File "/usr/lib/zabbix/externalscripts/mongod-db.py", line 35, in <module> r = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) File "/usr/lib/python2.7/subprocess.py", line 394, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

both packages mongodb-org-tools and mongodb-org-shell up to date

petrushinvs commented 5 years ago

This because of subprocess.Popen(...) can't find mongostat binary in PATH. I can't reproduce it in Ubuntu and have no capabilities to debug it in Centos/RHEL. You can fix it yourself. In line 34 cmd = ['mongostat', "-u", muser, "-p", mpass, "-h",.... add full path to mongostat binary. Like this cmd = ['/full/path/to/mongostat', "-u", muser, "-p", mpass, "-h",...