<?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: Forwarder Installation Script in Installation</title>
    <link>https://community.splunk.com/t5/Installation/Forwarder-Installation-Script/m-p/50693#M818</link>
    <description>&lt;P&gt;Hi David,&lt;/P&gt;

&lt;P&gt;Works like a charm. Thanks for sharing it. I came in most helpful when I needed.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
Ger&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2013 20:28:56 GMT</pubDate>
    <dc:creator>gvhees</dc:creator>
    <dc:date>2013-08-29T20:28:56Z</dc:date>
    <item>
      <title>Forwarder Installation Script</title>
      <link>https://community.splunk.com/t5/Installation/Forwarder-Installation-Script/m-p/50690#M815</link>
      <description>&lt;P&gt;I have created the script below to deploy forwarders to Linux servers. Hopefully it is of use to others in the community.&lt;/P&gt;
&lt;P&gt;If you execute the script it will tell you which parameters it expects to receive.&lt;/P&gt;
&lt;P&gt;The script expects to deploy a .tgz but could easily be tweaked to install an RPM, DEB or similar package. However in those situations I would generally look to utilise whatever package management system is available (e.g. a Satellite server for RedHat) to make patching easier.&lt;/P&gt;
&lt;P&gt;I hope you find this helpful.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;#!/bin/bash

################################################
################################################
### Splunk&amp;gt; Forwarder Mass Deployment Script ###
### Author:   David Anso - GKC Limited       ###
### Version:  1.0                            ###
################################################
################################################
### &lt;A href="https://community.splunk.com/www.gkc.co.nz" target="test_blank"&gt;www.gkc.co.nz&lt;/A&gt;

REMOTE_HOST=$1
REMOTE_USER=$2
REMOTE_PATH="$3"
ENABLE_KEYBASED_AUTH=$4
ENABLE_BOOT_START=$5

SPLUNKFORWARDERTGZ="splunkforwarder-4.3-115073-Linux-x86_64.tgz"
INSTALLER_HOME="/home/splunker/install-forwarder/"
SPLUNKDEPLOYCLIENTCONF="deploymentclient.conf"
SSH_PUBLIC_KEY="/home/splunker/.ssh/id_rsa.pub"

cd $INSTALLER_HOME

if [ -z $5 ]
then
    echo "Usage: $0 Host User Path Enable_SSHKeys EnableBootStart"
    echo " e.g.: $0 splunkforwarder1 splunkuser /opt 1 1"
    exit 1
fi

if [ $ENABLE_KEYBASED_AUTH -gt 0 ]
then
    cat $SSH_PUBLIC_KEY | ssh $REMOTE_HOST -l $REMOTE_USER "if [ ! -e .ssh ] ; then mkdir ~/.ssh; fi ; cat \ &amp;gt;&amp;gt;~/.ssh/authorized_keys ; chmod 600 ~/.ssh/authorized_keys ;chmod 700 ~/.ssh"
    ssh $REMOTE_HOST -l $REMOTE_USER echo If you only typed the password once then key based auth is working.
fi

echo "Copying files..."
scp $SPLUNKFORWARDERTGZ $SPLUNKDEPLOYCLIENTCONF $REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH
ssh $REMOTE_HOST "
    cd $REMOTE_PATH; 
    tar -xzf $REMOTE_PATH/$SPLUNKFORWARDERTGZ ;  
        rm $REMOTE_PATH/$SPLUNKFORWARDERTGZ ;
        mv $REMOTE_PATH/$SPLUNKDEPLOYCLIENTCONF $REMOTE_PATH/splunkforwarder/etc/system/local/deploymentclient.conf;
        splunkforwarder/bin/splunk start --accept-license
"

echo ""

if [ $ENABLE_BOOT_START -gt 0 ]
then
    echo "Enabling Boot Start..."
    ssh $REMOTE_HOST -t -l $REMOTE_USER "sudo $REMOTE_PATH/splunkforwarder/bin/splunk enable boot-start"
fi
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Jun 2020 19:10:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/Forwarder-Installation-Script/m-p/50690#M815</guid>
      <dc:creator>GKC_DavidAnso</dc:creator>
      <dc:date>2020-06-22T19:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Forwarder Installation Script</title>
      <link>https://community.splunk.com/t5/Installation/Forwarder-Installation-Script/m-p/50691#M816</link>
      <description>&lt;P&gt;That's excellent David... I particularly like the 'exam' tag &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;(You might want to mark your own "question" as answered though)&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2013 00:38:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/Forwarder-Installation-Script/m-p/50691#M816</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2013-08-29T00:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Forwarder Installation Script</title>
      <link>https://community.splunk.com/t5/Installation/Forwarder-Installation-Script/m-p/50692#M817</link>
      <description>&lt;P&gt;Feel free to leave comments if you have any questions.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2013 01:37:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/Forwarder-Installation-Script/m-p/50692#M817</guid>
      <dc:creator>GKC_DavidAnso</dc:creator>
      <dc:date>2013-08-29T01:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Forwarder Installation Script</title>
      <link>https://community.splunk.com/t5/Installation/Forwarder-Installation-Script/m-p/50693#M818</link>
      <description>&lt;P&gt;Hi David,&lt;/P&gt;

&lt;P&gt;Works like a charm. Thanks for sharing it. I came in most helpful when I needed.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
Ger&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2013 20:28:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/Forwarder-Installation-Script/m-p/50693#M818</guid>
      <dc:creator>gvhees</dc:creator>
      <dc:date>2013-08-29T20:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Forwarder Installation Script</title>
      <link>https://community.splunk.com/t5/Installation/Forwarder-Installation-Script/m-p/50694#M819</link>
      <description>&lt;P&gt;If you want more detailed explanation and options, Splunk official document for scripted install example is here:&lt;/P&gt;

&lt;P&gt;For *NIX&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Remotelydeployanixdfwithastaticconfiguration"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Remotelydeployanixdfwithastaticconfiguration&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For Windows:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Deployawindowsdfviathecommandline"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Deployawindowsdfviathecommandline&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You may need to use psexec command from another windows host, if you do not have RDP/console access to the target windows client.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2015 00:58:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/Forwarder-Installation-Script/m-p/50694#M819</guid>
      <dc:creator>ashabc</dc:creator>
      <dc:date>2015-12-13T00:58:31Z</dc:date>
    </item>
  </channel>
</rss>

