<?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 Re: How to execute a mysql command over ssh script based on alert in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-execute-a-mysql-command-over-ssh-script-based-on-alert/m-p/198934#M3470</link>
    <description>&lt;P&gt;I got around this by just installing mysql client on the splunk machine and creating a simple py script &lt;BR /&gt;
import os&lt;BR /&gt;
os.system("mysql -u {user} -p{psw} -h {hostIP} -e "show full processlist;" -B  &amp;gt;&amp;gt; /splunk/showprocesslist.csv")&lt;BR /&gt;
This appends to a csv file&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jun 2014 18:49:50 GMT</pubDate>
    <dc:creator>Cuyose</dc:creator>
    <dc:date>2014-06-16T18:49:50Z</dc:date>
    <item>
      <title>How to execute a mysql command over ssh script based on alert</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-execute-a-mysql-command-over-ssh-script-based-on-alert/m-p/198932#M3468</link>
      <description>&lt;P&gt;Can't find an easy way to do this.  I want to create a .py script that gets kicked off when an alert triggers.  I can run a single command from the splunk machine cli, however it prompts me for a password.&lt;/P&gt;

&lt;P&gt;Basically when I see an event I want to write the results of a sql query to a file.  Since mysql is not installed on the splunk machine I need to ssh to the mysql machine to run the statement.&lt;/P&gt;

&lt;P&gt;How have people been solving this?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2014 17:45:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-execute-a-mysql-command-over-ssh-script-based-on-alert/m-p/198932#M3468</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2014-06-16T17:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute a mysql command over ssh script based on alert</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-execute-a-mysql-command-over-ssh-script-based-on-alert/m-p/198933#M3469</link>
      <description>&lt;P&gt;To avoid getting prompted for an SSH password you can store your SSH key on the other machine and log in using that.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2014 18:13:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-execute-a-mysql-command-over-ssh-script-based-on-alert/m-p/198933#M3469</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-16T18:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute a mysql command over ssh script based on alert</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-execute-a-mysql-command-over-ssh-script-based-on-alert/m-p/198934#M3470</link>
      <description>&lt;P&gt;I got around this by just installing mysql client on the splunk machine and creating a simple py script &lt;BR /&gt;
import os&lt;BR /&gt;
os.system("mysql -u {user} -p{psw} -h {hostIP} -e "show full processlist;" -B  &amp;gt;&amp;gt; /splunk/showprocesslist.csv")&lt;BR /&gt;
This appends to a csv file&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2014 18:49:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-execute-a-mysql-command-over-ssh-script-based-on-alert/m-p/198934#M3470</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2014-06-16T18:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute a mysql command over ssh script based on alert</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-execute-a-mysql-command-over-ssh-script-based-on-alert/m-p/198935#M3471</link>
      <description>&lt;P&gt;If you found the solution, you should reply as an answer and accept your answer.&lt;BR /&gt;
It will help the  other users, and mark the question as resolved.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2014 18:49:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-execute-a-mysql-command-over-ssh-script-based-on-alert/m-p/198935#M3471</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2014-06-16T18:49:51Z</dc:date>
    </item>
  </channel>
</rss>

