Zabbix-Network-Weathermap icon indicating copy to clipboard operation
Zabbix-Network-Weathermap copied to clipboard

Zabbix on Centos - Errors

Open frikigb opened this issue 7 years ago • 12 comments
trafficstars

Hello,

Can u please help me with error that i have in Zabbix with Network Weathermap. When i search for Zabbix server logs i get this:

error reason for "Zabbix server:weathermap.update.only[{$UPDATE}]" changed: Value "Traceback (most recent call last): File "/opt/Zabbix-Network-Weathermap/weathermap.py", line 10, in from config import ConfigLoader, ConfigCreate ImportError: No module named 'config' 0.985" of type "string" is not suitable for value type "Numeric (float)" error reason for "Zabbix server:weathermap.update.upload[{$UPLOAD}]" changed: Value "Traceback (most recent call last): File "/opt/Zabbix-Network-Weathermap/weathermap.py", line 10, in from config import ConfigLoader, ConfigCreate ImportError: No module named 'config' 0.32" of type "string" is not suitable for value type "Numeric (float)"

I see the same thing when i hover over items on host where i have Weathermap template.

How can i fix this ? Thank you in advance :)

frikigb avatar Jun 09 '18 23:06 frikigb

Hi, ImportError: No module named 'config' File /opt/Zabbix-Network-Weathermap/config.py is exist? Who is owner/group/other of file config.py? What permissions are set for config.py?

Prototype-X avatar Jun 10 '18 09:06 Prototype-X

Hey,

Yes File /opt/Zabbix-Network-Weathermap/config.py does exist.

Here are ownership, permissions, etc : -rwxr-xr-x 1 zabbix zabbix 18550 Feb 7 11:52 config.py

frikigb avatar Jun 10 '18 09:06 frikigb

Try run weathermap from cli: sudo -u zabbix /opt/Zabbix-Network-Weathermap/starter.py -m mapname1.yaml Try run weathermap from other path, for example from home dir cd /home/user. Got error?

Prototype-X avatar Jun 10 '18 11:06 Prototype-X

sudo -u zabbix set PYTHONPATH=${PYTHONPATH}:/opt/Zabbix-Network-Weathermap

Prototype-X avatar Jun 10 '18 11:06 Prototype-X

When i run command from CLI i get:

sudo -u zabbix /opt/Zabbix-Network-Weathermap/starter.py -m VPN.yaml Traceback (most recent call last): File "/opt/Zabbix-Network-Weathermap/weathermap.py", line 10, in from config import ConfigLoader, ConfigCreate ImportError: No module named 'config' 0.308

Even when i try to execute command from /home/user i still get same error.

When I use: sudo -u zabbix set PYTHONPATH=${PYTHONPATH}:/opt/Zabbix-Network-Weathermap

i get error sudo: set: command not found

frikigb avatar Jun 10 '18 12:06 frikigb

I have no idea why it does not work, maybe this is a specific problem in centos. ls -la /opt/Zabbix-Network-Weathermap

Prototype-X avatar Jun 10 '18 13:06 Prototype-X

ls -la /opt/Zabbix-Network-Weathermap total 92 d-wx--x--x 9 root root 262 Jun 10 14:09 . drwxr-xr-x. 5 root root 67 Jun 10 13:45 .. -rw-r--r-- 1 zabbix zabbix 18550 Feb 7 11:52 config.py -rw-r--r-- 1 zabbix zabbix 13129 Feb 7 11:52 converter.py drwxr-xr-x 2 zabbix zabbix 32 Feb 7 11:52 fonts drwxr-xr-x 2 zabbix zabbix 4096 Feb 7 11:52 icons drwxr-xr-x 2 zabbix zabbix 61 Jun 10 13:48 mapcfgs drwxr-xr-x 2 zabbix zabbix 37 Jun 10 13:48 mapimgs -rw-r--r-- 1 zabbix zabbix 14264 Feb 7 11:52 mapping.py drwxr-xr-x 2 root root 94 Jun 10 13:48 pycache -rw-r--r-- 1 zabbix zabbix 8672 Feb 7 11:52 README.md -rw-r--r-- 1 zabbix zabbix 38 Feb 7 11:52 requirements.txt -rwxr-xr-x 1 zabbix zabbix 376 Feb 7 11:52 starter.py drwxr-xr-x 2 zabbix zabbix 65 Feb 7 11:52 template drwxr-xr-x 2 zabbix zabbix 25 Feb 7 11:52 tests -rwxr-xr-x 1 zabbix zabbix 4562 Feb 7 11:52 weathermap.py -rw-r--r-- 1 zabbix zabbix 7000 Feb 7 11:52 zabbix.py

frikigb avatar Jun 10 '18 13:06 frikigb

pycache owner root rm -r /opt/Zabbix-Network-Weathermap/pycache

Prototype-X avatar Jun 10 '18 14:06 Prototype-X

Even when i removed pycache and run sudo -u zabbix /opt/Zabbix-Network-Weathermap/starter.py -m VPN.yaml im still having same error output.

Traceback (most recent call last): File "/opt/Zabbix-Network-Weathermap/weathermap.py", line 10, in from config import ConfigLoader, ConfigCreate ImportError: No module named 'config' 0.334

I dont know why he dont see config file when config.py is in there

frikigb avatar Jun 10 '18 14:06 frikigb

If you run a weathermap from the root user or self, does it work?

Prototype-X avatar Jun 10 '18 17:06 Prototype-X

I can run it as root but i get that error. If i tray as my self then i need to enter password for root. Don't know why he cant load or find modul 'config'.

Same error output as root or myself:

Traceback (most recent call last): File "/opt/Zabbix-Network-Weathermap/weathermap.py", line 10, in from config import ConfigLoader, ConfigCreate ImportError: No module named 'config' 0.289

frikigb avatar Jun 10 '18 19:06 frikigb

Little update i managed to execute command sudo -u zabbix set PYTHONPATH=${PYTHONPATH}:/opt/Zabbix-Network-Weathermap, but in order to execute it I only needed set PYTHONPATH=${PYTHONPATH}:/opt/Zabbix-Network-Weathermap part.

And now even tho i see PYTHONPATH=:/opt/Zabbix-Network-Weathermap with env command i still get same error problem ImportError: No module named 'config'.

frikigb avatar Jun 11 '18 06:06 frikigb