9x.mql 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. -- delete from /test/malert_status_cache;
  2. insert into /test/malert_status_cache (
  3. identifier, severity, lastoccurrence, maintenance, msg,
  4. type, agent, firstoccurrence, omni_class, nodealias,
  5. alertgroup, node, manager, originalseverity, summary,
  6. tags)
  7. values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
  8. on conflict
  9. update firstoccurrence=firstoccurrence, servicenowstate=servicenowstate, emailstatus=emailstatus, tally=tally+1
  10. /**
  11. params(
  12. "222.129.134.178.1.3.6.1.4.1.2011.5.25.219.2.5.665.25.219.2.5.6.0.{%d,mqli}", 5, 1622249715000, nil, "设备:222.129.134.178电源整体功能恢复!",
  13. nil, "huawei mttrapd #x{%d,mqli}", 1622211715023, "300", "222.129.134.178",
  14. "huawei_power_func", "222.129.134.178", "MTTrapd Probe", 5, "设备:222.129.134.178电源整体功能恢复!",
  15. "tag")
  16. loop(10)
  17. **/
  18. ;
  19. insert into /test/malert_status_cache (
  20. identifier, severity, lastoccurrence, maintenance, msg,
  21. type, agent, firstoccurrence, omni_class, nodealias,
  22. alertgroup, node, manager, originalseverity, summary,
  23. tags)
  24. values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
  25. on conflict
  26. update firstoccurrence=firstoccurrence, servicenowstate=servicenowstate, emailstatus=emailstatus, tally=tally+1
  27. /**
  28. params(
  29. "222.129.134.178.1.3.6.1.4.1.2011.5.25.219.2.5.665.25.219.2.5.6.1.{%d,mqli}", 5, 1622249715000, nil, "设备:222.129.134.178电源整体功能恢复!",
  30. 1, "huawei mttrapd #1{%d,mqli}", 1622211715023, "300", "222.129.134.178",
  31. "huawei_power_func", "222.129.134.178", "MTTrapd Probe", 5, "设备:222.129.134.178电源整体功能恢复!",
  32. "tag")
  33. loop(10)
  34. **/
  35. ;
  36. insert into /test/malert_status_cache (
  37. identifier, severity, lastoccurrence, maintenance, msg,
  38. type, agent, firstoccurrence, omni_class, nodealias,
  39. alertgroup, node, manager, originalseverity, summary,
  40. tags)
  41. values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
  42. on conflict
  43. update firstoccurrence=firstoccurrence, servicenowstate=servicenowstate, emailstatus=emailstatus, tally=tally+1
  44. /**
  45. params(
  46. "222.129.134.178.1.3.6.1.4.1.2011.5.25.219.2.5.665.25.219.2.5.6.2.{%d,mqli}", 5, 1622249715000, nil, "设备:222.129.134.178电源整体功能恢复!",
  47. 2, "huawei mttrapd #2{%d,mqli}", 1622211715023, "300", "222.129.134.178",
  48. "huawei_power_func", "222.129.134.178", "MTTrapd Probe", 5, "设备:222.129.134.178电源整体功能恢复!",
  49. "tag")
  50. loop(10)
  51. **/
  52. ;
  53. insert into /test/malert_status_cache (
  54. identifier, severity, lastoccurrence, maintenance, msg,
  55. type, agent, firstoccurrence, omni_class, nodealias,
  56. alertgroup, node, manager, originalseverity, summary,
  57. tags)
  58. values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
  59. on conflict
  60. update firstoccurrence=firstoccurrence, servicenowstate=servicenowstate, emailstatus=emailstatus, tally=tally+1
  61. /**
  62. params(
  63. "222.129.134.178.1.3.6.1.4.1.2011.5.25.219.2.5.665.25.219.2.5.6.3.{%d,mqli}", 5, 1622249715000, nil, "设备:222.129.134.178电源整体功能恢复!",
  64. 3, "huawei mttrapd #3{%d,mqli}", 1622211715023, "300", "222.129.134.178",
  65. "huawei_power_func", "222.129.134.178", "MTTrapd Probe", 5, "设备:222.129.134.178电源整体功能恢复!",
  66. "tag")
  67. loop(10)
  68. **/
  69. ;
  70. SELECT
  71. identifier, type, avg(type), vtime, agent, node, tally
  72. FROM /test/malert_status_cache
  73. -- where agent='huawei mttrapd #48'
  74. -- and node='222.129.134.178'
  75. -- where type=null
  76. /**
  77. output()
  78. **/
  79. ;