1.sub.mql 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. -- 订阅MQL语句 --
  2. -- /**
  3. -- subscribe({
  4. -- "topic": "mql",
  5. -- "request": {
  6. -- "mql1": {
  7. -- "mql": "
  8. -- select count(*),min(vtime) as minvtime,max(vtime),sum(vtime),avg(vtime),day,node,status
  9. -- from /cache/alerts_status
  10. -- where status>=100 and status <=300 and node!='node:node:192.168.0.11'
  11. -- group by day
  12. -- ",
  13. -- "interval": "3s",
  14. -- },
  15. -- "mql2": {
  16. -- "mql": "
  17. -- select count(*),min(vtime) as minvtime,max(vtime),sum(vtime),avg(vtime),day,node,status
  18. -- from /cache/alerts_status
  19. -- where status>=100 and status <=300 and node=='node:node:192.168.0.11'
  20. -- group by day
  21. -- ",
  22. -- "interval": "3s",
  23. -- },
  24. -- "mql3": {
  25. -- "mql": "
  26. -- select count(*),min(vtime) as minvtime,max(vtime),sum(vtime),avg(vtime),day,node,status
  27. -- from /cache/alerts_status
  28. -- where status<100
  29. -- group by day
  30. -- ",
  31. -- "interval": "5s",
  32. -- },
  33. -- "mql4": {
  34. -- "mql": "
  35. -- select count(*),min(vtime) as minvtime,max(vtime),sum(vtime),avg(vtime),day,node,status
  36. -- from /cache/alerts_status
  37. -- where status>300
  38. -- group by day
  39. -- ",
  40. -- "interval": "2s",
  41. -- },
  42. -- },
  43. -- })
  44. -- sleep(100000d)
  45. -- **/
  46. ;