<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 23 May 2014 11:21, Vernon Everett <span dir="ltr"><<a href="mailto:everett.vernon@gmail.com" target="_blank">everett.vernon@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Anybody know of a way to give Xymon elevated access permissions when it stats files it's checking?<br></div><div>

I would prefer not to change the directory permissions if I can avoid it.</div></blockquote></div><br>Apart from running Xymon as root, I don't think you can do this.</div><div class="gmail_extra"><br></div><div class="gmail_extra">

An alternative* might be to have a script that creates hard links for all files in /var/crash/ into another directory that the xymon user can read.  For example:</div><div class="gmail_extra"><br></div><div class="gmail_extra">

#!/bin/sh</div><div class="gmail_extra">NEWDIR=/var/crash-monitor  # must be same filesystem as /var/crash</div><div class="gmail_extra">rm -rf "$NEWDIR" || exit 1<br></div><div class="gmail_extra">mkdir -f "$NEWDIR" || exit 1</div>

<div class="gmail_extra">chown root:xymon "$NEWDIR"</div><div class="gmail_extra">chmod 550 "$NEWDIR"</div><div class="gmail_extra">cd /var/crash || exit 1</div><div class="gmail_extra">for file in *; do ln "$f" "$NEWDIR/$f"; done<br>

</div><div class="gmail_extra">ls "$NEWDIR"/*</div><div class="gmail_extra"><br></div><div class="gmail_extra">This creates a replica of /var/crash/ that Xymon can read (and stat the files), without changing the original dir perms and ownership.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">This is run from within the "file:" backticks (using sudo), and so it produces the hardlink names as its output.</div><div class="gmail_extra"><br></div>

<div class="gmail_extra">You could have run this script from root's cron, but you'd have a race condition where sometimes Xymon will look at the replica directory after it has been created but before the hard links have been created. <br>

</div><div class="gmail_extra"><br></div><div class="gmail_extra">*untested</div><div class="gmail_extra"><br></div><div class="gmail_extra">j</div><div class="gmail_extra"><br></div></div>