SolarWinds Snap Agent (Linux)

The SolarWinds Snap Agent is based on Intel’s Snap Telemetry Framework an open framework designed to simplify the collection, processing and publishing of system data through a single API.

Here are some key features of Snap:

  • Plugin Architecture: Easily add collectors, streaming collectors, processors and publishers.
  • Collectors - Collectors gather telemetry data at determined intervals.
  • Streaming Collectors - Streaming collectors gather telemetry data when they are available.
  • Processors - Process data before sending it on.
  • Publishers - Defines where to send the data - this is how we send the data to AppOptics.

Easy Installation

To find the easy installation guide, go to AppOptics home page and click on the “Add Host” button. It will show you these steps to install the SolarWinds Snap Agent via our install wrapper script:

  1. Download install wrapper script from https://files.solarwinds.cloud/solarwinds-snap-agent-installer.sh:

    $ curl -sSO https://files.solarwinds.cloud/solarwinds-snap-agent-installer.sh
    
  2. Run install wrapper script, passing in the API token with the --token option.

    $ sudo bash solarwinds-snap-agent-installer.sh --token <your api token> [--yes] [--debug]
    

The easy install walk through will include the API token. If you want to create your own token, follow the instructions described in API Tokens and Token Roles.

The metrics API token can also be set via the SOLARWINDS_TOKEN or APPOPTICS_TOKEN environment variable:

$ export SOLARWINDS_TOKEN=<your api token>
$ sudo -E bash solarwinds-snap-agent-installer.sh [--yes] [--debug]

If both SOLARWINDS_TOKEN and APPOPTICS_TOKEN environment variables are set, SOLARWINDS_TOKEN will be used. Using APPOPTICS_TOKEN is not recommended, and it is supported only for backward compatibility.

More information about different options provided by installer script can be found using the --help option. To troubleshoot issues during installation --debug option can be used.

For manual installation without install script follow Advanced Installation

Installation with log monitoring

  1. To enable log monitoring installation script has to be invoked with additional option –detect-logs:
$ sudo bash solarwinds-snap-agent-installer.sh --token <your api token> --detect-logs [--yes] [--debug]

If you are Loggly client with different Loggly and AppOptics tokens, you have to invoke installation script with additional option:

$ sudo bash solarwinds-snap-agent-installer.sh --token <your api token> --detect-logs --loggly-token <your loggly token> [--yes] [--debug]

After script execution API token would be stored in logs plugin configuration file /opt/SolarWinds/Snap/etc/plugins.d/logs.yaml

For now PaperTrail configuration need to be done by changing configuration file. Follow Logs page to find more detailed inforamation about PaperTrail settings

  1. During installation process user will be asked if found logs should be monitored. If “no” option is chosen configuration with detected logs will be stored in example file: /opt/SolarWinds/Snap/etc/plugins.d/logs.yaml.example.new and detected logs will not be monitored.

Note

Using --yes option in installation script skips direct question to user. Detected logs are monitored by default

  1. Configuring log files:

Enter the full paths to the logs you want to monitor under logs: > all: > files in /opt/SolarWinds/Snap/etc/plugins.d/logs.yaml file on your server

Follow Logs page to find more details about configuration file.

After installation log plugin will be started.

Installation with TLS encrypted REST API

To enable encrypted REST API user has to pass --secure option to installation script:

$ sudo bash solarwinds-snap-agent-installer.sh [--yes] [--debug] --token <your api token> --secure

Installer will ask for REST authentication password and paths to REST certificate and key - solarwinds user has to have read access to both certificate and key.

Note

REST Certificate should be signed by trusted CA (it has to be stored in system’s keychain).

User now has three options of running Snap’s CLI:

  1. Environment variables:
export SNAP_REST_PASSWORD=true
export SNAP_URL=https://<listen_address>:<listen_port>

# then, each swisnap call will ask for API password.

swisnap plugin list
  1. CLI flags:
swisnap --password --url https://<listen_address>:<listen_port> plugin list
  1. Mix of config and environment variable:
cat > swisnap-config.json <<EOF
{
  "rest": {
    "rest-auth-pwd": "mypassword"
  }
}
EOF

export SNAP_URL=https://<listen_address>:<listen_port>
swisnap --config swisnap-config.json plugin list

Installation with TLS encrypted communication between Snap and it’s plugins

To enable encrypted communication between Snap and it’s plugins user has to:

  • set --secure flag
  • either provide copy of previously generated CA certificate and certificate-key pairs for Snap and plugins, or let the installer script generate them.

Note

If user chooses to generate keys and certificates, then it is required to provide passphrases to each of the key.

Passing previously generated certificates:

$ sudo bash solarwinds-snap-agent-installer.sh [--debug] --token <your api token> [--yes] --secure --ca-path /path/to/ca.crt --plugin-cert-path /path/to/plugin.crt --plugin-key-path /path/to/plugin.pem --snap-cert-path /path/to/snap.crt --snap-key-path /path/to/snap.pem

Letting script generate required files:

$ sudo bash solarwinds-snap-agent-installer.sh [--debug] --token <your api token> [--yes] --secure --ca-passphrase <capassphrase> --plugin-passphrase <pluginpassphrase> --snap-passphrase <snappassphrase>

If user omits optional [--yes] flag, then the script will ask for confirmation before generating each certificate.

Note

Generated certificates, sign requests and keys are stored in /tmp/SolarWinds/Snap/ directory.

Note

Autoload plugins will use certificate and key specified by --plugin-cert-path and --plugin-key-path

Upgrade

Follow these steps to upgrade the agent:

For deb based platforms:

$ sudo apt-get install solarwinds-snap-agent

For rpm based platforms:

$ sudo yum update solarwinds-snap-agent

Note

If you’ve made local changes to /opt/SolarWinds/Snap/etc/config.yaml or default task files under /opt/SolarWinds/Snap/etc/tasks.d, the package manager should preserve those changes either by default or with an optional setting, please refer to your package manager manual for details.

Logrotate

SolarWinds Snap Agent package by default contains logrotate configuration file /opt/SolarWinds/Snap/etc/logrotate.d/solarwinds-snap-agent for rotating /var/log/SolarWinds/Snap/swisnapd.log. The logrotate configuration file is automatically linked to /etc/logrotate.d/ folder during agent installation if logrotate is present on the system. If logrotate is not installed while installing agent, you will need to link logrotate configuration file manually.

Uninstalling the Agent

For deb based systems:

$ sudo apt-get remove solarwinds-snap-agent

for RPM based systems:

$ sudo yum erase solarwinds-snap-agent

Uninstall Script:

$ sudo bash /opt/SolarWinds/Snap/support/before-remove.sh
$ sudo bash /opt/SolarWinds/Snap/support/after-remove.sh

The SolarWinds Snap Agent will be automatically removed from the Infastructure Host view after 60 minutes.

Troubleshooting

To learn more about how to restart the SolarWinds Snap Agent, where its log file is located, and other common troubleshooting techniques, please check the Troubleshooting page.

Lean more about: