omni-lchen / zabbix-mongodb

MIT License
58 stars 73 forks source link

My way to make all thing work #38

Open rams007 opened 3 years ago

rams007 commented 3 years ago

I will share my experience. After I did everything according to the instructions, nothing worked for me anyway. what I did about what is not described by the author: 1 In Mongo, there must be a user with a root / created like this if it is not there

db.createUser (
  {
    user: 'admin',
    pwd: 'password',
    roles: [{role: 'root', db: 'admin'}]
  }
);
  1. You must have Python and the pymongo library installed. 3 You need to edit the file /usr/local/bin/zabbix-mongodb.py and specify the settings for connecting to the database there. 4 you can check all the previous steps with the command: python /usr/local/bin/zabbix-mongodb.py you should see statistics. if not, then the previous steps were not done correctly. 5 MOST IMPORTANT /etc/zabbix/zabbix_agentd.conf Hostname = NAME SPECIFIED IN ZABIX ADMIN WHEN ADDING A HOST! This is not real host name of your server. It can be any text string

I hope it will be useful to someone.

rajamohan-rpx commented 3 years ago

@rams007, Thanks alot for the update. I was able to configure it in my environment without any problems.

FYI, granting admin role for a monitoring user is not recommended. I have assigned "clusterMonitor" role alone which is able to fetch all the necessary stats. I tested it in standalone instance, it is working fine. [No replica]

db.createUser ( { user: 'zabbix_user', pwd: 'password', roles: [{role: 'clusterMonitor', db: 'admin'}] } );