check-diff

command module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 13 Imported by: 0

README

check-diff

Check the difference between the results of the command. check-diff is written to work as a mackerel check plugin.

This is a rewrite of kazeburo/diff-detector with the same functionality.

Usage

% ./check-diff -h
Usage:
  check-diff [OPTIONS] -- command args1 args2

Application Options:
      --identifier= indetify a file store the command result with given string

Help Options:
  -h, --help        Show this help message

Example

% echo $(date) > date.txt
% ./check-diff -- cat date.txt 
check-diff OK: first time execution command: 'cat date.txt'
% ./check-diff -- cat date.txt
check-diff OK: no difference: ```Wed Aug 12 00:39:23 JST 2020```

% echo $(date) > date.txt     
% ./check-diff -- cat date.txt
check-diff CRITICAL: found difference: ```@@ -1 +1 @@
-Wed Aug 12 00:39:23 JST 2020
+Wed Aug 12 00:39:40 JST 2020```

mackerel.conf example

[plugin.checks.uname-changed]
command = "/usr/local/bin/check-diff -- uname -a"

[plugin.checks.passwd-changed]
command = "/usr/local/bin/check-diff -- cat /etc/passwd"

Install

Please download release page or mkr plugin install kazeburo/check-diff.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL