Skip to content
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

UnboundLocalError: local variable 'hostname' referenced before assignment #6

Open
mbuyukkarakas opened this issue Jun 10, 2019 · 5 comments

Comments

@mbuyukkarakas
Copy link

Hello all,

I have an error like this. Could you help please to solve that ?
Thank you.

./pyora-active.py --address 10.0.0.5 --database ORCL

{"failed": 0, "chunk": 0, "total": 0, "processed": 0, "time": "0"}
Traceback (most recent call last):
File "./pyora-active.py", line 709, in
main()
File "./pyora-active.py", line 697, in call
ZabbixMetric(hostname, "failedchecks", result.failed))
UnboundLocalError: local variable 'hostname' referenced before assignment

@dan-aksenov
Copy link
Contributor

my be this could help?

@mbuyukkarakas
Copy link
Author

my be this could help?

Thank you Dan.
I cant follow you sorry. I'm not very familiar with Oracle so my question will be very low-level.
Should I add the --hostname at end of my command ?

Can you send an example please ?
Thank you.

@dan-aksenov
Copy link
Contributor

Not sure. Didn't use this script for long time. Yet you should provide hostname = zabbix agent's hostname somewhere in configs.

@z76154174
Copy link

@Lelik13a 我也出现这样的提示,zabbix agent的配置文件的hostname也改成pyora-items-list.py指定时的名称了,还是会出现这样的提示

@Vedemon
Copy link

Vedemon commented Nov 16, 2021

my be this could help?

Thank you Dan. I cant follow you sorry. I'm not very familiar with Oracle so my question will be very low-level. Should I add the --hostname at end of my command ?

Can you send an example please ? Thank you.

pyora-active.py:

change

` Data = []

    try:
        with open("/usr/lib/zabbix/cache/items-" + self.args.address + "-"

`
to

` Data = []
hostname = self.args.address

    try:
        with open("/usr/lib/zabbix/cache/items-" + self.args.address + "-"

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants