New HealthCheck help

Oct 2, 2012 at 9:52 PM

I tried to port a console app to a new HealthCheck based on the HelloWorld example and it just blows up my instance. It looks like the new Type can't be found.

https://dl.dropbox.com/u/1539/SmtpPingCheck/output.txt
https://dl.dropbox.com/u/1539/SmtpPingCheck/SmtpPingCheck.cs
https://dl.dropbox.com/u/1539/SmtpPingCheck/smtpcheck.castle.config
https://dl.dropbox.com/u/1539/SmtpPingCheck/binding.castle.config

I would appreciate any assistance.

Thanks,

-- Chris

Coordinator
Oct 2, 2012 at 10:02 PM

taking a look now...

Coordinator
Oct 2, 2012 at 10:12 PM

Ok, the issue is component id in smtpcheck.castle.config does not match the one in binding.castle.config

smtpcheck.castle.config...
<component id="SmtpPingCheck"
binding.castle.config...
<HealthCheckConfigurationName>SmtpPingCheckConfig</HealthCheckConfigurationName>

BTW: using bindings is the old way of linking a check to it's scheduler...the easiest way to do it is just put your smtpcheck.castle.config file in the checks\everyminute folder and it will be automagically bound to the everyminute check....(and remember to remove the "SmtpPingCheckBindingConfig" binding, not required now!)

Hope that gets you up an running!

Coordinator
Oct 2, 2012 at 10:50 PM

I've also just updated the docs on creating a new health check to (hopefully) make it clearer and to reflect to preferred "binding by convention" approach rather than the old explicit binding component config required in binding.castle.config.

Oct 3, 2012 at 12:46 AM

I did as suggested. smtpcheck.castle.config moved to EveryMinute folder and removed the component section from the binding.castle.config.

Same group of stack traces.

2012-10-02 19:40:21,982 [4] ERROR Topshelf.Model.ServiceCoordinator [(null)] - Fault on Wolfpack: Topshelf.Exceptions.ServiceControlException
Service Start Exception: Wolfpack (IRolePlugin)
   at Topshelf.Builders.LocalServiceBuilder`1.StartService(T service) in d:\BuildAgent-01\work\799c08e77fef999d\src\Topshelf\Config\Builders\LocalServiceBuilder.cs:line 69
   at Topshelf.Model.LocalServiceController`1.CallAction[TBefore,TComplete](String text, Action`1 callback, Func`1 before, Func`1 complete) in d:\BuildAgent-01\work\799c08e77fef999d\src\Topshelf\Model\LocalServiceController.cs:line 153
HelpLink:

System.InvalidOperationException
Failed processing binding[SmtpPingCheck->EveryMinute]
   at Wolfpack.Core.Loaders.HealthCheckBindingLoader.<>c__DisplayClass2.b__1(BindingConfiguration bc) in c:\Projects\Wolfpack\Trunk\Releases\v2.4.0\Source\Wolfpack.Core\Loaders\HealthCheckBindingLoader.cs:line 119
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at Wolfpack.Core.Loaders.HealthCheckBindingLoader.Load(Binding[]& components) in c:\Projects\Wolfpack\Trunk\Releases\v2.4.0\Source\Wolfpack.Core\Loaders\HealthCheckBindingLoader.cs:line 46
   at Wolfpack.Core.Loaders.HealthCheckLoader.Load(IHealthCheckSchedulerPlugin[]& components) in c:\Projects\Wolfpack\Trunk\Releases\v2.4.0\Source\Wolfpack.Core\Loaders\HealthCheckLoader.cs:line 26
   at Wolfpack.Agent.Roles.Agent.Start() in c:\Projects\Wolfpack\Trunk\Releases\v2.4.0\Source\Wolfpack.Agent\Roles\Agent.cs:line 116
   at Wolfpack.Agent.Startup.<>c__DisplayClass8.b__6(IRolePlugin s) in c:\Projects\Wolfpack\Trunk\Releases\v2.4.0\Source\Wolfpack.Agent\Startup.cs:line 84
   at Topshelf.Builders.LocalServiceBuilder`1.StartService(T service) in d:\BuildAgent-01\work\799c08e77fef999d\src\Topshelf\Config\Builders\LocalServiceBuilder.cs:line 65
HelpLink:

System.InvalidOperationException
Searching for type name 'SmtpPingCheck'; found no matches. Check the HealthCheckConfigurationName property of your BindingConfigurations are valid
   at Wolfpack.Core.Loaders.HealthCheckBindingLoader.<>c__DisplayClass2.b__1(BindingConfiguration bc) in c:\Projects\Wolfpack\Trunk\Releases\v2.4.0\Source\Wolfpack.Core\Loaders\HealthCheckBindingLoader.cs:line 85
HelpLink:


2012-10-02 19:40:21,982 [3] ERROR Topshelf.Model.ServiceWorkflow [(null)] - [Wolfpack] Fault: Topshelf.Exceptions.ServiceControlException
Service Start Exception: Wolfpack (IRolePlugin)
   at Topshelf.Builders.LocalServiceBuilder`1.StartService(T service) in d:\BuildAgent-01\work\799c08e77fef999d\src\Topshelf\Config\Builders\LocalServiceBuilder.cs:line 69
   at Topshelf.Model.LocalServiceController`1.CallAction[TBefore,TComplete](String text, Action`1 callback, Func`1 before, Func`1 complete) in d:\BuildAgent-01\work\799c08e77fef999d\src\Topshelf\Model\LocalServiceController.cs:line 153
HelpLink:

System.InvalidOperationException
Failed processing binding[SmtpPingCheck->EveryMinute]
   at Wolfpack.Core.Loaders.HealthCheckBindingLoader.<>c__DisplayClass2.b__1(BindingConfiguration bc) in c:\Projects\Wolfpack\Trunk\Releases\v2.4.0\Source\Wolfpack.Core\Loaders\HealthCheckBindingLoader.cs:line 119
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at Wolfpack.Core.Loaders.HealthCheckBindingLoader.Load(Binding[]& components) in c:\Projects\Wolfpack\Trunk\Releases\v2.4.0\Source\Wolfpack.Core\Loaders\HealthCheckBindingLoader.cs:line 46
   at Wolfpack.Core.Loaders.HealthCheckLoader.Load(IHealthCheckSchedulerPlugin[]& components) in c:\Projects\Wolfpack\Trunk\Releases\v2.4.0\Source\Wolfpack.Core\Loaders\HealthCheckLoader.cs:line 26
   at Wolfpack.Agent.Roles.Agent.Start() in c:\Projects\Wolfpack\Trunk\Releases\v2.4.0\Source\Wolfpack.Agent\Roles\Agent.cs:line 116
   at Wolfpack.Agent.Startup.<>c__DisplayClass8.b__6(IRolePlugin s) in c:\Projects\Wolfpack\Trunk\Releases\v2.4.0\Source\Wolfpack.Agent\Startup.cs:line 84
   at Topshelf.Builders.LocalServiceBuilder`1.StartService(T service) in d:\BuildAgent-01\work\799c08e77fef999d\src\Topshelf\Config\Builders\LocalServiceBuilder.cs:line 65
HelpLink:

System.InvalidOperationException
Searching for type name 'SmtpPingCheck'; found no matches. Check the HealthCheckConfigurationName property of your BindingConfigurations are valid
   at Wolfpack.Core.Loaders.HealthCheckBindingLoader.<>c__DisplayClass2.b__1(BindingConfiguration bc) in c:\Projects\Wolfpack\Trunk\Releases\v2.4.0\Source\Wolfpack.Core\Loaders\HealthCheckBindingLoader.cs:line 85
HelpLink:


2012-10-02 19:40:22,918 [1] ERROR Topshelf.Hosts.ConsoleRunHost [(null)] - An exception occurred
Topshelf.Exceptions.TopshelfException: At least one configured service failed to start
   at Topshelf.Model.ServiceCoordinator.WaitUntilServicesAreRunning(IEnumerable`1 services, TimeSpan timeout) in d:\BuildAgent-01\work\799c08e77fef999d\src\Topshelf\Model\ServiceCoordinator.cs:line 223
   at Topshelf.Model.ServiceCoordinator.Start() in d:\BuildAgent-01\work\799c08e77fef999d\src\Topshelf\Model\ServiceCoordinator.cs:line 116
   at Topshelf.Hosts.ConsoleRunHost.Run() in d:\BuildAgent-01\work\799c08e77fef999d\src\Topshelf\Hosts\ConsoleRunHost.cs:line 65
2012-10-02 19:40:23,183 [1] INFO  Topshelf.Hosts.ConsoleRunHost [(null)] - [Topshelf] Stopping
2012-10-02 19:40:24,291 [1] DEBUG Topshelf.Model.ServiceCoordinator [(null)] - [Topshelf] After stopping services
2012-10-02 19:40:24,291 [1] INFO  Topshelf.Model.ServiceCoordinator [(null)] - [Topshelf] After stopping services complete
2012-10-02 19:40:24,291 [1] DEBUG Topshelf.Model.ServiceCoordinator [(null)] - [Topshelf] Closing coordinator channel
2012-10-02 19:40:24,369 [1] INFO  Topshelf.Hosts.ConsoleRunHost [(null)] - [Topshelf] Stopped

Coordinator
Oct 3, 2012 at 1:59 AM

Ok I think the issue is that your SmtpPingCheck class is private, needs to be public

Oct 3, 2012 at 2:19 AM

Bingo, I was concentrating on the names. Should I make this a Contrib project?

Coordinator
Oct 3, 2012 at 6:05 AM

Great ... sure, this would make a very nice additional check.

What level of contribution do you want to make? You can dropbox me the source zip and I can take it from there or I can add you to the contrib project and you can commit directly to the repository - up to you?

I usually take care of setting up the NuGet package for it (no docs on how to do this yet) and set up the docs wiki page for your check but you will either have to help me document it (eg what do the config params do) or you can edit the page yourself....and obviously your name all over it to ensure you get the props due!

Thanks - it's contributions from the community like this that really help improve the software. Any more contrib components gratefully welcome along with suggestions, new features etc.

Cheers,

James

Coordinator
Oct 3, 2012 at 6:07 AM

...oh and of course...spread the word - let others know about Wolfpack if you believe it's doing a good job! Complimentary blog posts and tweets always welcome ;-)

J

Oct 3, 2012 at 2:12 PM
Edited Oct 3, 2012 at 3:00 PM

Ok, here's the project. 

https://dl.dropbox.com/u/1539/SmtpPingCheck/Wolfpack.Contrib.SmtpPingCheck.zip

Somehow in testing, I screwed up all publishing for my install. This returns the information through debug statements that I expect, but I actually haven't been able to verify the publish results.

If you set up the Wiki page, I'll document it. There are only two parameters.

Also, I ran into problems running this with the released binaries. It only successfully ran with binaries built from the latest source. HealthCheckPluginConfigBase wasn't in Wolfpack.Core.Interfaces.Entities I originally had.

Update: Got publishing working and validated results.

Coordinator
Oct 3, 2012 at 3:41 PM

Excellent stuff!

I think that HealthCheckPluginConfigBase is a new base class introduced as part of the NotificationModes feature in the next release (v2.5) so that is why it's not in the binaries (yet).

I'll take a crack at uploading this into the contrib solution tonight and drop you a message when the wiki page is online - I should be able to figure out the params but might need you to give it the once over.

Many Thanks!

James

Coordinator
Oct 3, 2012 at 11:29 PM

ok I have packaged your code into the contrib project as a new health check plugin and created the NuGet package for it (private feed for testing). I have also created the docs page here;

http://wolfpackcontrib.codeplex.com/wikipage?title=Wolfpack.Contrib.Checks.Smtp&referringTitle=Home

Due to the changes I am making in vNext of Wolfpack I'll actually release this new check as part of vNext as it uses some new base classes not released yet. 

Cheers,

James