<div dir="ltr">The documentation for selenium/webdriver/remote/webdriver.py says:<div><br></div><div>    "Controls a browser by sending commands to a remote server."</div><div><br></div><div>When you run it from the command line using xymoncmd, it will have access to your display and any browser that you have running.  When xymon runs the same script as a task, it doesn't own the display, so it gets "connection refused".</div><div><br></div><div>Probably.</div><div><br></div><div>Ralph Mitchell</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 27, 2017 at 11:53 AM, usa ims via Xymon <span dir="ltr"><<a href="mailto:xymon@xymon.com" target="_blank">xymon@xymon.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">______________________________<wbr>_________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" rel="noreferrer" target="_blank">http://lists.xymon.com/<wbr>mailman/listinfo/xymon</a><br>
<br><br>---------- Forwarded message ----------<br>From: usa ims <<a href="mailto:usaims@yahoo.com">usaims@yahoo.com</a>><br>To: "<a href="mailto:xymon@xymon.com">xymon@xymon.com</a>" <<a href="mailto:xymon@xymon.com">xymon@xymon.com</a>><br>Cc: <br>Date: Fri, 27 Jan 2017 16:46:08 +0000 (UTC)<br>Subject: script won't run in tasks.cfg but it will on the command line<br><div><div style="color:#000;background-color:#fff;font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2709">Hi,</div><div id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2709"><br></div><div id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2709" dir="ltr">I have this Python Selenium script that works if I go into the '/usr/lib/xymon/server/bin/' and fire off 'xymoncmd' and execute the script -- it reports to the Xymon Display and life is peachy.</div><div id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2709" dir="ltr"><br></div><div id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2709" dir="ltr">When I put the script in tasks.cfg,  it runs at the desired internal of every two minutes but it errors out. The script uses a combination of a driver '/usr/local/bin/geckodriver' which I even gave 777 permissions on it and changed ownership to 'xymon:xymon'. The script also uses an executable script in '/usr/bin/firefox' which I gave '777' permissions on it. Any help will be greatly appreciated.</div><div id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2709" dir="ltr"><br></div><div id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2709" dir="ltr">Here is the error message:</div><div id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2709" dir="ltr"><br></div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2953">Fri Jan 27 11:37:39 2017</div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2954">Traceback (most recent call last):</div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2955">  File "/usr/lib/xymon/server/ext/<wbr>wslcb_licensee.py", line 31, in <module></div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2956">    driver = webdriver.Firefox()</div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2957">  File "/usr/local/lib/python2.7/<wbr>dist-packages/selenium/<wbr>webdriver/firefox/webdriver.<wbr>py", line 150, in __init__</div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2958">    keep_alive=True)</div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2959">  File "/usr/local/lib/python2.7/<wbr>dist-packages/selenium/<wbr>webdriver/remote/webdriver.py"<wbr>, line 92, in __init__</div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2960">    self.start_session(desired_<wbr>capabilities, browser_profile)</div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2961">  File "/usr/local/lib/python2.7/<wbr>dist-packages/selenium/<wbr>webdriver/remote/webdriver.py"<wbr>, line 179, in start_session</div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2962">    response = self.execute(Command.NEW_<wbr>SESSION, capabilities)</div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2963">  File "/usr/local/lib/python2.7/<wbr>dist-packages/selenium/<wbr>webdriver/remote/webdriver.py"<wbr>, line 236, in execute</div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2964">    self.error_handler.check_<wbr>response(response)</div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2965">  File "/usr/local/lib/python2.7/<wbr>dist-packages/selenium/<wbr>webdriver/remote/errorhandler.<wbr>py", line 192, in check_response</div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2966">    raise exception_class(message, screen, stacktrace)</div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2967">selenium.common.exceptions.<wbr>WebDriverException: Message: connection refused</div><div dir="ltr" id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2968"><br id="m_4953319544427570355yui_3_16_0_ym19_1_1485534803074_2969"></div></div></div><br></blockquote></div><br></div>