sensu / sensu-check-log

The Sensu Go log file monitoring check plugin and asset.
MIT License
2 stars 3 forks source link

Add better error handling when incorrect/non-existent values are provided the state dir flag #37

Open lspxxv opened 2 years ago

lspxxv commented 2 years ago

In internal ref https://secure.helpscout.net/conversation/2016338466/29933?folderId=4465878, the customer points out the lack of error handling when stating a non-existent state directory leading to a much more difficult time when troubleshooting. The error output is the generic help text/syntax error pasted below.

sensu-check-log [flags] sensu-check-log [command] Available Commands: help Help about any command version Print the version number of this plugin Flags: -a, --analyzer-procs int Number of parallel analyzer processes per file. (default 4) -t, --check-name-template string Check name to use in generated events (default "{{ .Check.Name }}-alert") -C, --critical-only Only issue critical status if matches are found -c, --critical-threshold int Minimum match count that results in an warning (default 5) -D, --disable-event-generation Disable event generation, send results to stdout instead. -n, --dry-run Suppress generation of events and report intended actions instead. (implies verbose) -u, --events-api-url string Agent Events API URL. (default http://127.0.0.1:4041/events) -h, --help help for sensu-check-log -I, --ignore-initial-run Suppresses alerts for any matches found