Since SAM 6.3 supports installing SolarWinds Orion agents on Linux-based computers, you can use automation technologies like Chef or Puppet to mass deploy them. The examples show two different scripting methods to deploy agents. These methods are independent of Chef or Puppet and either method can be used to automate your agent installations if it is supported by your automation software. And a special thank you to Toby.
By the way, SolarWinds doesn't support these automation technologies, and the instructions are provided as reference only and assume that your automation software is installed and configured correctly.
Here's what we've got:
Deploy an agent with an expect script
This method uses a Chef cookbook to create and deploy an expect script to target nodes. It contains two parts that must be performed in order.
Here's the example recipe used in the instructions:
# Install the swiagent package using the repository
package 'swiagent'
# Create a driver to configure the agent
cookbook_file '/opt/SolarWinds/Agent/bin/driver.ini' do
source 'driver.ini'
owner 'swiagent'
group 'swiagent'
mode '0755'
action :create
end
# Start the agent and configure it
# You only have to start and configure the agent once.
# Assume that if the swiagent.cfg file exists, the agent is provisioned
execute 'swiagent init' do
command 'cat /opt/SolarWinds/Agent/bin/driver.ini | service swiagentd init'
creates '/opt/SolarWinds/Agent/bin/swiagent.cfg'
end
- Create a recipe.
- Configure the node to use the SolarWinds repository.
- Get the package from the repository.
package 'swiagent'
- Create the driver.
cookbook_file '/opt/SolarWinds/Agent/bin/driver.ini' do
source 'driver.ini'
owner 'swiagent'
group 'swiagent'
mode '0755'
action :create
end - Start and configure the agent.
execute 'swiagent init' do
command 'cat /opt/SolarWinds/Agent/bin/driver.ini | service swiagentd init'
creates '/opt/SolarWinds/Agent/bin/swiagent.cfg'
end - Save the recipe.
- Create a driver.ini file that configures the agent to connect to the poller and use a specific Orion credential.
2
IPaddress
4
admin
7
You can apply the cookbook to any Chef registered node that you want to monitor with an Orion agent.
Deploy an agent with a shell script
This method uses a Puppet manifest to deploy a shell script to target nodes. It contains three parts that must be performed in order on the Puppet master node.
- Create a module with an swiagent class.
class swiagent {
file { 'swi-driver':
path => '/tmp/driver.sh',
ensure => 'present',
replace => 'no', # always include this resource declaration
mode => '0644',
source => 'puppet:///modules/swiagent/driver.sh',
} ->
exec { 'provision_agent':
command => 'sh /tmp/driver.sh',
path => '/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin',
creates => '/opt/SolarWinds/Agent/bin/swiagent.cfg',
}
} - Create a driver.sh file located in swiagent/files/.
- Click All Settings > Agent Settings > Download Agent Software.
- Click Linux, and Next.
- Click Manually Install by Downloading Files via URL, and click Next.
- Select your Distribution and Communication Mode
- Enter the Connection Settings.
- Click Generate Command.
- Copy this command to the driver.sh file.
bash -c 'x(){ P=/Orion/AgentManagement/DownloadLinuxOnlineInstallScript.ashx?
requestId=eeaeac49-75c7-46bb-83b8-ee22c4924ef1;U=(http://host.local:8787/
http://host:8787http://[2001:10:110:6:c802:e60b:70ba:7495]:8787
http://192.168.10.143:8787);dt(){ D=(wget curl);A=(-O\ -\ --no-check-certificate\
--tries=1\ --read-timeout=30 --insecure\ --retry\ 1); for((i=0;i<${#D[@]};i++));do
which ${D[$i]}&>/dev/null&&export DT="${D[$i]} ${A[$i]}"&&return;done;>&2 echo
"Cannot find download tool - please install some (${D[*]}) or use other
installation method";exit 1;};dt;echo export DT=\"$DT\";>&2 echo; >&2
echo -n "Downloading installation data from Orion Poller...";for u in ${U[*]};do
echo "export URL=\"$u\""; if ${DT} $u$P 2>/dev/null; then FOUND=1; break; fi; >&2
echo -n "."; done; >&2 echo ""; if [ "${FOUND}" != "1" ]; then >&2 echo "Unable to
connect to Orion Poller to download agent package. Please use an alternate deployment
method, such as Add Node wizard."; >&2 echo "See http://www.solarwinds.com/documentation
/helpLoader.aspx?lang=en&topic=OrionAgentDeployAgentTop"; exit 1; fi; };X=$(x);bash -c "${X}"'
- Add to the following to the main manifest for each node you want to monitor with an Orion agent:
node 'host.local' {
include swiagent
}
The next time the node pulls its configuration from the master, it evaluates the main manifest and apply the swiagent module.
Agent configuration options
These options may be different than the latest options built into the agent. Log on to the computer with the agent installed on it and type service swiagentd init
to ensure that these options match the latest version of the software.
Cancel and Exit without Saving
Agent Mode (1 - Agent Initiated, 0 - Server Initiated) [1]
Orion Poller Hostname/IP [10.110.6.154]
Orion Poller Port [17778]
Orion Username [admin]
Orion Password []
Proxy Settings... [mode=disabled]
Save Changes and Exit