ICloudMonitor.cs 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. using PMS.BusinessModels.CloudMonitorManage;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace PMS.Interface.CloudMonitorManage
  9. {
  10. public interface ICloudMonitor
  11. {
  12. /// <summary>
  13. /// 保存云监控配置
  14. /// </summary>
  15. /// <param name="cloudMonitorConfig"></param>
  16. /// <returns></returns>
  17. bool SaveCloudMonitorConfig(CloudMonitorConfig cloudMonitorConfig);
  18. /// <summary>
  19. /// 保存采集配置
  20. /// </summary>
  21. /// <param name="collectionConfig"></param>
  22. /// <returns></returns>
  23. bool SaveCollectionConfig(CollectionConfig collectionConfig);
  24. /// <summary>
  25. /// 保存预警配置
  26. /// </summary>
  27. /// <param name="alertConfig"></param>
  28. /// <returns></returns>
  29. bool SaveAlertConfig(AlertConfig alertConfig);
  30. /// <summary>
  31. /// 获取云监控配置
  32. /// </summary>
  33. /// <returns></returns>
  34. CloudMonitorConfig GetCloudMonitorConfig();
  35. /// <summary>
  36. /// 根据项目id获取自定义预警配置
  37. /// </summary>
  38. /// <param name="itemId"></param>
  39. /// <returns></returns>
  40. List<CustomAlertModel> GetCustomAlertModelByItemId(string itemId);
  41. /// <summary>
  42. /// 根据项目id获取 启动的自定义预警配置
  43. /// </summary>
  44. /// <param name="itemId"></param>
  45. /// <returns></returns>
  46. List<CustomAlertModel> GetCustomAlertModelByItemIdAndStart(string itemId);
  47. /// <summary>
  48. /// 根据项目id获取 启动的自定义预警配置
  49. /// </summary>
  50. /// <param name="itemId"></param>
  51. /// <returns></returns>
  52. List<CustomAPIModel> GetCustomServerModelByItemIdAndStart(string itemId);
  53. /// <summary>
  54. /// 根据渠道id获取自定义配置
  55. /// </summary>
  56. /// <param name="channelId"></param>
  57. /// <returns></returns>
  58. List<CustomAlertModel> GetCustomAlertModelByChannelId(string channelId, string search);
  59. /// <summary>
  60. /// 根据渠道id获取自定义API配置
  61. /// </summary>
  62. /// <param name="channelId"></param>
  63. /// <returns></returns>
  64. List<CustomAPIModel> GetCustomAPIModelByChannelId(string channelId, string search);
  65. /// <summary>
  66. /// 根据创建人id获取自定义配置
  67. /// </summary>
  68. /// <param name="creatorId"></param>
  69. /// <returns></returns>
  70. List<CustomAlertModel> GetCustomAlertModelByCreatorId(string creatorId);
  71. /// <summary>
  72. /// 根据项目id获取服务器信息
  73. /// </summary>
  74. /// <param name="itemid"></param>
  75. /// <returns></returns>
  76. List<ServerInfoModel> GetServerByItemId(string itemid);
  77. /// <summary>
  78. /// 新增自定义配置
  79. /// </summary>
  80. /// <param name="model"></param>
  81. /// <returns></returns>
  82. bool InsertCustomAlert(CustomAlertModel model);
  83. /// <summary>
  84. /// 新增自定义API配置
  85. /// </summary>
  86. /// <param name="model"></param>
  87. /// <returns></returns>
  88. bool InsertCustomAPI(CustomAPIModel model);
  89. /// <summary>
  90. /// 修改
  91. /// </summary>
  92. /// <param name="model"></param>
  93. /// <returns></returns>
  94. bool UpdateCustomAlert(CustomAlertModel model);
  95. /// <summary>
  96. /// 修改API
  97. /// </summary>
  98. /// <param name="model"></param>
  99. /// <returns></returns>
  100. bool UpdateCustomAPI(CustomAPIModel model);
  101. /// <summary>
  102. /// 根据id删除
  103. /// </summary>
  104. /// <param name="id"></param>
  105. /// <returns></returns>
  106. bool DeleteCustomAlertById(string id);
  107. /// <summary>
  108. /// 根据id删除
  109. /// </summary>
  110. /// <param name="id"></param>
  111. /// <returns></returns>
  112. bool DeleteCustomAPIById(string id);
  113. /// <summary>
  114. /// 获取所有服务器信息
  115. /// </summary>
  116. /// <returns></returns>
  117. List<ServerIndexInfoModel> GetServerIndexInfoAll();
  118. /// <summary>
  119. /// 获取所有服务器信息 通过项目id过滤
  120. /// </summary>
  121. /// <returns></returns>
  122. List<ServerIndexInfoModel> GetServerIndexInfoByProjectId(string itemId);
  123. /// <summary>
  124. /// 获取所有服务器信息 通过渠道id过滤
  125. /// </summary>
  126. /// <returns></returns>
  127. List<ServerIndexInfoModel> GetServerIndexInfoByChannelId(string channelId, string search = "");
  128. /// <summary>
  129. /// 获取指标详情 根据指标id
  130. /// </summary>
  131. /// <param name="indexId"></param>
  132. List<ServerIndexDetailModel> GetServerIndexDetailByIndexId(string indexId, DateTime startTime, DateTime endTime);
  133. /// <summary>
  134. /// 获取指标详情 服务器ID
  135. /// </summary>
  136. /// <param name="serverId"></param>
  137. List<ServerIndexDetailModel> GetServerIndexDetailByServerId(string serverId, DateTime startTime, DateTime endTime);
  138. /// <summary>
  139. /// 获取所有服务器预警
  140. /// </summary>
  141. /// <returns></returns>
  142. List<ServerAlertModel> GetServerAlertAll(string search);
  143. /// <summary>
  144. /// 根据预警id获取服务器预警
  145. /// </summary>
  146. /// <returns></returns>
  147. ServerAlertModel GetServerAlertByAlertlId(string alertlId);
  148. /// <summary>
  149. /// 根据条件获取服务器预警
  150. /// </summary>
  151. /// <returns></returns>
  152. List<ServerAlertModel> GetServerAlertBySearch(ServerAlertSearch search);
  153. /// <summary>
  154. /// 插入服务器预警处理
  155. /// </summary>
  156. /// <param name="model"></param>
  157. /// <returns></returns>
  158. bool InsertServerAlertProcess(ServerAlertProcessModel model);
  159. /// <summary>
  160. /// 查询服务器预警处理过程
  161. /// </summary>
  162. /// <param name="alertId"></param>
  163. /// <returns></returns>
  164. List<ServerAlertProcessModel> GetServerAlertProcessByAlertId(string alertId);
  165. /// <summary>
  166. /// 获取全部项目监控数据
  167. /// </summary>
  168. /// <returns></returns>
  169. List<ProjectMonitorModel> GetProjectMonitorAll();
  170. /// <summary>
  171. /// 根据查询获取全部项目监控
  172. /// </summary>
  173. /// <returns></returns>
  174. List<ProjectMonitorModel> GetProjectMonitorBySearch(ServerAlertSearch search);
  175. /// <summary>
  176. /// 获取项目的监控状态,根据渠道id过滤
  177. /// </summary>
  178. /// <param name="channelId"></param>
  179. /// <returns></returns>
  180. List<ProjectMonitorModel> GetProjectMonitorByChannelId(string channelId);
  181. /// <summary>
  182. /// 启动或者停止项目监控
  183. /// </summary>
  184. /// <param name="projectId"></param>
  185. /// <param name="state"></param>
  186. bool StartOrStopProjectMonitor(string projectId, bool state, string clientId = "");
  187. /// <summary>
  188. /// 插入数据库数据
  189. /// </summary>
  190. /// <param name="model"></param>
  191. /// <returns></returns>
  192. bool InsertDbInfo(DbInfoModel model);
  193. /// <summary>
  194. /// 修改数据库数据
  195. /// </summary>
  196. /// <param name="model"></param>
  197. /// <returns></returns>
  198. bool UpdateDbInfo(DbInfoModel model);
  199. /// <summary>
  200. /// 获取数据库数据,根据服务器ID过滤
  201. /// </summary>
  202. /// <param name="channelId"></param>
  203. /// <returns></returns>
  204. List<DbInfoModel> GetDbInfoByServerId(string serverId);
  205. /// <summary>
  206. /// 获取数据库数据,根据ID过滤
  207. /// </summary>
  208. /// <param name="channelId"></param>
  209. /// <returns></returns>
  210. DbInfoModel GetDbInfoById(string id);
  211. /// <summary>
  212. /// 删除数据库数据,根据ID
  213. /// </summary>
  214. /// <param name="id"></param>
  215. /// <returns></returns>
  216. bool DeleteDbInfoById(string id);
  217. /// <summary>
  218. /// 查询上传指标数据
  219. /// </summary>
  220. /// <returns></returns>
  221. PushIndexDataModelTablePage GetPushIndexData(IndexSearch search);
  222. /// <summary>
  223. /// 接收上报的服务器信息
  224. /// </summary>
  225. /// <param name="serverInfos"></param>
  226. void ReceiveServerInfo(string clientId, List<Ret<ServerInfo>> serverInfos);
  227. /// <summary>
  228. /// 接收上报的数据库连接数信息
  229. /// </summary>
  230. /// <param name="dbConnectInfos"></param>
  231. /// <returns></returns>
  232. void ReceiveDbConnectInfo(string clientId, List<Ret<DbConnectInfo>> dbConnectInfos);
  233. /// <summary>
  234. /// 接收上报的数据库死锁信息
  235. /// </summary>
  236. /// <param name="dbLockedInfos"></param>
  237. /// <returns></returns>
  238. void ReceiveDbLockedInfo(string clientId, List<Ret<DbLockedInfo>> dbLockedInfos);
  239. /// <summary>
  240. /// 接收上报的服务发现信息
  241. /// </summary>
  242. /// <returns></returns>
  243. void ReceiveServiceWorkStateInfo(string clientId, List<Ret<ServiceWorkStateInfo>> serviceWorkStateInfos);
  244. /// <summary>
  245. /// 接收上报的自定义预警信息
  246. /// </summary>
  247. /// <returns></returns>
  248. void ReceiveDbCustomAlertInfo(string clientId, Ret<DbCustomAlertInfo> info);
  249. /// <summary>
  250. /// 接收上报的自定义服务信息
  251. /// </summary>
  252. /// <returns></returns>
  253. void ReceiveCustomServiceInfo(string clientId, Ret<CustomServiceInfo> info);
  254. /// <summary>
  255. /// 采集中断扫描
  256. /// </summary>
  257. void CollectionInterruptScanning();
  258. /// <summary>
  259. /// 磁盘可用天数扫描
  260. /// </summary>
  261. void DiskAvailabilityScanning();
  262. }
  263. }