On 22 April 2013 17:15, Jeremy Laidman <user-71895fb2e44c@xymon.invalid> wrote:
On 22 April 2013 14:54, Jeremy Laidman <user-71895fb2e44c@xymon.invalid> wrote:
config files on the Xymon server. For example, something like this in
client-local.cfg:
log:`if [ -f /tmp/pw.rep ]; then if grep '^[0-9]' /tmp/pw.rep | tail -n
+3 | grep ^ >/dev/null; then cp /dev/null /tmp/pw.rep; fi; diff /tmp/pw.old
/etc/passwd >> /tmp/pw.rep; else touch /tmp/pw.rep; fi; cp /etc/passwd
/tmp/pw.old; echo /tmp/pw.rep`:2048
Updated to work with non-GNU tail (eg on Solaris):
log:`if [ -f /tmp/pw.rep ]; then if grep '^[0-9]' /tmp/pw.rep | tail +3 |
grep ^ >/dev/null; then cp /dev/null /tmp/pw.rep; fi; diff /tmp/pw.old
/etc/passwd >> /tmp/pw.rep; else touch /tmp/pw.rep; fi; cp /etc/passwd
/tmp/pw.old; echo /tmp/pw.rep`:2048
J