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

Zabbix on Centos - Errors #37

Open
frikigb opened this issue Jun 9, 2018 · 12 comments
Open

Zabbix on Centos - Errors #37

frikigb opened this issue Jun 9, 2018 · 12 comments

Comments

@frikigb
Copy link

frikigb commented Jun 9, 2018

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 :)

@Prototype-X
Copy link
Owner

Prototype-X commented Jun 10, 2018

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?

@frikigb
Copy link
Author

frikigb commented Jun 10, 2018

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

@Prototype-X
Copy link
Owner

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
Copy link
Owner

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

@frikigb
Copy link
Author

frikigb commented Jun 10, 2018

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

@Prototype-X
Copy link
Owner

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

@frikigb
Copy link
Author

frikigb commented Jun 10, 2018

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

@Prototype-X
Copy link
Owner

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

@frikigb
Copy link
Author

frikigb commented Jun 10, 2018

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

@Prototype-X
Copy link
Owner

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

@frikigb
Copy link
Author

frikigb commented Jun 10, 2018

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
Copy link
Author

frikigb commented Jun 11, 2018

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'.

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

2 participants