ConSol-Monitoring / mod-gearman-worker-go

Mod-Gearman Worker rewrite in Golang
GNU General Public License v3.0
7 stars 10 forks source link

Very strict command parser to determine execution type (Shell, exec, EPN or internal) #22

Closed nook24 closed 8 months ago

nook24 commented 1 year ago

Currently the worker makes use of a very restrictive way of determining if a command should be executed through a shell, exec or EPN. I noticed this while I was playing around with the check_nwc_health plugin. It supports arguments like this: --warningx ".*usage.*"=$ARG2$ --criticalx ".*usage.*"=$ARG3$. Due to the command contains a *, it will not use EPN but the shell instead.

https://github.com/ConSol-Monitoring/mod-gearman-worker-go/blob/04cdf5304a49537177fb1a494fe1fd7522def188/command.go#L51-L53

Honestly speaking I'm not sure what would be a good solution to resolve this.

sni commented 8 months ago

this should work much better with the next release. Basically everything in single quote will be ignored then. So your example should be passed to the epn worker then.

nook24 commented 8 months ago

Thanks :)