omni-lchen / zabbix-mongodb

MIT License
58 stars 73 forks source link

It isn't working #6

Open gustavofs01 opened 7 years ago

gustavofs01 commented 7 years ago

Is return message error below:

sh -x /usr/local/bin/mongodb-stats.sh

My settings:

mongod --version db version v3.4.9 git version: 876ebee8c7dd0e2d992f36a848ff4dc50ee6603e OpenSSL version: OpenSSL 1.0.1t 3 May 2016 allocator: tcmalloc modules: none build environment: distmod: debian81 distarch: x86_64 target_arch: x86_64

lsb_release -a

No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 8.5 (jessie) Release: 8.5 Codename: jessie

omni-lchen commented 6 years ago

Please test the script first "zabbix-mongodb.py" see if you can any results, the version of mongodb we tested might be different from yours, so the list of metrics might be different, you need to tweak the script a bit.

omegazeng commented 6 years ago

I have tested with zabbix 3.4 / mongodb 4.0.1 It works! @gustavofs01 Python String need quote sign.

use admin
db.createUser({
    user: "monit",
    pwd: "passw0rd",
    roles: [
        { role: "clusterMonitor", db: "admin" },
        { role: "read", db: "local" }
    ]
})
        self.mongo_user = "monit"
        self.mongo_password = "passw0rd"