This small app will attempt to connect to your server's Windows Services and databases and verify that everything is running as expected.
-
Add your remote service monitoring details to the
remoteServicessection of the Web.config:<remoteServices> <add name="SQLSERVERAGENT" path="\\server\root\CIMV2" username=".\user" password="password" authority="" state="running"/> <add name="MSSQLSERVER" path="\\server\root\CIMV2" username=".\user" password="password" authority="" state="running"/> </remoteServices>
Use Start > Run > WBEMTEST to help test for valid path/username/password/authority settings.
-
Add your database connection string to the
connectionStringssection of the Web.config:<connectionStrings> <clear/> <add name="ASPState" connectionString="Data Source=.;Initial Catalog=ASPState;User ID=sa;Pwd=tester12" providerName="System.Data.SqlClient"/> </connectionStrings> -
Configure logging to output to your logs directory. Be sure to give the IIS AppPool user account write permissions to your logs directory:
<listeners> <add name="outfile" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\temp\upcheck.log"/> </listeners> -
If debug is set to
true, the exceptions that are thrown will be the actual exceptions encountered. If set tofalse, the exception will be a genericERROR:message suitable for public viewing:<system.web> <compilation debug="true" targetFramework="4.0"/> </system.web> -
Build and publish the
bin/,up.ashx, andWeb.configfiles to an IIS Virtual Directory (default settings are for ASP.NET 4). -
Setup an HTTP monitor (i.e. binarycanary.com) to hit
up.ashxperiodically. A200response means that no exceptions were thrown. A500means an exception was encountered. Monitor the trace log for more details.