add log-counter go plugin

This commit is contained in:
David Ashpole
2018-06-20 15:55:19 -07:00
parent 2f915ecf29
commit bf730e9c63
9 changed files with 364 additions and 3 deletions

View File

@@ -108,7 +108,7 @@ func (p *Plugin) run(rule cpmtypes.CustomRule) (exitStatus cpmtypes.Status, outp
}
defer cancel()
cmd := exec.CommandContext(ctx, rule.Path)
cmd := exec.CommandContext(ctx, rule.Path, rule.Args...)
stdout, err := cmd.Output()
if err != nil {
if _, ok := err.(*exec.ExitError); !ok {

View File

@@ -48,6 +48,8 @@ type CustomRule struct {
Reason string `json:"reason"`
// Path is the path to the custom plugin.
Path string `json:"path"`
// Args is the args passed to the custom plugin.
Args []string `json:"args"`
// Timeout is the timeout string for the custom plugin to execute.
TimeoutString *string `json:"timeout"`
// Timeout is the timeout for the custom plugin to execute.