aklyuk / zabbix-hp-3par

16 stars 15 forks source link

Discover Error in Zabbix #3

Open KavyaKanya opened 3 years ago

KavyaKanya commented 3 years ago

Hello

I've tried t import the Template to Zabbix and placed the scripts in the externalscripts folder of Zabbix proxy as per the mentioned instructions

I did try to run th python script and an output 1000 :/

image

In Zabbix when I check under the Discover below is the error it shows thought the module is installed

image

image

aklyuk commented 3 years ago

Hi. You need to install pywbem python module. Example for python3: pip3 install pywbem

aklyuk commented 3 years ago

pip3 for python3. In script, first line - #!/usr/bin/python3

KavyaKanya commented 3 years ago

pip3 for python3. In script, first line - #!/usr/bin/python3

Thank you! for the prompt response

ok! I'd install python3 related respective modules and keep you posted

KavyaKanya commented 3 years ago

pip3 for python3. In script, first line - #!/usr/bin/python3

is it mandatory to have Python3 and related modules to be installed?

aklyuk commented 3 years ago

you can use python2. but you will be need change some code. pywbem is required for python2.

KavyaKanya commented 3 years ago

you can use python2. but you will be need change some code. pywbem is required for python2.

So as suggested I've installed Python3 and related libraries also

But I get this errror in Zabbix

image

Other question I've this current situation

3PAR Management Console is installed on IP1 i.e they login to this IP1 via RDP and then open the Management console and then login to the respective 3PAR Storage with its respective IP (IP2)

So as per your 'ReadMe' in the below what IP has to be mentioned

In agent configuration file, /etc/zabbix/zabbix_agentd.conf must be set parameter ServerActive=xxx.xxx.xxx.xxx

and moreoever below is the error when I run the command

python3 ./hp_3par_get_state_wbem.py --hp_ip= --hp_port=8 --hp_user= --hp_password= --storage_name= --discovery

image

BozhebayevM commented 3 years ago

Hi, Thank You for this solution For Zabbix. I have the same problem. When i am run script manually from console of zabbix server it is works and return 0 code. But when it start by web UI i have errors like in the last Screen KavyaKanya

image

BozhebayevM commented 3 years ago

Hi, Thank You for this solution For Zabbix. I have the same problem. When i am run script manually from console of zabbix server it is works and return 0 code. But when it start by web UI i have errors like in the last Screen KavyaKanya

image

So i am try to add two macros $HOST.NAME and $HOST.IP and change key of trapper item and it is works. But i must run command zabbix_server -R config_cache_reload

BozhebayevM commented 3 years ago

you can use python2. but you will be need change some code. pywbem is required for python2.

So as suggested I've installed Python3 and related libraries also

But I get this errror in Zabbix

image

Other question I've this current situation

3PAR Management Console is installed on IP1 i.e they login to this IP1 via RDP and then open the Management console and then login to the respective 3PAR Storage with its respective IP (IP2)

So as per your 'ReadMe' in the below what IP has to be mentioned

In agent configuration file, /etc/zabbix/zabbix_agentd.conf must be set parameter ServerActive=xxx.xxx.xxx.xxx

and moreoever below is the error when I run the command

python3 ./hp_3par_get_state_wbem.py --hp_ip= --hp_port=8 --hp_user= --hp_password= --storage_name= --discovery

image

My last commits it is also can helps for you

pay748 commented 3 years ago

Thank you very much for the solution shared by aklyuk, it solved one of my problems, thank you again.Do not use root user to install python library on zabbix-server or proxy server.This operation will cause zabbix to be unable to call the corresponding library. Non-privileged users are recommended to install the python library like this: “python3 -m pip install paramiko paramiko”can help you solve some unnecessary troubles (when the script returns a code of 1000, you can find the return code of 1000In the function, add “print(oops)”before the sys.exit("1000") code in the function. This can help you locate the problem and view the detailed error message.

joedong1988 commented 2 years ago

I test the scripts on zabbix web interface,show me :Timeout while executing a shell script. please help me.

joedong1988 commented 2 years ago

I have fixed the issue.

blablas commented 2 years ago

hi @joedong1988, how did you fix it? Please, help me...I'm stuck

blablas commented 2 years ago

Ok, resolved. For everyone who may need, you must increase the "Timeout" value in zabbix-server.conf (default= 4) to something higher and restart the zabbix-server service