Documentation forAppOptics

Troubleshooting

If you run into any issue installing the SolarWinds Snap Agent or getting metrics reported, please check the troubleshooting techniques below.

Restart the agent

The agent supports standard service control commands including start, stop and restart.

For example, using a command prompt launched as Administrator, you can restart the agent by running net commands:

Copy
net stop swisnapd
net start swisnapd

For example, using a command prompt launched as Administrator, you can restart the agent by running scripts provided with installation:

Copy
restart_solarwinds_snap_agent_service

For example, using a command prompt launched as Administrator, you can stop and start the agent by running scripts provided with installation:

Copy
start_solarwinds_snap_agent_service
stop_solarwinds_snap_agent_service

View the agent logs

The agent log files are located under C:\ProgramData\SolarWinds\Snap\log. There should be the following files:

  • solarwinds_swisnap.log – diagnostic messages from the process monitoring the agent service
  • Install_<date>.log – diagnostic messages during the agent install
  • swisnapd.log – diagnostic messages from the agent as it runs

By default only messages at or above the warning level are reported in swisnapd.log. To increase logging verbosity:

  • Set the log level to 1 (debug) in the agent config file

  • Restart the agent

  • Check for new messages in the log file, for example:

    Copy
    notepad C:\ProgramData\SolarWinds\Snap\log\swisnapd.log

Check the loaded plugins

The SolarWinds Snap Agent includes the swisnap command line tool to interact with the snap daemon on which our agent is based. Out of the box, our agent will automatically load two plugins that enable collecting system metrics (aosystem) and publishing to AppOptics (publisher-appoptics). To check that they are loaded, you can run swisnap plugin list and confirm they are listed as loaded under the STATUS column:

Copy
swisnap plugin list
NAME                  VERSION         TYPE            SIGNED          STATUS          LOADED TIME
aosystem              20              collector       false           loaded          Thu, 23 Nov 2017 18:34:54 UTC
publisher-appoptics   5               publisher       false           loaded          Thu, 23 Nov 2017 18:34:54 UTC

Check the state of tasks

Similar to checking loaded plugins, you can use the swisnap command line tool to check the state of tasks, which define the metrics collection and publishing jobs run by the agent. Out of the box, our agent will automatically define a task to report system metrics continuously every minute.

  • Use swisnap task list to get a list:

    Copy
    swisnap task list
    ID                                           NAME                                            STATE           HIT     MISS    FAIL    CREATED                 LAST FAILURE
    53c0afb1-1e47-471f-b1c0-af69207842eb         Task-53c0afb1-1e47-471f-b1c0-af69207842eb       Running         5       0       0       9:45PM 11-23-2017
    193e1a04-4c9b-495e-a9de-06862c57b092         Task-193e1a04-4c9b-495e-a9de-06862c57b092       Ended           10      0       0       9:45PM 11-23-2017
  • The above output shows a running task. To further confirm that it is the one reporting system metrics, you can either use the swisnap task export <task id> command to print to console the task details, or use the swisnap task watch <task id> command which logs to console the metrics being gathered at each task interval. An example of the watch command:

    Copy
    swisnap task watch 53c0afb1-1e47-471f-b1c0-af69207842eb
    Watching Task (53c0afb1-1e47-471f-b1c0-af69207842eb):
    NAMESPACE                   DATA                    TIMESTAMP
    /system/cpu/guest           0                       2017-11-23 21:58:00.004377321 +0000 UTC
    /system/cpu/idle            99.5330998828381        2017-11-23 21:58:00.004382944 +0000 UTC
    ...
    (ctl-c to quit)

Run the plugin directly

If you're experiencing issues with a specific integration and the agent logs are not providing much help, you can also run the binary for the plugin independently of the swisnap service to attempt a collection. This could reveal errors or permission issues that are being obscured.

Copy
C:\Program Files\SolarWinds\Snap\bin\<plugin_binary>  --config '<config to use in JSON format>'

Agent not reporting metrics: "context deadline exceeded" error

Occasionally you may run into a situation where the SolarWinds Snap Agent will not connect to AppOptics or report metrics.

If you see a similar error to the following in C:ProgramDataSolarWindsSnaplogswisnapd.log:

Copy
ERRO[2018-06-12T09:12:08Z] time="2018-06-12T09:12:08Z" level=error msg="Error getting cpu" err="unable to get cpu. Error: context deadline exceeded" _module=plugin-exec io=stderr plugin=publisher-appoptics

This is caused by a WMI Performance Counter timeout. To increase the timeout, change the value of host_check_timeout setting in publisher-appoptics and publisher-processes sections in main configuration file config.yaml:

Copy
plugins:
   include: /opt/SolarWinds/Snap/etc/plugins.d
   publisher:
     publisher-appoptics:
       all:
         token: "c6260446e584d8afcafcafcafcafcafcafc112233441128e68ef4ea3f2b289d50"
         url: "https://api.appoptics.com/v1/measurements"
         ...
         # host_check_timeout allows to configure timeout for querying host operating system for identification informations,
         # like interfaces, CPUs, etc. By default it is set to 5s.
         host_check_timeout: "5s"
     ...
     publisher-processes:
       all:
         token: "c6260446e584d8afcafcafcafcafcafcafc112233441128e68ef4ea3f2b289d50"
         url: "https://api.appoptics.com/v1/agent/report"
         ...
         # host_check_timeout allows to configure timeout for querying host operating system for identification informations,
         # like interfaces, CPUs, etc. By default it is set to 5s.
         host_check_timeout: "5s"

If the agent will still be unable to collect host identification, you can try the following steps to resolve this issue:

https://support.microsoft.com/en-us/help/2554336/how-to-manually-rebuild-performance-counters-for-windows-server-2008-6

The scripts are not supported under any SolarWinds support program or service. The scripts are provided AS IS without warranty of any kind. SolarWinds further disclaims all warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The risk arising out of the use or performance of the scripts and documentation stays with you. In no event shall SolarWinds or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the scripts or documentation.