A TopShelf Exensions for using Knowvent to monitor your TopShelf Service.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.nuget
KnowventTopShelf
KnowventTopShelfExtensions
Resources
.gitignore
KnowventTopShelf.sln
Readme.md

Readme.md

Topshelf Cloud Monitoring Using Knowvent


Knowvent Portal

Topshelf is a great platform for developers and providers requiring a simple solution to deploy your services. The Knowvent extension library takes the Topshelf project and makes it that much better.

###Start Monitoring your Topshelf software Today!

It is so easy there is no reason why you shouldn't be monitoring your TopShelf services. Best of all, it is free!

Knowvent is a cloud notification and heartbeat monitoring service. This extension will enable cloud monitoring of your Topshelf project in 3 easy steps.

####Step 1: Signup for a Cloud Knowvent Account and get your Client Id and Api Key.

####Step 2: Add the extension library to your project

Install-Package Knowvent.TopShelfExtensions 

####Step 3: Include a using statement at the top of your class and setup your HostFactory to use the Knowvent ServiceConfigurator extensions.

Set the 5 KnowventConfig properties below.

using Knowvent.TopShelfExtensions;

namespace KnowventTopShelf
{
	class Program
	{
		static void Main(string[] args)
		{
		    var h = HostFactory.Run(x =>                               
		    {
    			x.Service<DailyPricebookExport>(s =>                    
    			{
    				s.ConstructUsing(name => new DailyPricebookExport());
    				s.KnowventConfig(new KnowventConfig()
    				{
    					ClientId = creds.KNOWVENT_CLIENT_ID, //Your Client ID from knowvent.com
    					ApiKey = creds.KNOWVENT_API_KEY,//Your API KEY from knowvent.com
    					HeartbeatIntervalMin = _heartbeatIntervalMin, //The frequency TopShelf will send a heartbeat and the frequency Knowvent will expect one.
    					ProcessIdentifier = new Guid("38cbb979-bc3f-473b-8e54-7784563c350b"), //a Unique Guid, you pick!
    					Name = srvDisplayName
    				});
    				s.WhenStartedForKnowventHeartbeat(tc => tc.Start());
    				s.WhenStoppedForKnowventHeartbeat(tc => tc.Stop());         
    				
    			});
    			x.RunAsLocalSystem();                     
    			x.SetDescription("Process for sending out companies price list");
    			x.SetDisplayName(srvDisplayName);                    
    			x.SetServiceName("DailyPricebookExport");
		    });  
											  
		}

	}
}

###That is it!

Login to the knowvent portal if you want to see your TopShelf Service State. Otherwise Knowvent will notify you when you service unexpectly stops.