1

Topic: 如何修改 /opt/netdata/usr/libexec/netdata/plugins.d/python.d.plugin

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer?No
- Linux/BSD distribution name and version: CentOS7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro?Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
default:
/opt/netdata/usr/libexec/netdata/plugins.d/python.d.plugin

第25行:
USER_CONFIG_DIR = os.getenv('NETDATA_USER_CONFIG_DIR', '/usr/local/etc/netdata')
STOCK_CONFIG_DIR = os.getenv('NETDATA_STOCK_CONFIG_DIR', '/usr/local/lib/netdata/conf.d')

會有下面log 訊息:

改為下面兩行: 無此錯誤log

USER_CONFIG_DIR = os.getenv('NETDATA_USER_CONFIG_DIR', '/opt/netdata/usr/lib/netdata/conf.d')
STOCK_CONFIG_DIR = os.getenv('NETDATA_STOCK_CONFIG_DIR', 
'/opt/netdata/usr/local/lib/netdata/conf.d')

#sudo su -s /bin/bash netdata
$/opt/netdata/usr/libexec/netdata/plugins.d/python.d.plugin 1 debug trace mariadb
default的python.d.plugin 檔案 ,測試 mariadb 的log:

2019-01-14 14:55:46: python.d INFO: plugin: main: Using python 2
2019-01-14 14:55:46: python.d DEBUG: plugin: main: loading '/usr/local/etc/netdata/python.d.conf'
2019-01-14 14:55:46: python.d ERROR: plugin: main: cannot load '/usr/local/etc/netdata/python.d.conf': [Errno 2] No such file or directory: '/usr/local/etc/netdata/python.d.conf'. Will try stock version.
2019-01-14 14:55:46: python.d DEBUG: plugin: main: loading '/usr/local/lib/netdata/conf.d/python.d.conf'
2019-01-14 14:55:46: python.d ERROR: plugin: main: cannot load '/usr/local/lib/netdata/conf.d/python.d.conf': [Errno 2] No such file or directory: '/usr/local/lib/netdata/conf.d/python.d.conf'

請問版主, 應如何設定才好?

Thanks.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: 如何修改 /opt/netdata/usr/libexec/netdata/plugins.d/python.d.plugin

- 为何需要修改 /opt/netdata/usr/libexec/ 底下的文件?
- netdata 会读取 /opt/netdata/etc/netdata/python.d/ 底下的配置文件,你应该修改这个目录下的文件。