Simon icon Simon
Flexible server monitoring

Introducing Simon 5!

Simon version 5 is now available. It is a massive update, introducing a much-requested feature: syncing the Simon data between multiple Macs, plus a Simon Status service, a Link Checker filter, improved Find filter, iMessage and Speak Error notifiers, a new app icon, and much more.

Important: please note that Simon 5 requires a minimum of macOS 10.12 (Sierra), and is a paid upgrade from Simon 4. Purchasers since September 1, 2020 automatically get a version 5 license (that also works in previous versions).

Read the Simon What's New page for details.

Filter script to find deleted content?

Hi script experts!

I had a query that seems fairly simple, but has defeated me... though I think I'm close. The user wanted to be notified if someone deletes a file from a FTP directory. It's easy to get the FTP directory list, via the appropriately-named FTP Directory Listing service. And a simple Change filter will list any change. But it won't show deleted content.

So, my thought was to create a Script-based filter, and use the diff command to detect the changes, including deletions.

My initial thought was to use the {FilterPreviousText} variable, but that would just show the previous diff output, which isn't very helpful.

So I came up with the following script, which saves the filter input (i.e. the output from the service) to a file, compares it to what it was before (saved in a "previous" file), then updates the previous file for next time. In theory this should work, but it doesn't output anything, even when there is a change. Probably something obvious to anyone more familiar with shell scripts. Can anyone help? Or offer a better solution?

mkdir -p /tmp/dejal/simon/{TestIdentifier}/diff
cd /tmp/dejal/simon/{TestIdentifier}/diff

input_text="{FilterInputText}"

echo $input_text > input

diff previous input

echo $input_text > previous

Thanks!