<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic fail to pop up window via the .bat executed by splunk alert in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/fail-to-pop-up-window-via-the-bat-executed-by-splunk-alert/m-p/108939#M1575</link>
    <description>&lt;P&gt;hello, all&lt;/P&gt;

&lt;P&gt;I want an alert to invoke a test.bat file, and I tested three test.bat file as follows:&lt;/P&gt;

&lt;P&gt;test1.bat:&lt;BR /&gt;
python &lt;CODE&gt;"C:\Program Files\Splunk\bin\scripts\test.py"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and &lt;BR /&gt;
test.py is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#*****************************test.py****************************************
output = open('C:\\Program Files\\Splunk\\bin\\scripts\\testtest.txt', 'w+')
output.write('Test for script')
output.close()
#*****************************test.py****************************************
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It works for creating a file named testtest.txt in path C:\Program Files\Splunk\bin\scripts\ with content "Test for script".&lt;/P&gt;

&lt;P&gt;test2.bat:&lt;BR /&gt;
python "C:\Program Files\Splunk\bin\scripts\PopUpWindow.py"&lt;/P&gt;

&lt;P&gt;and PopUpWindow.py is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#*****************************PopUpWindow.py****************************************
from tkinter import *

root = Tk()

var = StringVar()
label = Message( root, textvariable=var,relief=RAISED )

var.set("Hey!? How are you doing?\n")
label.pack()
root.mainloop()
#*****************************PopUpWindow.py****************************************
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can't get any pop up window but in "View recent" the script ran actually.&lt;/P&gt;

&lt;P&gt;test3.bat:&lt;BR /&gt;
python "C:\Program Files\Splunk\bin\scripts\test.py"&lt;BR /&gt;
python "C:\Program Files\Splunk\bin\scripts\PopUpWindow.py"&lt;/P&gt;

&lt;P&gt;I can get the testtest.txt in path C:\Program Files\Splunk\bin\scripts\ but no pop window.&lt;/P&gt;

&lt;P&gt;can any one help?&lt;BR /&gt;
I would be very grateful if you could help.&lt;/P&gt;</description>
    <pubDate>Thu, 26 May 2011 07:10:32 GMT</pubDate>
    <dc:creator>kurt28</dc:creator>
    <dc:date>2011-05-26T07:10:32Z</dc:date>
    <item>
      <title>fail to pop up window via the .bat executed by splunk alert</title>
      <link>https://community.splunk.com/t5/Alerting/fail-to-pop-up-window-via-the-bat-executed-by-splunk-alert/m-p/108939#M1575</link>
      <description>&lt;P&gt;hello, all&lt;/P&gt;

&lt;P&gt;I want an alert to invoke a test.bat file, and I tested three test.bat file as follows:&lt;/P&gt;

&lt;P&gt;test1.bat:&lt;BR /&gt;
python &lt;CODE&gt;"C:\Program Files\Splunk\bin\scripts\test.py"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and &lt;BR /&gt;
test.py is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#*****************************test.py****************************************
output = open('C:\\Program Files\\Splunk\\bin\\scripts\\testtest.txt', 'w+')
output.write('Test for script')
output.close()
#*****************************test.py****************************************
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It works for creating a file named testtest.txt in path C:\Program Files\Splunk\bin\scripts\ with content "Test for script".&lt;/P&gt;

&lt;P&gt;test2.bat:&lt;BR /&gt;
python "C:\Program Files\Splunk\bin\scripts\PopUpWindow.py"&lt;/P&gt;

&lt;P&gt;and PopUpWindow.py is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#*****************************PopUpWindow.py****************************************
from tkinter import *

root = Tk()

var = StringVar()
label = Message( root, textvariable=var,relief=RAISED )

var.set("Hey!? How are you doing?\n")
label.pack()
root.mainloop()
#*****************************PopUpWindow.py****************************************
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can't get any pop up window but in "View recent" the script ran actually.&lt;/P&gt;

&lt;P&gt;test3.bat:&lt;BR /&gt;
python "C:\Program Files\Splunk\bin\scripts\test.py"&lt;BR /&gt;
python "C:\Program Files\Splunk\bin\scripts\PopUpWindow.py"&lt;/P&gt;

&lt;P&gt;I can get the testtest.txt in path C:\Program Files\Splunk\bin\scripts\ but no pop window.&lt;/P&gt;

&lt;P&gt;can any one help?&lt;BR /&gt;
I would be very grateful if you could help.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2011 07:10:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/fail-to-pop-up-window-via-the-bat-executed-by-splunk-alert/m-p/108939#M1575</guid>
      <dc:creator>kurt28</dc:creator>
      <dc:date>2011-05-26T07:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: fail to pop up window via the .bat executed by splunk alert</title>
      <link>https://community.splunk.com/t5/Alerting/fail-to-pop-up-window-via-the-bat-executed-by-splunk-alert/m-p/108940#M1576</link>
      <description>&lt;P&gt;What happens if you run the batch file directly (i.e. outside of Splunk)?&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2011 17:21:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/fail-to-pop-up-window-via-the-bat-executed-by-splunk-alert/m-p/108940#M1576</guid>
      <dc:creator>LukeMurphey</dc:creator>
      <dc:date>2011-05-26T17:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: fail to pop up window via the .bat executed by splunk alert</title>
      <link>https://community.splunk.com/t5/Alerting/fail-to-pop-up-window-via-the-bat-executed-by-splunk-alert/m-p/108941#M1577</link>
      <description>&lt;P&gt;Does test2.bat work when run manually?&lt;/P&gt;

&lt;P&gt;Have you considered writing something that instantiates &lt;A href="http://technet.microsoft.com/en-us/library/cc771903(WS.10).aspx"&gt;Microsoft's MSG command&lt;/A&gt; instead of having Python create a dialog directly? That way, you should be able to get the message to pop-up on a system other than the one generating the alert.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2011 18:42:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/fail-to-pop-up-window-via-the-bat-executed-by-splunk-alert/m-p/108941#M1577</guid>
      <dc:creator>gpullis</dc:creator>
      <dc:date>2011-05-26T18:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: fail to pop up window via the .bat executed by splunk alert</title>
      <link>https://community.splunk.com/t5/Alerting/fail-to-pop-up-window-via-the-bat-executed-by-splunk-alert/m-p/108942#M1578</link>
      <description>&lt;P&gt;Sorry for not mentioning that all the three tests can be run manually, I can get either the testtest.txt or pop up window. I just don't know why batch file executed by splunk can write a text file but can't pop a window.&lt;BR /&gt;
   Btw, I ran python bundled with splunk and typed help('modules'). I found that there's not tkinter or Tkinter module.I guess it's the reason why I can't get the pop up window.&lt;BR /&gt;
   I tried Microsoft's MSG command and it succeeded to pop a message up. Thanks very much!!!&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2011 03:58:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/fail-to-pop-up-window-via-the-bat-executed-by-splunk-alert/m-p/108942#M1578</guid>
      <dc:creator>kurt28</dc:creator>
      <dc:date>2011-05-27T03:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: fail to pop up window via the .bat executed by splunk alert</title>
      <link>https://community.splunk.com/t5/Alerting/fail-to-pop-up-window-via-the-bat-executed-by-splunk-alert/m-p/108943#M1579</link>
      <description>&lt;P&gt;I get the expected result when I run the batch file directly. Don't know why splunk alert invoke fails.&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2011 04:02:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/fail-to-pop-up-window-via-the-bat-executed-by-splunk-alert/m-p/108943#M1579</guid>
      <dc:creator>kurt28</dc:creator>
      <dc:date>2011-05-27T04:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: fail to pop up window via the .bat executed by splunk alert</title>
      <link>https://community.splunk.com/t5/Alerting/fail-to-pop-up-window-via-the-bat-executed-by-splunk-alert/m-p/108944#M1580</link>
      <description>&lt;P&gt;Here's my guess on why the splunkd service couldn't pop a window... Think of two administrators logged into RDP sessions. When admin A runs your popup script, you wouldn't expect Admin B to see the window because they're in different sessions. Same idea with the splunkd service. It's in a different session. Plus, I think that services are normally "non-interactive". That is, they're specifically disallowed from manipulating the local GUI. That's why things like SQL Server need those little helpers running in your system tray. So something exists that the service can interact with.&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2011 13:00:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/fail-to-pop-up-window-via-the-bat-executed-by-splunk-alert/m-p/108944#M1580</guid>
      <dc:creator>gpullis</dc:creator>
      <dc:date>2011-05-27T13:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: fail to pop up window via the .bat executed by splunk alert</title>
      <link>https://community.splunk.com/t5/Alerting/fail-to-pop-up-window-via-the-bat-executed-by-splunk-alert/m-p/108945#M1581</link>
      <description>&lt;P&gt;I will try it out. Thanks for your reply. ^^&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2011 06:53:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/fail-to-pop-up-window-via-the-bat-executed-by-splunk-alert/m-p/108945#M1581</guid>
      <dc:creator>kurt28</dc:creator>
      <dc:date>2011-05-31T06:53:25Z</dc:date>
    </item>
  </channel>
</rss>

