Zabbix-PyOra-ActiveCheck icon indicating copy to clipboard operation
Zabbix-PyOra-ActiveCheck copied to clipboard

UnboundLocalError: local variable 'hostname' referenced before assignment

Open mbuyukkarakas opened this issue 5 years ago • 5 comments

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

mbuyukkarakas avatar Jun 10 '19 13:06 mbuyukkarakas

my be this could help?

dan-aksenov avatar Jun 10 '19 13:06 dan-aksenov

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.

mbuyukkarakas avatar Jun 10 '19 13:06 mbuyukkarakas

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

dan-aksenov avatar Jun 10 '19 14:06 dan-aksenov

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

z76154174 avatar Aug 24 '20 03:08 z76154174

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 + "-"

`

Vedemon avatar Nov 16 '21 09:11 Vedemon