wawastein / zabbix-cloudwatch

Cloudwatch integration for Zabbix 3.x
GNU General Public License v3.0
33 stars 53 forks source link

Error with module discovery #35

Open SebViasphere opened 2 years ago

SebViasphere commented 2 years ago

Hello,

thank you for your work! I used with my old ZAbbix V4.

i've a new Zabbix v6, I made change in the script, but I ve this error:

Invalid discovery rule value: cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'Traceback (most recent call last): File "./aws_discovery.py", line 39, in "discovery") File "/usr/lib/python3.7/importlib/init.py"

Do you know how I can fix that?

Best regards,

Seb

SebViasphere commented 2 years ago

nobody can help me? :'(

kubrafev commented 2 years ago

Same problem for me. Could you solve the problem? If the answer is yes, could you share the solution with me? Thank you.

kubrafev commented 2 years ago

Hi @SebViasphere ,

I solved the problem with copying folder located in '/home/{user_name}/.local/lib/python3.6/site_package/' into '/usr/local/lib/python3.6/dist-packages/'

I also attached the link that help me. https://www.zabbix.com/forum/zabbix-troubleshooting-and-problems/417604-zabbix-remote-command-running-python-script-throws-import-error

SebViasphere commented 2 years ago

Hi @kubrafev thanck you for your answer.

i've all ready the content of /home/{user_name}/.local/lib/python3.7/site_package/ in /usr/local/lib/python3.6/dist-packages/ as you can see:

admin@ip-172-30-2-91:~/.local/lib/python3.7/site-packages$ ls -l total 24 drwxr-xr-x 10 admin admin 4096 Mar 16 09:46 boto3 drwxr-xr-x 2 admin admin 4096 Mar 16 09:46 boto3-1.21.20.dist-info drwxr-xr-x 8 admin admin 4096 Mar 16 09:46 botocore drwxr-xr-x 2 admin admin 4096 Mar 16 09:46 botocore-1.24.20.dist-info drwxr-xr-x 5 admin admin 4096 Mar 15 17:20 pip drwxr-xr-x 2 admin admin 4096 Mar 15 17:20 pip-22.0.4.dist-info admin@ip-172-30-2-91:~/.local/lib/python3.7/site-packages$ cd /usr/local/lib/python3.7/dist-packages/ admin@ip-172-30-2-91:/usr/local/lib/python3.7/dist-packages$ ls -l total 76 drwxr-sr-x 2 root staff 4096 Feb 17 11:38 pycache drwxr-sr-x 10 root staff 4096 Mar 16 09:47 boto3 drwxr-sr-x 2 root staff 4096 Mar 16 09:47 boto3-1.21.20.dist-info drwxr-sr-x 8 root staff 4096 Mar 16 09:47 botocore drwxr-sr-x 2 root staff 4096 Mar 16 09:47 botocore-1.24.20.dist-info drwxr-sr-x 6 root staff 4096 Feb 17 11:38 feedparser drwxr-sr-x 2 root staff 4096 Feb 17 11:38 feedparser-6.0.8.dist-info drwxr-sr-x 5 root staff 4096 Mar 15 17:29 pip drwxr-sr-x 2 root staff 4096 Mar 15 17:29 pip-22.0.4.dist-info drwxr-sr-x 3 root staff 4096 Feb 17 11:37 s3transfer drwxr-sr-x 2 root staff 4096 Feb 17 11:37 s3transfer-0.5.1.dist-info -rw-r--r-- 1 root staff 17788 Feb 17 11:38 sgmllib.py drwxr-sr-x 2 root staff 4096 Feb 17 11:38 sgmllib3k-1.0.0.dist-info drwxr-sr-x 6 root staff 4096 Feb 17 11:37 urllib3 drwxr-sr-x 2 root staff 4096 Feb 17 11:37 urllib3-1.26.8.dist-info

And I've alreay in /usr/lib/python3.7/dist-packages

I don't understand why it's not working....

kubrafev commented 2 years ago

Hi @SebViasphere

You are right. When I first link the host with the Cloudwatch Teamplate, I haven't got any error or something. After a while it's giving the same error with you. (Unlink and clear. Update. Link again. Solve the problem bu it is not sustainable. If I solve this I will share you. And If you solve this, I would be glad.) image

But still get the true values when I create items with using item prototype. (I tried for AWS EC2 only)

You can unlink and clear the template and update the host. Then you link the template again. And then create the item with using item prototype. Maybe it works. It works for me. As I said before even it said not supported in Discovery section, I can get the values from AWS.

SebViasphere commented 2 years ago

Hy @kubrafev thank you for your answer.

I did what you said (unlink and clear the template and update the host and link the template again) but I've still the erro (but I didn't create host by using item prototype.

Off course if I find a solution and solve the problem I'll share that with you :)