Posts tagged ‘monitor’

Monitor Commerce Server to ensure that you are taking orders.

I use a simple query that runs ever thirty minutes that just returns the number of hours since the last order.  It adjusts for local time. Load this into a stored procedure, write up a little console app that will email you if you haven’t recieved an order in a few hours.  

DECLARE @offset int

SELECT @offset = DATEDIFF(hh, GETUTCDATE(), GETDATE())

SELECT DATEDIFF(hh,(
     SELECT TOP 1 DateAdd(hh, @offset, created)
     FROM [DefaultSite_transactions].[dbo].[PurchaseOrders]
     WHERE subtotal > 0
     Order by created desc),
   GETDATE())