omni-lchen / zabbix-mongodb

MIT License
58 stars 73 forks source link

script error #26

Closed flover97 closed 2 years ago

flover97 commented 5 years ago

python /usr/local/bin/zabbix-mongodb.py Error while fetching replica set configuration.Not a member of replica set? Traceback (most recent call last): File "/usr/local/bin/zabbix-mongodb.py", line 247, in mongodb.get_server_status_metrics() File "/usr/local/bin/zabbix-mongodb.py", line 171, in get_server_status_metrics self.add_metrics('mongodb.storageEngine', ss['storageEngine']['name']) KeyError: 'storageEngine'

mongod --version db version v2.4.14

Please help me=)

flover97 commented 5 years ago

This field is missing in version 2.4, need to comment out the following lines:

#        self.add_metrics('mongodb.storageEngine', ss['storageEngine']['name'])
    #wired tiger
#    if ss['storageEngine']['name'] == 'wiredTiger':
#        self.add_metrics('mongodb.used-cache',
#                         ss['wiredTiger']['cache']
#                         ["bytes currently in the cache"])
#        self.add_metrics('mongodb.total-cache',
#                         ss['wiredTiger']['cache']
#                         ["maximum bytes configured"])
#        self.add_metrics('mongodb.dirty-cache',
#                         ss['wiredTiger']['cache']
#                         ["tracked dirty bytes in the cache"])