config.html 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <h3 class="page-heading">MS SQL 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" style="width: 352px" ng-model='ctrl.current.url' placeholder="localhost"
  6. bs-typeahead="{{['localhost', 'localhost:1433']}}" required></input>
  7. </div>
  8. <div class="gf-form max-width-30">
  9. <span class="gf-form-label width-7">Database</span>
  10. <input type="text" class="gf-form-input" style="width: 352px" ng-model='ctrl.current.database'
  11. placeholder="database name" required></input>
  12. </div>
  13. <div class="gf-form">
  14. <label class="gf-form-label width-7" for="auth-select">Authentication</label>
  15. <div class="gf-form-select-wrapper max-width-15 gf-form-select-wrapper--has-help-icon">
  16. <select id="auth-select" class="gf-form-input" ng-model="ctrl.current.jsonData.authenticationType"
  17. ng-options="mode for mode in ['Windows Authentication', 'SQL Server Authentication']"
  18. ng-init="ctrl.current.jsonData.authenticationType" ng-change="ctrl.onAuthenticationTypeChange()"></select>
  19. <info-popover mode="right-absolute">
  20. <ul>
  21. <li><i>SQL Server Authentication</i> This is the default mechanism to connect to MS SQL Server. Enter the SQL
  22. Server Authentication login or the Windows Authentication login in the DOMAIN\User format.</li>
  23. <li><i>Windows Authentication</i> Windows Integrated Security - single sign on for users who are already
  24. logged onto Windows and have enabled this option for MS SQL Server.</li>
  25. </ul>
  26. </info-popover>
  27. </div>
  28. </div>
  29. <div class="gf-form-inline" ng-show="ctrl.showUserCredentials">
  30. <div class="gf-form max-width-15">
  31. <span class="gf-form-label width-7">User</span>
  32. <input type="text" class="gf-form-input" ng-model='ctrl.current.user' placeholder="user"></input>
  33. </div>
  34. <div class="gf-form">
  35. <secret-form-field isConfigured="ctrl.current.secureJsonFields.password"
  36. value="ctrl.current.secureJsonData.password" on-reset="ctrl.onPasswordReset" on-change="ctrl.onPasswordChange"
  37. labelWidth="7" inputWidth="7" aria-label="'Password'" />
  38. </div>
  39. </div>
  40. </div>
  41. <h3 class="page-heading">TLS/SSL Auth</h3>
  42. <div class="gf-form-group">
  43. <div class="gf-form">
  44. <label class="gf-form-label width-15" for="encrypt-select">Encrypt</label>
  45. <div class="gf-form-select-wrapper max-width-15 gf-form-select-wrapper--has-help-icon">
  46. <select id="encrypt-select" class="gf-form-input" ng-model="ctrl.current.jsonData.encrypt"
  47. ng-options="mode for mode in ['disable', 'false', 'true']" ng-init="ctrl.current.jsonData.encrypt"
  48. ng-change="ctrl.onEncryptChange()" aria-labelledby="encrypt-label"></select>
  49. <info-popover mode="right-absolute">
  50. Determines whether or to which extent a secure SSL TCP/IP connection will be negotiated with the server.
  51. <ul>
  52. <li><i>disable</i> - Data sent between client and server is not encrypted.</li>
  53. <li><i>false</i> - Data sent between client and server is not encrypted beyond the login packet. (default)
  54. </li>
  55. <li><i>true</i> - Data sent between client and server is encrypted.</li>
  56. </ul>
  57. If you're using an older version of Microsoft SQL Server like 2008 and 2008R2 you may need to disable encryption
  58. to be able to connect.
  59. </info-popover>
  60. </div>
  61. </div>
  62. <div class="gf-form" ng-show="ctrl.showTlsConfig">
  63. <gf-form-switch class="gf-form" label="Skip TLS/SSL Verify" label-class="width-15"
  64. tooltip="Skip verifying Server Certificate for TLS/SSL. If this is enabled, any certificate presented by the server and any host name in that certificate will be accepted. In this mode, TLS is susceptible to man-in-the-middle attacks. This should be used only for testing."
  65. checked="ctrl.current.jsonData.tlsSkipVerify" switch-class="max-width-8" on-change="ctrl.onEncryptChange()">
  66. </gf-form-switch>
  67. </div>
  68. <div class="gf-form max-width-30" ng-show="ctrl.showCertificateConfig">
  69. <span class="gf-form-label width-15">TLS/SSL Root Certificate</span>
  70. <input type="text" class="gf-form-input" style="width: 352px" ng-model='ctrl.current.jsonData.sslRootCertFile'
  71. placeholder="TLS/SSL root certificate file"></input>
  72. <info-popover mode="right-absolute">
  73. Path to file containing the public key certificate of the CA that signed the SQL Server certificate. Needed when
  74. the server certificate is self signed.
  75. </info-popover>
  76. </div>
  77. <div class="gf-form max-width-30" ng-show="ctrl.showCertificateConfig">
  78. <span class="gf-form-label width-15">Hostname in server certificate</span>
  79. <input type="text" class="gf-form-input" style="width: 352px" ng-model='ctrl.current.jsonData.serverName'
  80. placeholder="Common Name (CN) in server certificate"></input>
  81. <info-popover mode="right-absolute">
  82. Specifies the Common Name (CN) in the server certificate. Default is the server host.
  83. </info-popover>
  84. </div>
  85. </div>
  86. <h3 class="page-heading">Connection limits</h3>
  87. <div class="gf-form-group">
  88. <div class="gf-form max-width-15">
  89. <span class="gf-form-label width-7">Max open</span>
  90. <input type="number" min="0" class="gf-form-input gf-form-input--has-help-icon"
  91. ng-model="ctrl.current.jsonData.maxOpenConns" placeholder="unlimited"></input>
  92. <info-popover mode="right-absolute">
  93. The maximum number of open connections to the database. If <i>Max idle connections</i> is greater than 0 and the
  94. <i>Max open connections</i> is less than <i>Max idle connections</i>, then <i>Max idle connections</i> will be
  95. reduced to match the <i>Max open connections</i> limit. If set to 0, there is no limit on the number of open
  96. connections.
  97. </info-popover>
  98. </div>
  99. <div class="gf-form max-width-15">
  100. <span class="gf-form-label width-7">Max idle</span>
  101. <input type="number" min="0" class="gf-form-input gf-form-input--has-help-icon"
  102. ng-model="ctrl.current.jsonData.maxIdleConns" placeholder="2"></input>
  103. <info-popover mode="right-absolute">
  104. The maximum number of connections in the idle connection pool. If <i>Max open connections</i> is greater than 0
  105. but
  106. less than the <i>Max idle connections</i>, then the <i>Max idle connections</i> will be reduced to match the
  107. <i>Max open connections</i> limit. If set to 0, no idle connections are retained.
  108. </info-popover>
  109. </div>
  110. <div class="gf-form max-width-15">
  111. <span class="gf-form-label width-7">Max lifetime</span>
  112. <input type="number" min="0" class="gf-form-input gf-form-input--has-help-icon"
  113. ng-model="ctrl.current.jsonData.connMaxLifetime" placeholder="14400"></input>
  114. <info-popover mode="right-absolute">
  115. The maximum amount of time in seconds a connection may be reused. If set to 0, connections are reused forever.
  116. </info-popover>
  117. </div>
  118. </div>
  119. <h3 class="page-heading">MS SQL details</h3>
  120. <div class="gf-form-group">
  121. <div class="gf-form-inline">
  122. <div class="gf-form">
  123. <span class="gf-form-label width-9">Min time interval</span>
  124. <input type="text" class="gf-form-input width-6 gf-form-input--has-help-icon"
  125. ng-model="ctrl.current.jsonData.timeInterval" spellcheck='false' placeholder="1m"
  126. ng-pattern="/^\d+(ms|[Mwdhmsy])$/"></input>
  127. <info-popover mode="right-absolute">
  128. A lower limit for the auto group by time interval. Recommended to be set to write frequency,
  129. for example <code>1m</code> if your data is written every minute.
  130. </info-popover>
  131. </div>
  132. </div>
  133. </div>
  134. <div class="gf-form-group">
  135. <div class="grafana-info-box">
  136. <h5>User Permission</h5>
  137. <p>
  138. The database user should only be granted SELECT permissions on the specified database and tables you want to
  139. query.
  140. Grafana does not validate that queries are safe so queries can contain any SQL statement. For example, statements
  141. like <code>USE otherdb;</code> and <code>DROP TABLE user;</code> would be executed. To protect against this we
  142. <emphasis>highly</emphasis> recommmend you create a specific MS SQL user with restricted permissions.
  143. </p>
  144. </div>
  145. </div>