PBworks is an online tool for collaboration and project management. It has a very simple webhook mechanism which can be used to integrate it with AlertGrid with two simple steps.

Step 1: Log in to your PBworks account and enter one of your workspaces. Go to settings, then to developer Interface

Step 2:Enter the webhook URL. It is:

http://hq.alert-grid.com/save-signal/?api_id=YOUR_API_ID&receiver_name=YOUR_RECEIVER

Of  course you need to replace the api id and receiver name with real values from your AlertGrid account.

When you click Save – it’s done! You have just integrated your pbworks workspace with AlertGrid. Now, AlertGrid will receive signals whenever something happens in your pbworks workspace. Let’s have a look at the structure of the signal received from pbworks:

The most important parameters are op (operation, i.e. what happened), page (where it happened), name & email (who did this) and wiki (apparently, this is workspace name). In fact pbworks must have documented it all somewhere on their page. Anyway, knowing this all, you can easily react to different events by building workflows and get instant notifications (not only by email but also by SMS & phone!) when something very specific happens. For example, when a user whose email ends with gmail.com modifies a sidebar in one of your workspaces:

Is it useful? Well, it’s entirely up to you, AlertGrid offers nice notification mechanisms out of the box and a flexible rule editor, you might find it very useful if notification system built into pbworks is not suitable for you and you want greater control and other notification channels (SMS, phone). Have fun!

Today we ended our short, yet creative AlertGrid’s code sprint.

Changelist:

  • View receiver – you can now see most important details of each receiver on one page
  • Graphs improvements – we fixed annoying bug which breaked graphs, legend is now positioned in the best available position
  • Other bugfixes and improvements

You can check results at: http://alert-grid.com

I spent some time trying to solve the problem with django-cms installation on our test server (wsgi configuration).

After succesfull installation of django-cms I received error saying when I had tried to visit my page:

AttributeError: ‘Settings’ object has no attribute ‘CMS_PERMISSION’

After some investigation I found that django-cms has it’s own mechanism to load required settings (can be found in /cms/conf/__init__.py) which wasn’t applied for my project and this was reason why CMS_PERMISSION setting was not visible in my app.

Solution that solved the problem was to call patch_settings() manually, before initialising wsgi handler. Modified django.wsgi should looks more or less like this:


import os
import sys
from cms.conf import patch_settings

os.path.append('path/to/project/')

os.environ['DJANGO_SETTINGS_MODULE'] = 'MyProject.settings'
patch_settings()

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

My django-cms version is 2.1.0 rc1

I’m not sure if this is proper way for solving this probem but I couldn’t find any other solution for this issue.

Some time ago we described what should be done to enhance the work of teams using assembla.com with instant notifications on various project events.

To do this all you need is assembla’s webhooks functionality and a free account on AlertGrid. But what if you use webhooks for some other integration? (eg. Our team use webhooks to trigger some continuous integration actions after a code commits.)

Unfortunetely assembla allows you to use one and only one webhook URL per space. This might not be enough when you want to create the ultimate collaboration environment.

In this short article we’ll show you how to overcome this. Thanks to the latest AlertGrid features (URL action) this service can be used as a webhook dispatcher. It’s as easy as 1-2-3:

  1. Point assembla’s (or other service) webhook to AlertGrid
  2. Configure AlertGrid to handle signals from the above service (this basically requires creating a Receiver – which needs only one field to be filled in!)
  3. Create a Workflow which will call the number of URLs you require

AlertGrid as an assembla's webhook dispatcher

So, what are our new super powers now?

  1. We can now trigger multiple URLs from services that provide only one webhook URL
  2. We can add some conditional logic to correctly dispatch signals to external systems (if action type == code commit -> call CI server, if milestone completed -> write on twitter)
  3. We can do all of this from a single place accessible with a web browser
  4. We can track the history of webhook triggers
  5. We can do this for free!

If you want to make your Python code more readable and valid with PEP8, you can set up an informational, vertical line in Eclipse at some character (eg. 79).

To do this go to Window->Preferences->General->Editors->Text Editors and enable “Show print margin option”, then enter a number in ‘Print margin column’

(This works with Eclipse 3.5.1)

I started using Django-MongoDB duet which looks really interesting, when I faced the first problem: my MongoDB server couldn’t be started as a Windows service.

I tried:

mongod.exe --logpath="logs dir" --install

which installed service correctly. But the service couldn’t be started. Running command

net start MongoDB

ended with error “service doesn’t react on a control function” (or something like that)

If you have the same problem you need to:

  1. Open Windows registry (probably C:\Windows\System\regedit.exe)
  2. Go to:  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MongoDB
  3. Check if ImagePath value is valid – in my case there were apostrophes ommited in–logpath (which is required since my logpath was pointed to “Program Files” directory)

This should help.

There are several useful bits fo code we use in various Django projects. One of the most commonly used is a piece of code which modifies BoundField and Widget classes (from django.forms) in a way to add class=’required’ attribute to rendered HTML widget of a field that is required in terms of Django validation. Thanks to this, one can easily apply some CSS for such fields to make forms even more user-friendly.

You can check out how it works in AlertGrid. We added some javascript and css to highlight required fields and remove highlight when user fills in some data into a field. We share those css and js bits of code as well.

You can find all at Bitbucket.org

Tracing is a way of monitoring the execution of your application while it is running. .NET offers you two classes for tracing: Trace and Debug (both in System.Diagnostics namespace), they are identical, except that the Debug class functions are not compiled (by default) in release builds.

You can use the Assert method on a Trace/Debug class to evaluate a condition. A standard dialog window will be displayed if the condition is not met.

Trace.Assert(myObject != null, "My object is null!");

If the condition is not met (i.e. when myObject is null) this code will display the following dialog:

The Write and WriteLine methods are used to write output from your application. The output is handled by listeners added to the Trace.TraceListeners collection.


Trace.Listeners.Add(new ConsoleTraceListener()); //add the trace listener.
Trace.WriteLine("This is my message."); //write output

The code above will redirect the trace output to a console window. .NET has a number of other listeners that you can use:

  • DefaultTraceListener – this listener is attached by default. It redirects to aVisual Studio output window.
  • TextWriterTraceListener – redirects output to a Stream or TextWriter instance. It can be used to write output to files.
  • EventLogTraceListener – redirects ouptut to an event log
  • ConsoleTraceListener – redirects output to a standard output or standard error stream
  • DelimitedListTraceListener – similar to TextWriterListener, but the output is delimited by a selected character (set by Delimiter property)
  • XmlWriterTraceListener – redirects XML output to a Stream or TextWriter instance

You can create custom trace listeners by implementing the abstract TraceListener base class. In a recent exchange of emails with Pierre Henri Kuate he suggested that it would be nice to have a trace listener that would write output to AlertGrid. We thought it was a really nice idea and we’ve implemented it (download it here).  With the AlertGridTraceListener class a Signal is sent to AlertGrid whenever you call Trace.Write or Trace.WriteLine.  The usage is extremely simple. First you initialize the AlertGridTraceListener (you need to pass your AlertGrid api_id)

Trace.Listeners.Add(new AlertGridTraceListener("8a35bcdd-d71e-43e2-9d1c-27394d5e4640"));

Then you use the Write function as so:

Trace.Write(10, "temperature"); //log a name-value pair

Using AlertGrid you can then easily define rules like this:

Imagine your applicaiton logs the temperature value periodically, for instance every 5 minutes. With the AlertGridTraceListener attached you can easily check if the signals are not received and take some notification action automatically:

Finally, you can use AlertGrid to visualise the history of the submitted variables (works for integer or float types)…

This simple example passes only one variable called ‘temperature’. If you want to include a list of name-value pairs in one call, we suggest that you use one of the AlertGrid wrapper classes. The underlying philosophy is identical, but they are a bit more flexible for tracing. Instead of calling Write, you call the SendSignal method on a SignalGenerator instance. You can pass a dictionary of name-value pairs. For example:


/* Trace the weather conditions in Aspen */
IDictionary parameters = new Dictionary();
parameters.Add("temperature", "-5");
parameters.Add("snow", "90.5");
parameters.Add("measurment_time", "01/18/2008 14:34:01");
signalGenerator.SendSignal("Aspen", parameters); //"Aspen" is the name of the AlertGrid receiver object that is to receive the data. You can create multiple receivers for better data organization.

To wrap it all up, with AlertGrid you can easily trace any metric of your application and dispatch alerts (or possibly take any other custom action) whenever something happens  (or when it does not happen!). We’ve discussed C# here but AlertGrid can work with any language, we’ve prepared examples and other wrapper classes. See here.

We’ve recently added a “Plugins” page to the AlertGrid website.  An AlertGrid plugin is a simple tool that works in the background, and sends Signals to AlertGrid. The first plugin, which is now available (with the source code), is an extremely simple tool that monitors basic metrics from a windows machine. It installs as a windows service and takes only a few seconds to configure: all you need to do is set your AlertGrid api_id in the configuration file.

After no more than a minute your windows server is being monitored. Three main problems that this simple plugin solves are:

  • Is my server up?
  • Has the process xyz.exe stopped running?
  • Are the basic performance metrics (CPU usage, RAM usage) out of range?

Why we think this plugin is so cool?

  • It’s easy to use. Really. Install and configure it on a target machine in half a minute. Then it will take just another half minute to set up the AlertGrid functionality (create a Receiver and a Workflow).
  • It’s simple. Heartbeat monitoring, process monitoring, basic performance counter monitoring – in 90% of cases this is all you need, isn’t it?
  • It takes advantage of all the neat AlertGrid functionalities immediately, all types of notifications, data visualisation and the rest.

September 9, 2010 | In: AlertGrid

Visualizing data with AlertGrid

Some people have told us that it would be great to have the chance to visualize metrics received in Signals by AlertGrid. Indeed, a picture is worth a thousand words. In fact we also missed this a lot. We prioritized this task and voila! It’s ready to use in the latest release. We realized that probably most of the graphs are going to be viewed frequently, thus we decided to allow the user to save any created graphs in order to view them later. Creating graphs in AlertGrid is very easy (remember the KISS rule?). You only need to select a Receiver, the variables that you want to visualize, and a time period.

We had a few nice ideas when implementing the latest functionalities. The most exciting one of these is to re-design the dashboard so it can display your created graphs. What do you think?