alert_instance.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. var App = require('app');
  19. App.AlertInstance = DS.Model.extend({
  20. id: DS.attr('number'),
  21. label: DS.attr('string'),
  22. alertDefinition: DS.belongsTo('App.AlertDefinition'),
  23. serviceName: DS.attr('string'),
  24. componentName: DS.attr('string'),
  25. hostName: DS.attr('string'),
  26. scope: DS.attr('string'),
  27. originalTimestamp: DS.attr('number'),
  28. latestTimestamp: DS.attr('number'),
  29. maintenanceState: DS.attr('string'),
  30. instance: DS.attr('string'),
  31. state: DS.attr('string'),
  32. text: DS.attr('string')
  33. });
  34. App.AlertInstance.FIXTURES = [
  35. {
  36. "id": 1,
  37. "cluster_name": "tdk",
  38. "component_name": "SECONDARY_NAMENODE",
  39. "host_name": "tr-2.c.pramod-thangali.internal",
  40. "instance": null,
  41. "label": "Secondary NameNode Process",
  42. "latest_timestamp": 1414664775337,
  43. "maintenance_state": "OFF",
  44. "name": "secondary_namenode_process",
  45. "original_timestamp": 1414585335334,
  46. "scope": "ANY",
  47. "service_name": "HDFS",
  48. "state": "CRITICAL",
  49. "text": "Connection failed: [Errno 111] Connection refused on host tr-2.c.pramod-thangali.internal:50090",
  50. "alert_definition": 1
  51. },
  52. {
  53. "cluster_name" : "tdk",
  54. "component_name" : "DATANODE",
  55. "host_name" : "tr-3.c.pramod-thangali.internal",
  56. "id" : 2,
  57. "instance" : null,
  58. "label" : "DataNode Web UI",
  59. "latest_timestamp" : 1414666905645,
  60. "maintenance_state" : "OFF",
  61. "name" : "datanode_webui",
  62. "original_timestamp" : 1414585365674,
  63. "scope" : "HOST",
  64. "service_name" : "HDFS",
  65. "state" : "CRITICAL",
  66. "text" : "Connection failed to 0.0.0.0:50075",
  67. "alert_definition": 2
  68. },
  69. {
  70. "cluster_name": "tdk",
  71. "component_name": "ZOOKEEPER_SERVER",
  72. "host_name": "tr-1.c.pramod-thangali.internal",
  73. "id": 3,
  74. "instance": null,
  75. "label": "ZooKeeper Server Process",
  76. "latest_timestamp": 1414665174611,
  77. "maintenance_state": "OFF",
  78. "name": "zookeeper_server_process",
  79. "original_timestamp": 1414585014606,
  80. "scope": "ANY",
  81. "service_name": "ZOOKEEPER",
  82. "state": "CRITICAL",
  83. "text": "TCP OK - 0.0000 response on port 2181",
  84. "alert_definition": 3
  85. },
  86. {
  87. "cluster_name": "tdk",
  88. "component_name": "ZOOKEEPER_SERVER",
  89. "host_name": "tr-2.c.pramod-thangali.internal",
  90. "id": 4,
  91. "instance": null,
  92. "label": "ZooKeeper Server Process",
  93. "latest_timestamp": 1414665135341,
  94. "maintenance_state": "OFF",
  95. "name": "zookeeper_server_process",
  96. "original_timestamp": 1414585035316,
  97. "scope": "ANY",
  98. "service_name": "ZOOKEEPER",
  99. "state": "OK",
  100. "text": "TCP OK - 0.0000 response on port 2181",
  101. "alert_definition": 3
  102. },
  103. {
  104. "cluster_name": "tdk",
  105. "component_name": "ZOOKEEPER_SERVER",
  106. "host_name": "tr-3.c.pramod-thangali.internal",
  107. "id": 5,
  108. "instance": null,
  109. "label": "ZooKeeper Server Process",
  110. "latest_timestamp": 1414665165640,
  111. "maintenance_state": "OFF",
  112. "name": "zookeeper_server_process",
  113. "original_timestamp": 1414585065616,
  114. "scope": "ANY",
  115. "service_name": "ZOOKEEPER",
  116. "state": "OK",
  117. "text": "TCP OK - 0.0000 response on port 2181",
  118. "alert_definition": 3
  119. }
  120. ];