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. :)

David Sinclair's blog

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!

MacTech Spotlight: David Sinclair

Last year I was featured in MacTech magazine as their developer spotlight for the month. They asked me some questions about my background; here are my responses:

What do you do?

Dejal is a small ISV, so I do pretty much everything, including Cocoa development, customer support, accounting, PHP web development, graphic design, etc. I do have a developer that helps with Dejal Simon plugins etc, and I've used graphic designers for some app icons and the new Dejal logo. In addition to my own products, I do contracting work part-time.

How long have you been doing what you do?

I learned BASIC in 1982 as my first programming language, and knew that's what I wanted to do with my life. In 1988 I switched to Pascal on Mac Pluses at the University of Auckland in New Zealand, and started playing around with apps, but didn't sell anything until I created Dejal (originally called Dejal Userware, for user-friendly software) in 1991. Back then it was just a hobby, selling utilities for System 5 through Mac OS 9 (they're still available as freeware: http://www.dejal.com/classic/). There wasn't a web back then, though; I distributed my software via Compuserve, AOL, floppy disks, and later CDs, and provided licenses via airmail (from New Zealand), hand-written on photocopied certificates.

When my wife and I moved to the US in 2001, I learned Cocoa, developed my first Mac OS X apps, and registered my company as Dejal Systems, LLC in 2002.

Your first computer:

I got my first computer in 1983: a Sinclair ZX81, with 3.25 MHz Z80 processor, 1K of RAM, a cassette tape drive, tiny membrane keyboard, and hooked to a B&W TV. I first used a Mac at school: an original 128K Mac in 1984... but I didn't own one until I got a Mac Plus in 1988.

Are you Mac-only, or a multi-platform person?

Definitely Mac-only. I have a Windows box I got a few years ago for a project, but it just gathers dust.

Do the products you develop scratch a personal itch, or are they for others?

A bit of both. Obviously I need to keep marketability in mind when working on products. Most started out as fulfilling a need I didn't see being adequately serviced with existing products in the marketplace. Narrator started as a fun way to learn Cocoa. Simon began as a way for me to watch for website updates, and became more sophisticated as it became popular. I created Time Out to improve my health, since I can suffer from eyestrain when staring at a computer for hours on end. Caboodle was written to compete with others in the snippet-keeper market, as I didn't really like the approach existing ones took. Macfilink was created in partnership with an affiliate marketer to serve that community. BlogAssist was written specifically for my wife, who was really into LiveJournal blogging at the time. All of the products have grown and evolved over the years based on customer feedback -- it's really important to listen to what people say about products and incorporate their ideas into the design, as makes sense. I keep track of all suggestions, and tally votes for them to determine the most requested enhancements, to which I give priority when deciding on features for an update.

What's the coolest tech thing you've done using OS X?

One thing I'm quite pleased with is the Script plugin in Dejal Simon. Simon is a server monitoring tool that uses a plugin model for services, notifiers, and reports. The Script plugin allows running AppleScripts, shell scripts, Perl, Python, Ruby, or other scripts to perform checks and notifications for local or remote servers and processes. I like it as it leverages Mac OS X's unix underpinnings to significantly enhance the reach of the product. That would've been much harder under Mac OS 9 or Windows.

Ever?

I wrote an integrated environment for an old SpectraVideo MSX computer (loaded off 5.25" floppies) around 1986, complete with a basic word processor, spreadsheet, and more. It was never released, though.

Where can we see a sample of your work?

Try my products: free trials are available at http://www.dejal.com.

See my code: open source Cocoa at http://www.dejal.com/developer/.

Read my thoughts: subscribe to my blog at http://www.dejal.com/blog/.

The next way I'm going to impact IT/OS X/the Mac universe is:

I'm excited about the upgrades of the Dejal apps for Leopard. Simon 3 and Time Out 2 will be major upgrades, with much-improved UI and features.

Narrator 2.0.2 released

Narrator, my app to read out stories in multiple voices, has been updated to version 2.0.2.

It is also available for half price for today only, via the MacUpdate Promo page. Be in quick to take advantage of this one-day offer!

This bug-fix release includes a few important issues:

  • Fixed an occasional crasher when saving a document immediately after making text or ruler changes.
  • Fixed a bug where the license reminder in the window title would appear even when licensed, when launching the application by opening a document instead of launching the app directly.
  • Fixed a cosmetic bug with the Check for Updates feature when using a general release and wanting only general releases, and a beta release is available.

Download Narrator 2.0.2 now, and check out the MacUpdate Promo deal before it expires!

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!

Time Out 1.5.3 released

Time Out, my popular free break reminder tool, has just been updated to version 1.5.3.

It contains a few improvements:

  • Improved the idle detection when the computer was sleeping.
  • Added a hidden preference to output debug information about scheduling and idle detection to the Console log. It can be activated by entering defaults write com.dejal.timeout DebugScheduler YES in Terminal. You shouldn't turn this on unless you think Time Out isn't working properly, as it outputs quite a lot of information.
  • Fixed a cosmetic bug with the Check for Updates feature when using a general release and wanting only general releases, and a beta release is available.

Time Out 2, the major rewrite for Leopard, is currently in development. More information about it will be made available in due course. In the meantime, enjoy Time Out 1.5.3!

Download now!

Pan-Mass Challenge software auction

Seth Dillingham is hosting a Pan-Mass Challenge software auction once again this year, as a fundraising project in support of his 300-mile ride across the state of Massachusetts for a cancer care charity.

He wants to collect hundreds of software products, which will be auctioned on eBay starting soon.

This is a very worthy cause. I participated last year, and am happy to participate again this year. I am donating at least 5 Standard licenses for Dejal Simon, at least 5 Household licenses for Dejal Caboodle, plus at least 5 Household licenses for Dejal Narrator (about $520 total value). I encourage other Mac developers to join in, too.

For more information on the fundraising, click this image:

WWDC 08 Stevenote

I previously blogged with my predictions for the Stevenote at this year's WWDC. So how'd I do?

3G iPhone & SDK:

This was of course a no-brainer. There may have been riots in Moscone if this hadn't eventuated. The iPhone 3G meets most of the expectations that people had, with one or two perhaps overly optimistic exceptions: some people were hoping for a front-facing camera with video support, for video chats, which won't be included... yet. Maybe in next year's model?

I wondered when it would be available, predicting "no later than the end of June", but it turned out that July 11 is the magic date. A little off there, but I'm not surprised that it was delayed a little. It's perfect timing for me: my old cellphone contract expires on July 2, so I'll be raring to go on launch day.

One concern with the launch, though, is that it appears that iTunes-based activation will no longer be supported: iPhone customers will have to activate in-store. That will probably lead to really long delays on launch day (and subsequent days)... not something I'm looking forward to.

Although the iPhone 3G will be cheaper up-front, the total cost of ownership is going up. AT&T will be charging $10/month more than before for the data plan, resulting in a total cost over the two year contract of $440, $40 more than before. Even so, the iPhone 3G will be well worth that difference, with faster speeds, better battery life, GPS, and more.

Snow Leopard:

Another rumor I commented on was that Mac OS X 10.6 would be announced, with the code-name "Snow Leopard", as a no-new-features release with performance improvements. This was indeed announced, though somewhat in passing during the Stevenote. Developers attending WWDC apparently got a seed of this release. There was little information on what is included, but I predicted that the rumor that it'd drop PowerPC support was unfounded. I can't say for sure, but considering the intertubes haven't exploded with outrage, I think it's safe to assume this wasn't true.

.Mac Overhaul:

This rumor did come true, too. As widely expected, the new name is MobileMe. I'm still not a big fan of the name, but anything's better than "dot-Mac". From what was shown during the Stevenote (or Schillernote at that point), they do seem to have gotten it right at last. The web apps look very clean and usable, and push synchronization should be an improvement.

New Multi-Touch Device, Other Hardware:

I was very skeptical of the rumor of a new multi-touch device, and wasn't surprised to see it was false. Apple has a great new platform in the iPhone, just at the beginning of taking over the world, so they wouldn't want to distract from that at this stage. Maybe in a couple of years time, they might bring out a touch tablet or something.

As for new Mac models, I didn't expect any, and there certainly weren't any. As I said, WWDC is not the time for new hardware.

No Boom?

I did end jokingly with "The real surprise would be if Steve doesn't say "boom". :)" Maybe that is the biggest surprise of the show; he didn't say "boom" once, unless you count the sound effects in the slides when announcing the lower prices. I'm shocked! :)

Overall, a most satisfactory WWDC Stevenote. I look forward to getting my iPhone 3G, and seeing the plethora of iPhone apps that will start appearing in the App Store. It's going to an excellent platform.

WWDC 08 predictions

Unfortunately I'm not attending WWDC this year. I'm not currently working on or immediately planning an iPhone app, and don't expect anything much new for Mac OS X, so it wasn't worthwhile to go this year. Maybe next year?

I'm sure I will write some iPhone apps in the future, though; it's an exciting platform, and I'm really looking forward to getting a new iPhone once they're released.

But speaking of releases, time for some prognostication.

The leading expectation for WWDC 08, of course, is the 3G iPhone with version 2.0 software and the software development kit (SDK). I'm confident that this will eventuate. I'm not sure whether or not the new iPhone model will be immediately available, or just announced for pre-order and delivery later in the month (or even later). If I had to guess, I'd say it'd be released no later than the end of June... but I'm hoping for immediate availability.

There are also questions of whether or not the updated iPhone will be thinner or thicker than the current model, what memory size it'll have, if there will be multiple models (perhaps a cheaper 2.5G and more expensive 3G model), coloring, form-factor, etc. I would guess thinner, double the memory, and only a 3G model (with a preference to switch between 2.5G and 3G).

Another rumor that has been popular recently is an unusual update to Mac OS X to version 10.6, code-named "Snow Leopard". This would be unusual in that it is supposed to not include any major new features, but just concentrate on tidying up the code base, improving performance and stability... stuff that is normally the realm of bug-fix releases.

But it is supposed to also drop PowerPC support. This would make a certain amount of sense — it'd allow throwing away lots of code, and simplifying many things. But it might be a little too soon for such a drastic change; there are still plenty of perfectly good PowerPC machines out there (I have a few in active use).

There have been rumors that 10.6 would change Carbon support in some way. Some thought it would drop Carbon entirely, or Carbon UI, but I don't think that is realistic. There are still many Carbon apps out there, including big ones from Adobe, Microsoft, and others. What I could see happening, though, is (as Gruber says) adding Objective-C wrappers around framework calls that are only available via Carbon currently. That would certainly be very welcome; as a Cocoa programmer, it can be mildly distasteful to have to drop down to Carbon to implement some functionality, though it's certainly not the end of the world.

Another popular rumor is that .Mac will be overhauled and renamed, perhaps as "Mobile Me". This has been fueled by people noticing that me.com is owned by Apple, and seeing the text "Mobile Me" referenced in resources. This does seem pretty conclusive, though I can't say I particularly like the name. On the other hand, .Mac has always been a silly name, so Mobile Me isn't any worse. It does certainly make sense to rebrand it to avoid reference to Macs, now that Apple has a major non-Mac platform in the iPhone.

Finally, some people are predicting a new multi-touch device, perhaps some sort of tablet or Newton-like form factor. I'd certainly welcome that, but am rather skeptical that such a device would be introduced now. I'm sure Apple has a few such devices in development, even if only as experimental projects, but introducing one now would distract from the new iPhone, unless it were positioned as a "super-iPod touch" kind of device, running the mobile OS X. I would really like to see a multi-touch Mac tablet... but that seems even less likely at this stage.

I would be very surprised if any Mac hardware were announced. WWDC isn't traditionally the venue for hardware releases; last year Apple released updated MacBook Pros a week before WWDC, rather than waiting a week. At its core, WWDC is for developers, talking about the OS. That's the way it should be.

It'll certainly be very interesting to see what is announced. Maybe Steve will surprise us all. Let's all play WWDC bingo! The real surprise would be if Steve doesn't say "boom". :)

Macfilink 1.4.3 released

Macfilink, my affiliate link cloaking tool, has been updated to version 1.4.3.

This update includes a few fixes, and is free for existing customers:

  • Improved the reliability of the two web views (Original Page and Generated Preview), allowing them to better load content when not active.
  • Fixed a cosmetic bug with the Check for Updates feature when using a general release and wanting only general releases, and a beta release is available.
  • Updated the built-in Kagi purchasing tool to the latest version, which fixes some issues with Leopard.

Download now!

BlogAssist 2.2 released

BlogAssist version 2.2 is now in general release. It adds some much-requested features and fixes:

  • Added a much-requested feature: the ability to have repeating formatting. For example, you can now create an ordered or unordered list simply by using a list of items as your source value, and similarly with multiple HTML paragraphs via multiple paragraphs of text. The list items can be delimited by Return or LF characters, tabs, or commas. It automatically strips off any existing list markers: it recognizes a dash, asterisk or bullet, or any short first word ending in a punctuation character. What's more, you can have lists in either the Value1 or Value2 fields (in the floating and Services windows); it will repeat the block for the number of items in the longer list, using the last (or only) item in the other field for any shortfall. So text like "1. This is an item, 2. Another item, (3) A third item" becomes properly formatted HTML.
  • The Paragraph, Unordered List, and Ordered List operations are automatically upgraded to use the new repeating block mechanism. You can easily add it to any other operations where it seems useful.
  • Added a new List of Links operation, that outputs an unordered list containing web links, using the new repeating feature. Use a list of labels in Value1 (e.g. "Simon, Time Out, Caboodle"), and a list of corresponding URLs in Value2 (e.g. "http://www.dejal.com/simon/, http://www.dejal.com/timeout/, http://www.dejal.com/caboodle/").
  • Added an Insert Variable drop-down menu to the Operations Preferences. This allows easily inserting variables and begin/end repeating block markers in the selected operation text.
  • The Operations Preferences table now used dynamic row heights, so multi-line operations are fully visible.
  • Improved the floating BlogAssist window to avoid using unnecessary processor time when drawing the web preview.
  • Fixed a cosmetic bug with the Check for Updates feature when using a general release and wanting only general releases, and a beta release is available.
  • Updated the built-in Kagi purchasing tool to the latest version, which fixes some issues with Leopard.
  • Updated the French and German localizations.

Download BlogAssist 2.2 now!

Syndicate content