你好,我在命令行使用如下:
[root@s1 scripts]# python mysql_all.py -k threads_connected
1
在zabbix_get下无返回:
[root@jn53 bin]# ./zabbix_get -s 163.com -p 10050 -k "mysql.item[threads_connected]"
tmp下面的log以及txt已经全部777权限,zabbix_get调用报错如下:
[2018-05-17 16:18:01] INFO
msg: Try To Get From Cache File: /tmp/.zabbix_mysql_variables_slave_status_3306_by_zabbix.txt
key: threads_connected
value: None
[2018-05-17 16:18:01] ERROR
Traceback (most recent call last):
File "/etc/zabbix/scripts/mysql_all.py", line 47, in get_mysql_cmd_output
if os.path.isfile(p):
File "/usr/lib64/python2.7/genericpath.py", line 29, in isfile
st = os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found
[2018-05-17 16:18:01] ERROR
Traceback (most recent call last):
File "/etc/zabbix/scripts/mysql_all.py", line 193, in main
value = mysql.get_item_tval(key)
File "/etc/zabbix/scripts/mysql_all.py", line 116, in get_item_tval
val = self.get_value(key)
File "/etc/zabbix/scripts/mysql_all.py", line 110, in get_value
self._file_cache.save_to_cache_file(content)
File "/etc/zabbix/scripts/qiueer/python/filecache.py", line 86, in save_to_cache_file
fd.write(content)
TypeError: expected a character buffer object
另一个关联的log里面只有一串数字,没有那堆json数据,而命令行执行脚本的时候是有的。
[root@s1 tmp]# cat .zabbix_mysql_variables_slave_status_3306_by_zabbix.txt
1526545591