Simon icon Simon
Flexible server monitoring

Reporting context and capturing images

Dear Simon forum,

Now that I have Simon working and have a better grasp on how filters and other report features work, I am trying to determine if I can capture the context of a change, rather than just the change itself.

For instance, I currently have a test searching for changes to a job search wiki here: http://psychjobsearch.wikidot.com/. I get reports on changes such as "offer made", but these are not very helpful without the institution name that falls at the start of the line (I have to load the page in a browser and search for the modified text -- whereas what I would like is "Institution X: bla bla offer made").

Is there a way to incorporate context (say the entire text belonging to each line rather than just the changed part of the line) using the Simon filters? I searched and couldn't find a thread on this topic in the forum.

Also, is it possible to download an image if a change is detected? I would like to grab an image from a webcam, say every 15 min, and the test scheduler in simon seems like a good way to do that.

Thanks in advance for your help.

Cheers,
James Brown

David Sinclair's picture

Re: Reporting context and capturing images

Hi James,

Context: that's a tricky one. It's probably possible, e.g. via a custom filter script, but I'm not sure how. Anyone else have any ideas?

Webcam: that may depend on how the webcam works. Is it possible to capture an image via a script? If so, you could use a custom service script to do that. If the webcam image is on-screen (e.g. you leave an auto-refreshing web page for it frontmost), you could use the existing Screenshot service.

Re: Reporting context and capturing images

Hi David,

I'm not sure how you have things coded, but would it be possible to implement context as an additional filter that expands the selection by letting the user specify custom text or markup to designate the boundaries (e.g., and )?

Thanks for the suggestions about image capture, I'll play with scripts and see what I can do.

Re: Reporting context and capturing images

The code didn't work on that last post, but it should have showed HTML boundaries p and slash p.

David Sinclair's picture

Re: Reporting context and capturing images

Yes, a new custom filter could do it... though I'd have to add extra variables to output the range of the difference, since it could occur multiple times in the original text. But that'd be a useful addition too.

I'll add this to the feature ideas list. Thanks for the suggestion!

David Sinclair's picture

Re: Reporting context and capturing images

Good news: version 3.7 (in beta soon) has a new Context filter, to output more context around the output of a previous filter. You can choose a number of characters or a delimiter (or both) to extend the context before and after the text.

There are a number of new filter variables to support this, which may be useful for other filters or notifiers too.