does anyone see any issues with doing something like this:
I wanted to see the actual changes in the files..
So I created an item like the following:
it checks the file against the backup of the file and if they are the same it "echo 0" ; if they are different then it does a sdiff on the two files ; It then outputs the original file to the backup location
Then a trigger:
Anytime the file changes, I now receive the exact text of what changed in the file.
I wanted to see the actual changes in the files..
So I created an item like the following:
it checks the file against the backup of the file and if they are the same it "echo 0" ; if they are different then it does a sdiff on the two files ; It then outputs the original file to the backup location
Code:
system.run[cmp -s /etc/somefile /tmp/file.bak && echo 0 || sdiff /etc/somefile /tmp/file.bak; cat /etc/somefile >/tmp/file.bak]
Code:
{Template Operation File Validations:system.run[cmp -s /etc/somefile /tmp/file.bak && echo 0 || sdiff /etc/somefile /tmp/file.bak; cat /etc/somefile >/tmp/file.bak].prev(0)}=0 & {Template Operation File Validations:system.run[cmp -s /etc/somefile /tmp/file.bak && echo 0 || sdiff /etc/somefile /tmp/file.bak; cat /etc/somefile >/tmp/file.bak].diff(0)}=1