Open jeffclay opened 1 month ago
Hi, I have the same issue. Have you found a solution?
No, I have not found a solution.
@grumpy-systems Any idea? We just followed your blog post. Python scripts run as root and as normal user but not as zabbix user (not from shell or from zabbix itself)
sudo -u zabbix python3 /usr/home/gws.py
Traceback (most recent call last):
File "/usr/home/gws.py", line 7, in <module>
data = json.loads(out)
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
Sorry, didn't see this issue originally.
I ran into the same issue and forgot to update the post, I'm pretty sure the magic sauce is to do sudo python3 ...
for the command. I think you also need to check the "Enable sudo root permissions" on the main Zabbix service screen as well (where the hostname and whatnot is set)
If that works, I'll update the post to fix it as well. That broke in an update after I wrote the post.
I get the error below in the zabbix server logs.
I've double checked everything I can think of but I'm rather new to Zabbix.
I have confirmed that the script files are owned by the user running zabbix in OPNSense. I have also double checked the user parameters are set. If I run
python3 /usr/home/gws.py
on the firewall, I get a valid JSON print with both of my gateway names.