#160 closed enhancement (fixed)
Extend capabilities of syntax argument.
|Reported by:||Matthew||Owned by:||mickem|
The CheckFile command returns the name of each file matched. If the length of all names exceeds 1024 (or 4000 odd now I guess) bytes the message can not be sent. Not only does this necessitates the use of the truncate argument but the end messages on the Nagios GUI tend to be pretty opaque. This gets worse if you use the syntax argument as the expression used as the syntax is repeated for each matched file. I would like to suggest the following to improve this:
- Additional variables: %MinWarn% or %MaxWarn%, %MinCrit% or %MaxCrit% and %Result% as returned in the performance data.
- Additional variable: %Matches% (ie. in CheckFile all matched files.)
- Additional variable: %Status% (ie. OK Warning Critical)
- The syntax argument have the ability to only be evaluated once - maybe a new argument (eg. syntax_unique) easiest way to do this.
for Directory c:\tmp containing files 1.xml 2.xml 3.xml
CheckFile file=c:\tmp\*.xml syntax_unique="%Status%: %Result% files match" MaxWarn=3 MaxCrit=4 filter-size=>0
should return something like
Warning: 3 files match|''=3;3;4;
CheckFile file=c:\tmp\*.xml syntax_unique="%Result%: These files found: %Matches%" MaxWarn=3 MaxCrit=4 filter-size=>0
Should return something like:
Warning: These files found: 1.xml 2.xml 3.xml