Category Archives: Computers

Exchange 2010 SP3 Update Rollup 8

Earlier on this month Microsoft released Update Rollup 8 for Exchange 2010 SP3.

Unfortunately this update has caused issues with Outlook syncing with Exchange. (This does not affect Activesync, OWA, POP etc)

If you are receiving the “Cannot Open Item” error message and you have this update installed, uninstall it and roll it back to the to Update Rollup 7.

In due course, Microsoft will release Update Rollup 8 which will replace the dodgy update.

There’s more information on the Exchange Releases website.

Monitoring Website Availability

Nagios Service DetailThere are various tools out there which can be used to monitor website availability. My favourite being the defacto standard – Nagios. Not only is it open source, it is very flexible and powerful. The only downside with Nagios is the config and Linux skills (I’m not scared of Linux at all, but some people are). But when you’ve got it set up, it’s pretty rock solid and will just keep running away monitoring all of your services.

Installing Nagios
Nagios is very simple to install on most Linux systems. On the Nagios Quickstart website, there is detailed instructions on installing Nagios on Fedora/openSUSE/Ubuntu. However with Ubuntu, the installation can be simpler using apt-get to install:
sudo apt-get install -y nagios3
(Although it’s worth noting that aptitude usually has an older version. A trade-off for ease of installation!)

Configuring Nagios
Once installed, Nagios can be configured. I’m not going to cover it in this blog post here, as there are that many guides out there which already cover this. However a good starting point is this article which covers setting up monitoring for public services.

Twitter Integration
I’ve been looking at doing something nice with Nagios to allow it to tweet on Twitter when a website is down – “I’m sorry we’re down, we’ll be back up later”. However it seems a bit of a pain to install and setup Twurl. Therefore I thought it could be interesting to explore this using Taskcentre

Using Taskcentre as Alternative to Nagios
Looking at Twurl as it looks very painful to integrate into Nagios. So looked at it from the other angle. “What integrations have I done with Twitter which I can get to monitor a website”. I’ve previously created a task in Taskcentre which tweets, so with any task such as this, I broke it down into small manageable steps and tackled each one, one at a time:

  • Check site to see if up or down
  • Check to see if status has changed
  • Send notification

Check Site Availability
VBScript Site StatusA very basic check would be to “PING” the website to see if the server is available. This is a very basic check and I would never recommend this as a way of checking to see if your website is available. Some servers block pings, others will respond with a ping, but still not be delivering pages. The best way is to actually request the page and await the return of the HTTP Status Code. Generally any response other than one in the 200-299 range means that the website is not available. In this example, I’m focusing on the primary response “200” which means “OK”.

Using VBScript, this small script which will request a page from my website. If it returns a 200, it then sets the “CurrentStatus” variable to “True”. In every other case, it sets it to “False”.

Check to see if the status has changed
Firstly we need to know what the previous status was in order to compare this to the current status. Creating either a global variable, or task level variable to store the previous value, then comparing the current value to the previous value.

This is pretty easily done using the following decision step:
Variables("CurrentStatus") <> Variables("PreviousStatus")

Afterwards, a small bit of code is required to store the value. This is to ensure that the next time the task runs, it will highlight the change in status. (Rather than highlighting each time).
Variables("PreviousStatus") = Variables("CurrentStatus")

Send Notification
Twitter PostingFinally you need to decide what to do with your alert. In this case, I’ve tweeted on Twitter. (a good way to keep in touch with customers). Using a bit of logic, I’ve changed the text so that the message is different depending on the status change. A positive change says “We’re back now”. A negative change says “Sorry we’re down, but we’re looking into it”.

Obviously this task could send an email, send message via HipChat (as done in my previous post – here), or even text message instead of tweeting.

Here’s the completed task. Obviously needs a “schedule” task in there so that it runs every 5 minutes or so. (In my VM which I use for testing and prototyping, I tend not to schedule anything automatically to run).
Website Availability Task

Further Improvements
As with everything you do, there’s always ways to improve this further. My first thoughts are the following, but I bet there’s lots more..!

  • Check the content of the site, looking for specific text
  • Check a list of sites
  • Flap Detection
  • Different levels of alerts, such as:
    • First Alert – Email Staff
    • Second Alert – Update Twitter
    • Third Alert – Text Message Staff

Taskcentre Alert Notifications

Taskcentre is a software product created by Orbis Software. Taskcentre is “middleware” software which integrates between various software products, ranging from high end ERP solutions such as Microsoft Dynamics Nav, to other pieces of software such as Magento. This is not really a marketing blog post, so for further information, have a look at their website or just ask 🙂

If there is a problem with a task, Taskcentre automatically sends an email to system administrators. Sometimes email is not a reliable messaging system (for example if the email server is down), so in this blog post, I’m going to show how to integrate Taskcentre into itself and post to the free private chat system for business HipChat. Although it is possible to do pretty much anything with the error (you could even print it out on a printer or tweet it if required..!)

To integrate Taskcentre into HipChat for alerting, there are 3 steps which are required:

  1. Integrate Taskcentre into Taskcentre
  2. Integrate Taskcentre into HipChat
  3. Join it all together!

Integrate Taskcentre Into Taskcentre
Firstly we can only do this if Taskcentre is set up to use the SQL database option. If your still using the integrated database, I’d recommend changing to the SQL option. Not only does this improve performance, it also allows further analysis of logs.

Taskcentre Database Structure
If we look at the database structure, there are 2 tables which we require for this project.

  • EventLog – This contains all event log entries
  • Tasks – This contains all the tasks within the Taskcentre installation

We need to first create a SQL trigger on the EventLog table. This is to look for errors related to tasks which have failed. This is done by filtering the table where EventType = 2 AND TaskID >0 (EventType 2 is Error, Ensuring the TaskId is greater than 0 ensures that it only triggers for task errors.)

Taskcentre SQL Trigger

When the trigger fires, this passes the “EventID” to a variable called “EventID”. (We use this when the task triggers so that we know which row caused the task to run.)

Integrating Taskcentre into HipChat
Integration into HipChat is done with the XML Webservice Tool in Taskcentre. The tool allows Taskcentre to call XML Web Services. In this case, we wish to call the Send Room Notification web service.

This web service requires the following:
HipChat Room Notification Webservice

  • id_or_name The name of the room to send the message
  • color (or Colour for the non american) – The colour of the message
  • message The message to post
  • notify Should it trigger a user notification
  • message_format Is the message HTML or plain text
  • auth_token The authentication Token

HipChat Room Notification Web Service TokenIn order to post, we need to create an authentication token via the HipChat website. The best option is to create a room token with an associated “Label”. This is available HipChat Rooms This is then stored in Taskcentre, allowing it to post onto HipChat under the associated “Label”.

Alternatively, a personal authentication token could be used. The only downside with this is that it will post under your name instead of the pre-defined name for taskcentre. A personal token can be created here: Create Personal Token

Join it all together!
So now we can trigger from Taskcentre for every error, and also post to a HipChat room. All we need to do is join it together.

In order to ensure that the message is clear in HipChat (since the EventID is a bit useless on it’s own), We add a OLEDB connection to the taskcentre database and execute the following script. Note that I’ve excluded the current task from this query (I could do it within the Trigger, however we’d have to look up the TaskID and filter that one out – quite messy). This is to ensure that Taskcentre doesn’t get into a “while true” loop if there is an issue with this task.


SELECT
Tasks.TaskName AS TaskName,
EventLog.EventDesc AS EventDesc,
EventLog.EventTime AS EventTime
FROM
Tasks INNER JOIN EventLog ON Tasks.TaskID = EventLog.TaskID
WHERE
Tasks.TaskName <> 'Hipchat Error Posting'
AND EventLog.EventID = {=Variables("EventID")}

Putting it all together, we get the following task:
HipChat Error Posting - Complete Task

When an error is thrown in Taskcentre, the following is shown in HipChat:
HipChat Screenshot

Note: Although this is working well, for some reason the “notify” parameter is not working correctly. Regardless of what I pass to it (“false”,”true”,”0″,”1″,”yes”,”no”, Cbool(True) etc) it throws the following error. I’m wondering if it’s an issue with the webservice itself. Will continue testing to try and find a solution for this.

Value u'false' for field 'notify' is not of type 'boolean'

Microsoft Azure – Redis

Microsoft have implemented the open-sourced Redis key-cache and store in Azure.

Similar to have there are “Basic” and “Standard” levels of Virtual Machines, with associated redundancy, with Redis there are the same options available:

  • Basic – Single node
  • Standard – 2 node (in a primary/secondary setup), with built in replication and automatic failover

Redis Cache Azure Portal

Basic is ideal for development and non business critical (no SLA), whereas Standard is best for business critical systems (with a 99.9% SLA – 1 minute downtime per day)

Cache sizes range from 250mb through to 53GB. Prices range from £11 a month (250mb on Basic) to a huge £995 a month (53GB on Standard).

I’ve been using Redis on Azure for a good month or two now (started when it was in Preview before general release availability), speeds and reliability is impressive, with all requests taking less than 10ms. (only exception being GET * which returns all keys and takes about 50ms).

Redsmin

There are only a few changes which I would like to see:

  • Ability to manage via current management portal (only available on beta portal)
  • Ability to upgrade/downgrade packages on the fly (need to delete and recreate from scratch)
  • Improved statistics (although I currently use Redsmin)
  • Improved SLA for standard package

I thought about writing a guide, but Microsoft have a very good guide on their website about how to setup and use their Redis cache here: How to use Redis Cache in Azure

Server 2012 UNC Network Share One Way 0x80004005

Recently I’ve had a strange issue with Microsoft Azure. For some reason on some of the Virtual Machines could not access UNC network shares, throwing a 0x80004005 error. However strangely, worked the other way. The virtual machines run Server 2012 Datacentre edition.

For example:

From Machine A
Ping Machine B – Success
Access Network Share on Machine B – Success

From Machine B
Ping Machine A – Success
Access Network Share on Machine A – Fail

The following did not help with resolving the issue:

  • Removal and rejoin domain (rejoin failed)
  • Check Firewall Settings
  • Disable IP6
  • Delete network adapters

Following some work by Azure’s support team, it was identified that the issue is a bug in windows due to the way Azure handles the automatic scaling.

The automatic scaling feature in Microsoft Azure automatically boots and shuts down machines dependant on load on the cloud service. This allows cloud services and associated websites to benefit from extra processing power and memory when load is higher than expected.

Every time the virtual machine assigns the windows image to a new host machine, a new virtual network adapter is created, and various entries are added to the registry. SMB then picks up the details from the registry to resolve the UNC path on the network. Once a specific number is reached, SMB then fails to redirect the paths to the right address, causing this error.

Microsoft do not have a permanent fix, however the following script clears out the junk in the registry and leaves only the valid entries behind. Running this script fixed the issue after a reboot of the machine.

KB-269155

WordPress 4.0.1 Security Update

Today WordPress has released a security update, fixing several security holes plus 23 bugs.

These include:

  • Three cross-site scripting issues that a contributor or author could use to compromise a site.
  • A cross-site request forgery that could be used to trick a user into changing their password.
  • An issue that could lead to a denial of service when passwords are checked.
  • Additional protections for server-side request forgery attacks when WordPress makes HTTP requests.
  • An extremely unlikely hash collision could allow a user’s account to be compromised, that also required that they haven’t logged in since 2008.
  • WordPress now invalidates the links in a password reset email if the user remembers their password, logs in, and changes their email address.

It’s important to check your installs and install the latest update and install if required. Luckily most WordPress installs will automatically update using the built in auto-update script. Unfortunately the host I use does not support this (nor the automatic install via the dashboard), so I need to manually download the file, unzip and upload via FTP. A bit of a pain, but necessary.

For full details, view on the official website – WordPress 4.0.1

Or jump straight in – Download Latest Version of WordPress

.NET Framework and Visual Studio

Microsoft’s recent announcement regarding the .NET Framework is quite an interesting one, especially for those who are interested in the open source community.

The idea of making the CLR cross platform across Linux and Mac (on top of Windows of course) will make it easier for developers and users alike and remove the need for projects such as WINE.

Within the announcement there was a new version of Visual Studio 2013 called “Community”, aimed at those who are not producing enterprise grade software. Looking at the feature set, it’s comparable to the “Express” versions of earlier releases.
image

Additionally preview editions of Visual Studio 2015 was released. The new feature of being able to develop for Windows, Android and IOS from one development environment looks quite interesting.

Exciting times ahead

Further Information

Microsoft Dynamics Nav 2015

Microsoft has now released Microsoft Dynamics Nav 2015 earlier on this month. There’s a handful of new features above and beyond the features added in 2013. The tablet client looks pretty cool, removing the need to use the web client whilst out in the field. It’s optimised for touch use and available for all platforms:

If you have a valid subscription, it’s available for download on CustomerSource – Microsoft Dynamics Nav 2015 Download. You do need to get an upgraded licence to run 2015. This can be downloaded from CustomerSource (Microsoft are automatically upgrading Customer licences, or via your partner.)

Live Chat

Live chat is all the rage now with websites. These allow you to instantly chat live with a real human being via the website. Being an IT Geek (or Professional as we like to be called), I could write one, but with the prices so low, I don’t really see the reason to. As they say, why invent the wheel?

To install, simply copy and paste the supplied code into your website and your pretty much up and running. The user interface allows the chat to be themed to match your website.

I’ve tried a few, and settled on Website Alive. Not only is it one of the cheaper options out there, it also allows you to view users live as they are on your site, giving you key information on what pages they are currently viewing, how many pages they have visited etc. Although it’s not as detailed as the de-facto standard – Google Analytics, it does allow you to push prompts to those users to start a chat session. Personally I find these quite annoying, but I guess in some industries a friendly prompt which is not too overwhelming can increase sales.

Before diving in and paying, I’d definitely recommend signing up for a free trial of the software you wish to use and see if there is benefit before you start coughing up any money.

Selective Reindexing of Indexes in SQL Server

I’ve wrote many scripts over the years to selectively reindex indexes and update statistics on Microsoft SQL Server. However more recently I’ve been using Hallengren’s SQL reindex script as it’s very powerful and pretty easy to use and schedule via SQL Agent.

Hallengren’s SQL Reindex Script

I currently use the following script run daily as it reorganises indexes with fragmentation of between 5% and 20%, and performs an online rebuild if over 20%. Fragmentation under 5% is ignored (it’s not worth doing anything with these). It also updates statistics on records which have been modified.

EXECUTE dbo.IndexOptimize @Databases = 'USER_DATABASES',
@FragmentationLow = NULL,
@FragmentationMedium = 'INDEX_REORGANIZE,INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE',
@FragmentationHigh = 'INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE',
@FragmentationLevel1 = 5,
@FragmentationLevel2 = 20,
@SortInTempdb = 'Y',
@MaxDOP = 0,
@UpdateStatistics = 'ALL',
@OnlyModifiedStatistics = 'Y'