Ad Widget

Collapse

Python external script using Selenium Webdriver will not run from proxy

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • troffasky
    Senior Member
    • Jul 2008
    • 567

    #1

    Python external script using Selenium Webdriver will not run from proxy

    Python script using Selenium Webdriver which logs in to a device, fetches a metric and outputs it to stdout.
    Configured this as an External Script.
    The script runs fine as the Zabbix user from an SSH session, but does not work when executed as the same user by the Zabbix proxy service. The error is:

    Code:
    Traceback (most recent call last):
    File "/usr/lib/zabbix/externalscripts/script.py", line 42, in <module>
    driver = webdriver.Chrome(service=service, options=chrome_options)
    File "/usr/lib/python3/dist-packages/selenium/webdriver/chrome/webdriver.py", line 92, in __init__
    self.service.start()
    File "/usr/lib/python3/dist-packages/selenium/webdriver/common/service.py", line 98, in start
    self.assert_process_still_running()
    File "/usr/lib/python3/dist-packages/selenium/webdriver/common/service.py", line 109, in assert_process_still_running
    raise WebDriverException(
    selenium.common.exceptions.WebDriverException: Message: Service /usr/bin/chromedriver unexpectedly exited. Status code was: 1

    I had this working some time ago but I think it stopped after a reboot of the Zabbix proxy server.
  • Answer selected by troffasky at 18-11-2025, 16:39.
    troffasky
    Senior Member
    • Jul 2008
    • 567

    The answer is....Snap is not your friend.
    Replaced snap with Debian packages per this:

    https://askubuntu.com/questions/1204...521453#1521453

    Worked straight away.

    I definitely did have it working without this workaround as I have several months worth of item history until the proxy rebooted. But who knows what went wrong here.

    Comment

    • troffasky
      Senior Member
      • Jul 2008
      • 567

      #2
      I have tested this as a cron job as the Zabbix user and it works fine. Weird.

      Comment

      • troffasky
        Senior Member
        • Jul 2008
        • 567

        #3
        The answer is....Snap is not your friend.
        Replaced snap with Debian packages per this:

        https://askubuntu.com/questions/1204...521453#1521453

        Worked straight away.

        I definitely did have it working without this workaround as I have several months worth of item history until the proxy rebooted. But who knows what went wrong here.

        Comment

        Working...