config.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <h3 class="page-heading">MSSQL Connection</h3>
  2. <div class="gf-form-group">
  3. <div class="gf-form max-width-30">
  4. <span class="gf-form-label width-7">Host</span>
  5. <input type="text" class="gf-form-input" ng-model='ctrl.current.url' placeholder="localhost:1433" bs-typeahead="{{['localhost', 'localhost:1433']}}" required></input>
  6. </div>
  7. <div class="gf-form max-width-30">
  8. <span class="gf-form-label width-7">Database</span>
  9. <input type="text" class="gf-form-input" ng-model='ctrl.current.database' placeholder="database name" required></input>
  10. </div>
  11. <div class="gf-form-inline">
  12. <div class="gf-form max-width-15">
  13. <span class="gf-form-label width-7">User</span>
  14. <input type="text" class="gf-form-input" ng-model='ctrl.current.user' placeholder="user"></input>
  15. </div>
  16. <div class="gf-form max-width-15" ng-if="!ctrl.current.secureJsonFields.password">
  17. <span class="gf-form-label width-7">Password</span>
  18. <input type="password" class="gf-form-input" ng-model='ctrl.current.secureJsonData.password' placeholder="password"></input>
  19. </div>
  20. <div class="gf-form max-width-19" ng-if="ctrl.current.secureJsonFields.password">
  21. <span class="gf-form-label width-7">Password</span>
  22. <input type="text" class="gf-form-input" disabled="disabled" value="configured">
  23. <a class="btn btn-secondary gf-form-btn" href="#" ng-click="ctrl.current.secureJsonFields.password = false">reset</a>
  24. </div>
  25. </div>
  26. <div class="gf-form">
  27. <label class="gf-form-label width-7">Encrypt</label>
  28. <div class="gf-form-select-wrapper max-width-15 gf-form-select-wrapper--has-help-icon">
  29. <select class="gf-form-input" ng-model="ctrl.current.jsonData.encrypt" ng-options="mode for mode in ['disable', 'false', 'true']" ng-init="ctrl.current.jsonData.encrypt"></select>
  30. <info-popover mode="right-absolute">
  31. Determines whether or to which extent a secure SSL TCP/IP connection will be negotiated with the server.
  32. <ul>
  33. <li><i>disable</i> - Data sent between client and server is not encrypted.</li>
  34. <li><i>false</i> - Data sent between client and server is not encrypted beyond the login packet. (default)</li>
  35. <li><i>true</i> - Data sent between client and server is encrypted.</li>
  36. </ul>
  37. If you're using an older version of Microsoft SQL Server like 2008 and 2008R2 you may need to disable encryption to be able to connect.
  38. </info-popover>
  39. </div>
  40. </div>
  41. </div>
  42. <b>Connection limits</b>
  43. <div class="gf-form-group">
  44. <div class="gf-form max-width-15">
  45. <span class="gf-form-label width-7">Max open</span>
  46. <input type="number" min="0" class="gf-form-input" ng-model="ctrl.current.jsonData.maxOpenConns" placeholder="unlimited"></input>
  47. <info-popover mode="right-absolute">
  48. The maximum number of open connections to the database. If <i>Max idle connections</i> is greater than 0 and the
  49. <i>Max open connections</i> is less than <i>Max idle connections</i>, then <i>Max idle connections</i> will be
  50. reduced to match the <i>Max open connections</i> limit. If set to 0, there is no limit on the number of open
  51. connections.
  52. </info-popover>
  53. </div>
  54. <div class="gf-form max-width-15">
  55. <span class="gf-form-label width-7">Max idle</span>
  56. <input type="number" min="0" class="gf-form-input" ng-model="ctrl.current.jsonData.maxIdleConns" placeholder="2"></input>
  57. <info-popover mode="right-absolute">
  58. The maximum number of connections in the idle connection pool. If <i>Max open connections</i> is greater than 0 but
  59. less than the <i>Max idle connections</i>, then the <i>Max idle connections</i> will be reduced to match the
  60. <i>Max open connections</i> limit. If set to 0, no idle connections are retained.
  61. </info-popover>
  62. </div>
  63. <div class="gf-form max-width-15">
  64. <span class="gf-form-label width-7">Max lifetime</span>
  65. <input type="number" min="0" class="gf-form-input" ng-model="ctrl.current.jsonData.connMaxLifetime" placeholder="14400"></input>
  66. <info-popover mode="right-absolute">
  67. The maximum amount of time in seconds a connection may be reused. If set to 0, connections are reused forever.
  68. </info-popover>
  69. </div>
  70. </div>
  71. <h3 class="page-heading">MSSQL details</h3>
  72. <div class="gf-form-group">
  73. <div class="gf-form-inline">
  74. <div class="gf-form">
  75. <span class="gf-form-label width-9">Min time interval</span>
  76. <input type="text" class="gf-form-input width-6" ng-model="ctrl.current.jsonData.timeInterval" spellcheck='false' placeholder="1m"></input>
  77. <info-popover mode="right-absolute">
  78. A lower limit for the auto group by time interval. Recommended to be set to write frequency,
  79. for example <code>1m</code> if your data is written every minute.
  80. </info-popover>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="gf-form-group">
  85. <div class="grafana-info-box">
  86. <h5>User Permission</h5>
  87. <p>
  88. The database user should only be granted SELECT permissions on the specified database &amp; tables you want to query.
  89. Grafana does not validate that queries are safe so queries can contain any SQL statement. For example, statements
  90. like <code>USE otherdb;</code> and <code>DROP TABLE user;</code> would be executed. To protect against this we
  91. <strong>Highly</strong> recommmend you create a specific MSSQL user with restricted permissions.
  92. </p>
  93. </div>
  94. </div>