具有站点状态监视器的多站点仪表板 [英] Multi-Site Dashboard With Site Status Monitor

查看:84
本文介绍了具有站点状态监视器的多站点仪表板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



所以,这个问题更多的是要求提出建议请求,以便它可能更适合我在讨论论坛不确定。



基本上,我一直在制作一个仪表板,其中包含一个监视各种站点的组件,以检查它们是否正常工作。



我走了使用HttpWebRequests的路线



  var  request =(HttpWebRequest)WebRequest.Create(url); 
request.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);

var timer = new 秒表();

var siteState = WebSiteStateEnum.Okay;
尝试
{
timer.Start();
var response =(HttpWebResponse)request.GetResponse();
response.Close();
timer.Stop();

TimeSpan timeTaken = timer.Elapsed;

... // 用于确定网站是基于上/下/慢的代码回复
}
catch (例外)
{
timer.Stop();
}
UpdateWebsiteResult(id,siteState);
Thread.Sleep(siteState == WebSiteStateEnum.Down? 30000 60000 );





所以这段代码运行似乎还可以。不太好但是没关系。



我的问题是,您是采用这种方法还是通过创建signalR HeartBeat类型模块从单个站点驱动此过程你添加到每个网站?



我是否应该添加/做不同的事情从中心点监控各种网站的状态?



(由于各个站点的各种客户要求,这些站点托管在仪表板站点的不同服务器/位置。

解决方案

< blockquote>



我认为更好的方法是:



1.放置网站将ping代码放入更新数据库表的服务中。

2.在仪表板中只检索表状态并显示它。

3.放入历史记录ping到另一个桌子,以便仪表板可以深入到它。



这样可以释放仪表板,使其响应和母鹿sn't冻结延迟和超时。



然后,您可以轻松创建不同的视图,以显示您正在监控的各种网站的不同组或类别。



无法对SignalR发表评论,因为我没有广泛使用它。



- Grant


Hi Guys,

So, this question is more of an asking for a recommendation request for ideas so it may be better suited in the discussions forum I'm not certain.

Basically, I've been working on a Dashboard which contains a component that monitors a variety of sites to check they are working.

I've gone down the route of using HttpWebRequests

var request = (HttpWebRequest) WebRequest.Create(url);
request.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);                

var timer = new Stopwatch();

var siteState = WebSiteStateEnum.Okay;
try
{
     timer.Start();
     var response = (HttpWebResponse) request.GetResponse();
     response.Close();
     timer.Stop();

     TimeSpan timeTaken = timer.Elapsed;

     ...//Code to determine if site is up/down/slow based on response
}
catch (Exception)
{
     timer.Stop();
}
UpdateWebsiteResult(id, siteState);
Thread.Sleep( siteState == WebSiteStateEnum.Down ? 30000 : 60000);



So this code runs and it seems to be okay. Not amazing but okay.

My question is, would you have taken this approach or would you have driven this process from the individual sites by creating a signalR HeartBeat type module that you add to each site?

Is there anything I should add-in / do differently to monitor the status of various websites from a central point?

(These sites are hosted on different servers/locations to the dashboard site due to various client requirements on the individual sites.

解决方案

Hi,

I think a better approach would be to:

1. Put the website "ping" code into a service that updates a database table.
2. In the dashboard just retrieve the table status and display it.
3. Put a history of the pings into another table so the dashboard can drill down into it.

This frees the dashboard so it is responsive and doesn't freeze on delays and timeouts.

You can then easily create different views to show different groups or categories of the various websites that you are monitoring.

Can't comment on SignalR as I haven't used it extensively.

- Grant


这篇关于具有站点状态监视器的多站点仪表板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆