Pergunta

we have a Windows Server 2008 R2 running 4 virtual servers on a Server Farm, but currently the only way we're able to check the health of the servers is by RDP'ing on to the server that manages them and going into IIS. We would like to be able to have a webpage where we can see the healf of the servers and see which ones are available or unavailable.

Is there a way for us, to interact with the server (potentially via an API) and get information about the servers in our C# code?

Foi útil?

Solução

There are plenty of performance counters at your disposal for monitoring IIS and related services remotely:

You can check out these counter values through windows's Performance Monitor, which provides a fair user interface, or use the following C# code to develop your own monitoring tool:

var category = "Web Service";
var counter = "Current Connections";
var instance = "_Total";
var server = "192.168.0.1";

var perf = new PerformanceCounter(category , counter , instance , server);

int connections = (int)perf.NextValue();
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top