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

Errors on Ubuntu20 #12

Open
danielgbeer opened this issue Dec 11, 2022 · 4 comments
Open

Errors on Ubuntu20 #12

danielgbeer opened this issue Dec 11, 2022 · 4 comments

Comments

@danielgbeer
Copy link

danielgbeer commented Dec 11, 2022

I'm not sure if it's my lack of python knowledge or the code, so bear with me...

I've spent ages working through issues trying to get this template and .py file working with Zabbix 6.2 monitoring Ubuntu 20 and FMS 19.5 and 19.6.

I keep getting errors in Zabbix to do with the
I read that Ubuntu 20 dropped support for the requests module in zabbix 2.7
I tried using the python3 requests module by changing:

import requests
from requests.auth import HTTPBasicAuth
import sys

to

import sys
sys.path.append('/usr/lib/python3/dist-packages')
import requests
from requests.auth import HTTPBasicAuth

However zabbix is still returning an error:
`Preprocessing failed for: Traceback (most recent call last):. File "/etc/zabbix/scripts/fms_config.py", line 99, in <modul...

  1. Failed: cannot extract value from json by path "$.config.DatabaseRootPath": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'Traceback (most recent call last):
    File "/etc/zabbix/scripts/fms_config.py", line 99, in
    config = requests.get(config_url, headers=heade`

Line 99 is: config = requests.get(config_url, headers=headers, verify=False)

Someone who know what they're doing will probably see the issue straight away... that person is not me.
Any help would be greatly appreciated!

@wimdecorte
Copy link
Member

We're working on an updated template to cover both the new FMS features AND the new Zabbix versions. Our current thinking is to do away with OS-specific scripting and use JS where we can so that the code is the same for all OSes and we can rely on NodeJS always to be there on an FMS.

In the meantime, if you can send me your full py file I can see if I can debug it to unblock you.

@danielgbeer
Copy link
Author

danielgbeer commented Dec 12, 2022 via email

@danielgbeer
Copy link
Author

danielgbeer commented Dec 12, 2022 via email

@danielgbeer
Copy link
Author

In response to my original issue, the first line was referencing python (which does not exist on our servers) so I changed to python3 which helped.
I'm not sure if my original fix (of changing the import order) also made a difference but at least I'm getting some data now.

Was: #!/usr/bin/python
Now:#!/usr/bin/python3

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