New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zabbix-cli dont execute via zabbix External check #28

Closed
invin12 opened this Issue Jan 31, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@invin12

invin12 commented Jan 31, 2017

No problem when I run zabbix-cli from shell or via cron. But when I create External check in zabbix, I've got an error

Traceback (most recent call last):
File "/usr/local/bin/zabbix-cli", line 4, in
import('pkg_resources').run_script('zabbix-cli==1.6.1', 'zabbix-cli')
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 719, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1511, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/zabbix_cli-1.6.1-py2.7.egg/EGG-INFO/scripts/zabbix-cli", line 67, in

File "build/bdist.linux-x86_64/egg/zabbix_cli/config.py", line 50, in init
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

@ghost

This comment has been minimized.

Collaborator

ghost commented Feb 5, 2017

Thanks for the feedback.

This happens because we use the os.getenv('HOME') function to get the home directory of the user running zabbix-cli.

If the HOME environment variable is not defined, the code will raise an exception.
We have to check that HOME is defined before trying to use it.

Usually, processes startet e.g. with systemd do not have all environment variables as in a shell, per default. This can be a problem when running zabbix-cli as an external check if you want to use a configuration file under the $HOME directory of the user running the external check.

@ghost ghost assigned rafaelma Feb 5, 2017

@usit-gd usit-gd added the bug label Feb 5, 2017

@usit-gd usit-gd added this to the 1.7.0 milestone Feb 5, 2017

@invin12

This comment has been minimized.

invin12 commented Feb 8, 2017

Thank you. I define HOME environment variable and it works now!

@invin12 invin12 closed this Feb 8, 2017

@invin12 invin12 reopened this Feb 8, 2017

rafaelma added a commit that referenced this issue Mar 21, 2017

@usit-gd usit-gd closed this Mar 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment