<div dir="ltr">On 26 September 2013 17:34, Rolf Schrittenlocher <span dir="ltr"><<a href="mailto:schritte@ub.uni-frankfurt.de" target="_blank">schritte@ub.uni-frankfurt.de</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On the server we have in<br>
analysis.cfg<br>
HOST=myserver<br>
FILE `/home/mypath/log/update_out_$<u></u>(date +%Y%m%d).txt` MTIME<600 red<br></blockquote><div><br></div><div>You cannot use backticks in analysis.cfg FILE patterns. You have to use a pattern match or a regular expression. So one of these might work for you:<br>
</div><div><br></div><div>FILE "/home/mypath/log/update_out_*.txt" MTIME<600 red<br></div><div><br></div><div>or</div><div><br></div><div><div>FILE "%/home/mypath/log/update_out_[0-9]*\.txt" MTIME<600 red<br>
</div></div><div><br></div><div>These should match whatever file is evaluated by the backtick expression in analysis.cfg. That will only ever be one file, so you should only see alarms for the correct file.</div><div><br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">in client-local.cfg:<br>
[myserver]<br>
file:`find /mypath/log/update_out_$(date +%Y%m%d).txt`<br></blockquote><div><br></div><div><div>If your Xymon user's shell is bourne shell, then the $() form won't work. Bourne shell uses only backticks, but you cannot use backticks either, because Xymon terminates the "file:" expression at the second backtick.</div>
<div><br></div><div>You can probably just run bash, if it's installed, and give it the command you want, using the $() expression, like so:</div><div><br></div><div>file:`bash -c 'find /mypath/log/update_out_$(date +%Y%m%d).txt'` </div>
<div> <br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">In xymonclient.log I see an entry<br>
sh: syntax error at line 1: `(' unexpected<br>
but I don't know if it is related to the file problem or to anything else.<br></blockquote><div><br></div><div>Yes, this is bourne shell complaining about "(" following "$" because it requires an opening paren to be at the start of an expression. It doesn't understand "$(). So try the "bash" thing and see if it works for you. If bash isn't installed, then the same should work for korn shell (ksh).</div>
<div><br></div><div>J</div><div><br></div></div></div></div>