I dug up an older thread here about how to configure Chef to install the agent, and my recipe is like so:
orion_ip = sw_dc_settings['orion_ip']
poller_ip = sw_dc_settings['poller_ip']
# Install the swiagent package using the repository
template '/etc/apt/sources.list.d/solarwinds.list' do
source 'solarwinds.list.erb'
owner 'root'
group 'root'
mode '0644'
variables sw_orion_ip: orion_ip
notifies :run, 'execute[apt-get update]', :immediately
end
package 'swiagent'
# Create a driver to configure the agent
template '/opt/SolarWinds/Agent/bin/driver.ini' do
source 'driver.ini.erb'
owner 'swiagent'
group 'swiagent'
mode '0755'
variables sw_poller_ip: poller_ip,
sw_orion_user: moxie_sw_user,
sw_orion_pass: moxie_sw_pass
not_if { File.exist?('/opt/SolarWinds/Agent/bin/swiagent.cfg') }
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;rm /opt/SolarWinds/Agent/bin/driver.ini'
creates '/opt/SolarWinds/Agent/bin/swiagent.cfg'
end
About the username and password in the driver.ini file... that is only used for initial registration, correct? If the credentials get updated, I don't need to run around pushing a new config file, do I?