Package: wavefront_collector
OverviewThe Wavefront collector facilitates external integrations with Wavefront. This allows metrics from external services such as New Relic to be pulled into Wavefront. Each integration is a executed via this utility using the command name specified in the table below.Current IntegrationsIntegrationCommand NameDescriptionPython FileAppDynamicsappdynamicsMetrics from AppDynamicsappdynamics.pyNew RelicnewrelicExtracts metrics from New Relic APInewrelic.pyAWS CloudwatchawscloudwatchMetrics pulled from AWS Cloudwatchawscloudwatch.pyAWS BillingawsbillingAWS Billing metrics retrieved from Billing Reportsawsbilling.pyLinux System CheckersystemcheckerCreates Wavefront events when files matching a pattern are found (e.g., core dumps) or when files have changedsystem_checker.pyInstallationPrerequisitesA couple of Linux development packages are required to run the collector:libffi-developenssl-develInstall using pip or using the provided setup.py.> pip install wavefront_collectorExecuting an IntegrationThewfscript (a symlink towave.py) is the primary interface to running commands. This script supports 2 methods of running a command:Command lineConfiguration fileRun Method 1: Command LineRunning a command via the command line is the simplest method. It allows you to execute a single integration in either the foreground or background. In this mode, thewfscript has the following command line options:ArgumentOptionDescription--daemonN/ARun in the background as a daemon. The default is foreground without this option.COMMANDN/AExecute the given command (seeCurrent Integrationssection above for names available).--configFILEProvide the configuration file to theCOMMAND. The default path and file is set by each command.Additional options available in daemon mode (i.e., when using –daemon option):ArgumentOptionDescription--pidFILEThe path to the PID file where the PID will be written (default: ./wavefront.pid)--outFILEThe path to the file that will capture STDOUT and STDERR (default: ./wavefront.out)--delaySECONDSThe number of sections to delay between each iteration (default: 90)Command Line ExamplesExamples of executing thesystemcheckerintegration from the command line using thesystem_checker.conffile.``system_checker.conf``[global]
cache_dir=/tmp/sc-wavefront-cache

[find_files]
paths=/tmp/
patterns=core*
event_names=core-dump

[wavefront]
api_key=TOKEN
api_base=https://INSTANCE.wavefront.comExecute the ``systemchecker`` command just once in the foreground> wf systemchecker --config system_checker.confExecute the ``systemchecker`` command in the background and continue running every 30s> wf --daemon --delay 30 systemchecker --config system_checker.confRun Method 2: Configuration FileThe configuration file execution mode allows you to run one or more commands (either simultaneously or separately). In this mode, thewfscript has the same command line options as thecommand line mode. Options specified on the command line take precedence over those in the configuration file. One additional required argument is the configuration file path:ArgumentOptionDescription-cFILEThe configuration file to describe the command(s) to execute. This is the option that puts the script into “configuration file mode”. See below for the supported options in the configuration file.-cFILEoptionmustbe supplied on the command line to indicate towfthat it should determine which command(s) to run from the configuration fileFILE.Configuration File SpecificationThis section outlines the specification of the configuration file that thewfscript supports when loading and executing commands from a file rather than the command line.Section: globalConfiguration KeyRequired?DefaultDescriptiondaemonNfalseRun in the background or foreground. The command line option will override this value.outN./wavefront.outThe file to put the STDOUT and STDERR in. The command line option will override this value. NOTE: This is only valid when in daemon modepidN./wavefront.pidThe location of the PID file. The command line option will override this value. NOTE: This is only valid when in daemon modethreadsYNoneThe comma-separated list of commands to run in separate threads. The name provided here can be anything as it is just a placeholder for the section name where the configuration of each command resides. Each name listed here requires an additional section in the configuration file labeledthread-[threadname].Section: thread-[thread name]There should be one section per name listed in thethreadskey in theglobalsection.Configuration KeyRequired?DefaultDescriptioncommandYNoneThe name of the command to executeargsYNoneThe comma separated list of arguments. Each argument should be separated by a comma (even values provided to a given argument). Example: –config,foo.conf,–verbosedelayNNoneThe number of seconds to delay between each iteration of this command being executed. If delay is not set, only one iteration will be executed and thewfscript will end.Service Scriptwavefront-collectoris provided to execute the collector as a service. This script has following options:start- starts the service running in the background using--daemon--pid/tmp/wavefront-collector.pid--out/tmp/wavefront-collector.log-c/opt/wavefront/etc/wavefront-collector.confstop- stops the service by sending a SIGTERM signal to the PID in the PID file/tmp/wavefront-collector.pidstatus- prints the current status of the service (running or not) and the last lines of the log file if the service is runningrestart- stops, then starts the service using the above commandsConfiguration File ExamplesExecute ``systemchecker`` and ``awscloudwatch`` in the foreground via the command line mode (iterating once every 60 and 90 seconds respectfully)> wf -c example.conf``example.conf``[global]
pid=/tmp/wf.pid
out=/tmp/wf.out
daemon=false
threads=sc1,cloud1

[thread-sc1]
command=systemchecker
args=--config,system_checker.conf
delay=60

[thread-cloud1]
command=awscloudwatch
args=--config,awscloudwatch.conf
delay=90Additional DetailsCreate a new command by following theseinstructions