Skip to content

Latest commit

 

History

History
55 lines (41 loc) · 4.2 KB

README.system_checker.md

File metadata and controls

55 lines (41 loc) · 4.2 KB

Overview

This command handles system-related checks such as looking for core dumps or checking for changes in files (using MD5 checksum).

System Checkers

The system "checker"s provided are outlined below.

Find File Checker

This checker looks for files matching a pattern (such as core dumps) in a configurable set of directories. If a file matching the pattern exists, it will send an event to Wavefront and record the file (using the MD5 hash of the file contents) in the configured cache location so it won't be sent again.

A single file is created in the cache_dir location to record matching files found. This file stores only the MD5

File Changed Checker

This checker is used to compare MD5 checksums of a set of files. If the MD5 checksum has changed, an event is sent to Wavefront. Once the event is recorded, the "current" MD5 checksum is updated. Only one event is sent for each file change.

The "current" MD5 checksum is stored in the cache_dir directory in a file called wf_md5_hashes.conf. This file contains one section hashes with the one key/value pair per file checked. The key will be the absolute file path of the file checked and the value will be the last MD5. If no MD5 is set, the first run of this checker will use the current MD5.

If the hash has changed, the updated hash is saved to the wf_md5_hashes.conf file for the file and an event is sent. If the event is not successfully sent to Wavefront, the wf_md5_hashes.conf file will remain unchanged.

Command Line Options

Option Description Default
--config FILE Full path to the configuration file /opt/wavefront/etc/system_checker.conf

Configuration

The configuration is retrieved from and stored in an INI-formatted file with multiple groups. Each group is described in more detail in the following sections.

This configuration file also acts as a fileconfig for the logger. See fileConfig definition for more details on how to configure logging.

Section: global

Option Description Required? Default
cache_dir The directory where additional information is cached for each of the checkers. For example, the file change checker stores the MD5 of each file found in the files changed checker. Yes /tmp
source_name The source name to send for events generated by this script. Yes System Hostname
log_requests Enable debug logging of API requests. This is useful for debugging of APIs. When True, httplib.HTTPConnection.debuglevel = 1 is executed. See documentation and an example from stackoverflow for more details. No False
ignore_ssl_cert_errors True ignores the SSL errors/warnings when connecting to the API endpoint. False

Section: wavefront

Option Description Required? Default
api_key The API token to make API requests on behalf of Yes None
api_base The API base URL Yes https://metrics.wavefront.com

Section: find_files

Option Description Required? Default
paths Comma-separated list of paths to search for files. No None
patterns Comma-separated list of patterns to search for in the directories in the paths key. The number of values in this key must be the same as that of paths. No None
event_names Comma-separated list of event names to use when a file is found. The number of values in this key must be the same as that of paths. No None

Section: files_changed

Option Description Required? Default
files Comma-separted list of files including path that should be checked No None
event_names Comma-separated list of event names to use when a file is found to have changed. The number of values in this key must be the same as that of files. No None