Dejal

This site is designed to take advantage of CSS. If you are seeing this, CSS must not be available or enabled in your browser. Everything should still work, but won't be as pretty. :)

simon

Scripts for Simon: email on counter change; get screenshot of website

One of the major strengths of Simon, my website and server monitoring tool, is the flexibility it offers through the ability to write custom scripts in many scripting languages. Simon is plenty useful with the built-in services and notifiers, but the ability for customers to enhance it themselves makes it even better.

Recently, two notifier scripts were added. Notifier scripts enable you to provide new ways of being alerted to changes, failures or recoveries of tests.

Firstly, a useful Ruby script called "Email on Counter Change", to notify you via email when a numeric value changes. It was kindly written by a Simon customer, Wade Maxfield. He wrote it work with the output of the MySQL service, though it could be used with other services, and/or customized for different behavior. He describes it thusly:

Parses the results of the test for name/value pairs and then notifies by email if any of the values differ by more than the warningThreshold since the last check. Use a negative number as the warningThreshold if you want to check for values that decrease over time. For use with the MySQL service, and queries like SHOW global status WHERE (variable_name LIKE "Qcache%")

Requires Simon 2.4.1 or newer.

As an example: Set up a Test and Notifier to check if MySQL has restarted. For this test we will check the value of the Uptime status variable in MySQL. Since it shows the current uptime in seconds, it should not decrease, if it does send a notification email since MySQL must have restarted.

In a MySQL Service test set the Server, Port, Database and Security values to whatever are required to connect to your MySQL server, then set the Query to SHOW global status WHERE (variable_name="Uptime"). Add Notifiers for Change and Failure, and set both to use the Notifier you have setup with this script.

In the Notifier, set the mail options as needed. Set the warningThreshold to -1, then if the Uptime variable is ever lower that the previous check, MySQL must have restarted, so this script will send the notification email.

Secondly, I wrote a very simple notifier script called "Show & Screenshot" in answer to a forum query:

Opens the page in the default web browser, waits a few seconds for the page to render, then takes a screenshot of it. Enter the path of a folder to save them to (the folder must already exist). Also specify how long to wait before performing the screenshot, in seconds.

You can download these scripts and much more via the Notifier Scripts section of the Simon Extras page.

Enjoy! And if you create a useful script for Simon, please share it with others!

Simon 2.4.1 released

Simon, my website and server monitoring tool, has been updated to version 2.4.1.

This is a bug-fix release, with a few important fixes to the Port service and notifier plug-in, among other changes.

  • Fixed a bug with building the session script for the Port plug-in.
  • Fixed a bug where a server that returns binary data could cause a Port-based test to fail, with an exception logged in the Console. The binary data is now correctly recorded as hex values.
  • Added a hidden preference to output debug information from the helper for the Port plug-in. It can be activated by entering "defaults write com.dejal.simon2 PortDebugMode YES" in Terminal.
  • Also added a similar hidden preference for the Ping plug-in. Activate via "defaults write com.dejal.simon2 PingDebugMode YES" in Terminal.

Download now!

Simon tip: Preview

Dejal Simon version 2.4 was recently released, and a few of the changes in this version related to the Preview window. This window may not get much love, so I thought I'd devote a tip blog post to it.

As you know, Simon is a website and server monitoring tool. This mouthful is to try to describe two of the levels that Simon operates at. At the very basic level, Simon is a very simple utility to watch web sites, and let you know when they change or go down. But Simon has much more depth to it — it enables you to monitor all sorts of internet servers and services, local applications, local and remote disk volumes, and more.

The Preview window has this duality, too. When used with a web-based test (i.e. one using the Web (HTTP) service), it displays the HTML source at the top of the window, and the rendered web page and graphics in the bottom, with a URL field, Back/Forward buttons, and more, and links etc are fully functional:

Preview for web

This is really handy, both to quickly see the page while in Simon, without having to switch to a web browser (which is easy too, via the Visit Site command), and when setting up the test in the first place.

One of Simon's key features is the Smart Change Detection function. This is a section of the Edit Test window, where you can tell Simon to only look at the HTML source between two blocks of text. This enables you to focus on the part of the page you care about, and avoid dynamic portions like banner ads etc. You can easily set this up via the Preview window. With the Edit Test window open, after entering the URL, click the Preview button to display the preview of the page. Then search through the HTML source for the start text, select it, and click the Copy to Test toolbar button. This will copy that selected text to the Start field in the Edit Test window. Then you can find and select the end text, click the button again, and it's copied to the End text field. Easy!

Smart Change Detection

As useful as this is, it's not done yet. The Preview window is also supported by many other services, in a slightly different way. For non-web services, the Preview window looks a little different. Instead of the HTML source, it displays a summary of the service operation at the top (e.g. the script), and the output at the bottom. This is all plain text, since that's what these services deal with:

Preview for others

These services support the Smart Change Detection feature, too: just like with web pages, you can select text and click Copy to Test (or copy manually) to set up the Start and End text blocks. Unlike web, you can do it from either the source or output areas (and choose those as options in the Smart Change Detection section).

The Script- and Port-based services already supported this mode, but version 2.4 extended it to include the Application and Ping services, too, along with the new Twitter service. So you can now see more information about exactly what's going on with the Ping checks, and more information about the other services. Version 2.4 also made the Preview window more responsive for this mode, showing the source script immediately, instead of after the check is complete, so you can see what it's doing.

I hope you'll use the Preview window to good advantage when configuring and using Simon.

Mac OS X versions for Simon

Since a few people have asked, regarding my announcement yesterday that Simon version 2.4 now requires a minimum of Tiger (Mac OS X 10.4), here's the current breakdown of OS versions for Simon:

  • 63% are on 10.5.2
  • 30% are on 10.4.11
  • 3% are on 10.3.9
  • 4% are on other OS versions (10.4.x or 10.5.x)

So a few people will be affected by this change, but a relatively small number. And that's always dropping, as more people buy new machines or get around to upgrading their OS.

For people stuck on 10.3.9, I'm sorry for the inconvenience... but it had to happen eventually, and Simon 2.3.5 is a fine version.

Interestingly, Simon is a little ahead of the curve when it comes to Leopard adoption. For my other products (excluding Narrator 2, which requires Leopard), the percentage averages to about 56% on 10.5.2, 40% on 10.4.11, 3% on 10.3.9, and 1% on others. So I could drop 10.3.9 support for those too, though I won't until necessary. It'll definitely happen eventually, but not for a while.

Simon 2.4 requires Tiger or later

One of my customers alerted me this morning that the just-released version 2.4 of Simon no longer works on Mac OS X 10.3.9 (Panther). I keep an old clamshell iBook on 10.3.9 for testing purposes, and just confirmed that this was the case. It seems that the framework used for the new Calendar plug-in, which caused hassles when building, also precludes running on 10.3.9. Even removing the framework and the plug-in from the built app didn't help.

I have been planning on dropping 10.3.9 support sometime this year anyway, but have been delaying that as long as possible. It no longer seems possible... so version 2.4 now officially requires a minimum of Tiger, i.e. Mac OS X 10.4 or later. (It works great on Leopard, too.)

I apologize for any inconvenience this may cause. I have updated the Simon site, release notes, and software listings accordingly. I've also added a link to Simon 2.3.5, the last 10.3.9-compatible release, on the Simon site.

If you are still using Mac OS X 10.3.9, I really recommend upgrading to 10.4 or 10.5. Tiger and Leopard include many great enhancements, and almost all software nowadays requires at least 10.4, and more and more are requiring 10.5.

Simon review, sponsoring sites

I read a nice review of Dejal Simon today on the Pixo Bebo blog:

On the surface, Simon is a simple Mac utility which runs all the time, checks web pages, sends out notifications when things are not as they should be. Behind the scenes, Simon is a top-notch server monitoring system with bells and whistles, and each of them have bells and whistles.

and:

All this extra effort on Simon’s part sounds as if it should be ultra complicated, yet, step by step, I found I could fill in the blanks in the Edit Test window, and get Simon to do more. I especially appreciated the notifiers, email messages to tell me what was happening. Cool.

Read the review.

I also signed up to sponsor three sites today:

Check out the sites and support them!

Simon 2.4 released

Simon version 2.4 is now in general release!

This update has a focus on service and notifier enhancements, though it also has a number of other improvements. On the service front, it adds a fantastic new Twitter plug-in, enabling you to monitor a number of aspects of the great Twitter service. You can have Simon watch Twitter updates, direct messages, friends, followers, and more for changes and/or failures. For example, have Simon notify you when someone follows or un-follows you, or someone posts an update (even if you don't follow them), among other possibilities.

The Twitter plug-in also works as a notifier. You can use this to send updates or direct messages to yourself or others via the popular Twitter service when a test has an event. View Simon notifications anywhere you can see tweets! See my Simon Twitter page.

Another handy new notifier plug-in is the Calendar one. This enables you to add events or tasks to iCal, or events to Google Calendar. Failure and recovery events even cover the actual downtime range. This plug-in is only available when Simon is running under Mac OS X 10.5 (Leopard) or later.

The Twitter and Calendar plug-ins were kindly written by Daniel Ellis. Thank you for your efforts!

The existing Port plug-in has had some bug fixes, plus has been extended to work as a notifier. So you can now create port sessions as notifications: have Simon open a connection to a server on a specific port, and send it commands to perform some action. Like the existing Script notifier, this opens up infinite possibilities!

Version 2.4 also bundles several services and notifiers that were only available as separate downloads on the Simon Extras page before, including the Incoming Mail (POP) via SSL, Outgoing Mail (SMTP) via SSL, Mount Volume, Network Time (NTP), Port Available, SNMP Status, and TCP Port Scanner services, and the APC Masterswitch and Growl Change notifiers.

It also includes an iPhone report template, kindly created by Joe Savelberg. This is a simple iPhone web app to allow browsing the Simon monitoring from your iPhone or iPod touch. See a live demo.

iPhone demoiPhone demo

But wait, there's more! This release also enhances other existing plug-ins to work better with the Smart Change Detection and Preview features, adds several handy service and notifier variables, and fixes several bugs.

Finally, it also adds a new preference, allowing simplified status icons, by popular request. Normally, Simon displays a green upwards triangle icon when there is a new change, and the green slowly fades to grey as time goes by. Similarly, it shows a red downwards triangle for a failure, which changes to an orange upwards triangle when it recovers, and that fades over time. With this preference, you can choose to have it simply use red for a failure, bright green for a new change, and a lighter green for success (older change or recovery).

Read the release notes for full details.

Simon 2.4 is a free update for licensed Simon 2 customers.

Download now!

Simon 2.4b3 released

Another day, another beta release! Simon version 2.4b3 is now available. Unless any issues are reported, this will be the last beta for version 2.4:

  • Added a preference to use simplified status triangles, by popular request. Normally, Simon displays a green upwards triangle icon when there is a new change, and the green slowly fades to grey as time goes by. Similarly, it shows a red downwards triangle for a failure, which changes to an orange upwards triangle when it recovers, and that fades over time. With this preference enabled, it uses red for a failure, bright green for a new change, and a lighter green for success (older change or recovery).
  • Fixed a long-standing issue with the Port plug-in's helper, where it could get impatient while receiving text from a slow server. It now waits for a little while if it doesn't receive what it wants, in case the desired text is on its way.
  • Fixed a cosmetic issue with paused tests. If a test was paused for a specified time interval, and it was due to resume while Simon wasn't running, the status icon was being left in the paused state until the test was next checked. It's now set appropriately.
  • Fixed a crasher when previewing a Port-based test. (beta fix)

Download now!

Simon 2.4b2 released

Simon version 2.4b2 is now available:

  • Extended the Port service plug-in to operate as a notifier plug-in too. It is the same as for services, but includes fields for the domain, username and password.
  • The Ping service plug-in now supports the Smart Change Detection and Preview features. So you can now look for changes in parts of the ping output, if desired, and preview the ping session to see what is received.
  • The Application service plug-in also now supports the Preview function.
  • The Preview window for non-web services now displays the source text while performing the check, instead of waiting till done, so you can see what it's doing.
  • Fixed a bug with the Speech notifier plug-in, where the volume slider was only accepting zero and full volumes.
  • Now uses plurals for Checks and Failures units except for values of exactly 1.0. (beta change)
  • Updated the French and German localizations.

Download now!

Simon 2.4b1 released

The first beta release of Simon version 2.4 is now available.

This release adds two major plug-ins, written by Daniel Ellis:

  • Calendar, a notifier plug-in, which enables you to add events or tasks to iCal, or events to Google Calendar. Failure and recovery events even cover the actual downtime range. This plug-in is only available when Simon is running under Mac OS X 10.5 (Leopard) or later.
  • Twitter, a service plug-in, that enables you to monitor Twitter updates, direct messages, friends, followers, and more for changes and/or failures. For example, have Simon notify you when someone follows or un-follows you, or someone posts an update (even if you don't follow them), among other possibilities.
  • Twitter is also available as a notifier plug-in; use it to send updates or direct messages to yourself or others via the popular Twitter service. View Simon notifications anywhere you can see tweets -- on the web, in Twitterrific, or on your cellphone.

Version 2.4b1 also bundles several services and notifiers that were previously only available via the Simon Extras page, including:

  • Incoming Mail (POP) via SSL
  • Outgoing Mail (SMTP) via SSL
  • Mount Volume
  • Network Time (NTP)
  • Port Available
  • SNMP Status
  • TCP Port Scanner
  • APC Masterswitch
  • Growl Change

And unlike previous versions, people already using Simon will now automatically get these additions, unless you've already added them.

A couple of report templates from the Extras page are now also bundled: the iPhone and Variable Test templates, kindly created by Joe Savelberg. The iPhone template is a simple iPhone web app to allow browsing the Simon monitoring from your iPhone or iPod touch. The Variable Test template shows all of the report variables and what they output, to assist in creating or customizing templates.

The test scheduler was also updated, to better queue the checks. When multiple tests are to be checked at once, they are added to a queue, and checked at the interval specified in the Advanced preferences (one per second by default — set to zero to always check immediately). This helps spread out the load, and provides more accurate results. The Next Check column in the tests table shows "queued manually" when multiple tests are queued via a Check Now command, or "queued" and a time interval if queued automatically when due.

A bunch of new service and notifier variables were also added. Plus several other improvements. See the release notes for the full list of changes.

Download version 2.4b1 now! This is a free update for licensed Simon 2 customers. It is a beta release, so please provide feedback if you find any issues, or have any suggestions for improvements.

Syndicate content