Guest User

Untitled

a guest
Dec 11th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. if(!_.isUndefined(ARGS.hostname)) {
  2. hostname = ARGS.hostname;
  3. }
  4.  
  5.  
  6. dashboard = {
  7. title: hostname,
  8. rows : [],
  9. };
  10.  
  11. dashboard.time = {
  12. from: "now-6h",
  13. to: "now"
  14. };
  15.  
  16. dashboard.rows.push({
  17. title: 'Chart',
  18. panels: [
  19. {
  20. title: 'load',
  21. type: 'graph',
  22. span: 12,
  23. datasource: "labo",
  24. fill: 1,
  25. linewidth: 2,
  26. targets: [
  27. {
  28. "expr": "node_load1{instance='"+ hostname +"'}"
  29. },
  30. ],
  31. },
  32. ]
  33. });
  34. dashboard.rows.push({
  35. title: 'Chart',
  36. panels: [
  37. {
  38. title: 'io',
  39. type: 'graph',
  40. span: 6,
  41. datasource: "labo",
  42. fill: 1,
  43. linewidth: 2,
  44. targets: [
  45. {
  46. "expr": "irate(node_disk_io_time_seconds_total{instance='" + hostname +"',device!~'^(md\\\\d+$|dm-)'}[5m])"
  47. },
  48. ],
  49. },
  50. {
  51. title: 'network',
  52. type: 'graph',
  53. span: 6,
  54. datasource: "labo",
  55. fill: 1,
  56. linewidth: 2,
  57. targets: [
  58. {
  59. "expr": "sum (irate(node_network_transmit_bytes_total{device!~\"lo|bond[0-9]|cbr[0-9]|veth.*\",instance='" + hostname +"'}[1m])) by (device,instance) "
  60. },
  61. ],
  62. }
  63. ]
  64. });
  65.  
  66. return dashboard;
Add Comment
Please, Sign In to add comment