2017-12-02 05:40:12 -06:00
2020-12-16 01:01:41 -06:00
< h3 class = "page-heading" > MS SQL connection< / h3 >
2017-12-02 05:40:12 -06:00
< div class = "gf-form-group" >
< div class = "gf-form max-width-30" >
< span class = "gf-form-label width-7" > Host< / span >
2020-12-16 01:01:41 -06:00
< input type = "text" class = "gf-form-input" style = "width: 352px" ng-model = 'ctrl.current.url' placeholder = "localhost:1433" bs-typeahead = "{{['localhost', 'localhost:1433']}}" required > < / input >
2017-12-02 05:40:12 -06:00
< / div >
< div class = "gf-form max-width-30" >
< span class = "gf-form-label width-7" > Database< / span >
2020-12-16 01:01:41 -06:00
< input type = "text" class = "gf-form-input" style = "width: 352px" ng-model = 'ctrl.current.database' placeholder = "database name" required > < / input >
2017-12-02 05:40:12 -06:00
< / div >
< div class = "gf-form-inline" >
< div class = "gf-form max-width-15" >
< span class = "gf-form-label width-7" > User< / span >
< input type = "text" class = "gf-form-input" ng-model = 'ctrl.current.user' placeholder = "user" > < / input >
< / div >
2019-03-19 07:38:54 -05:00
< div class = "gf-form" >
< secret-form-field
isConfigured="ctrl.current.secureJsonFields.password"
value="ctrl.current.secureJsonData.password"
on-reset="ctrl.onPasswordReset"
on-change="ctrl.onPasswordChange"
2020-12-16 01:01:41 -06:00
labelWidth="7"
inputWidth="7"
2019-03-19 07:38:54 -05:00
/>
< / div >
2017-12-02 05:40:12 -06:00
< / div >
2018-10-15 12:41:46 -05:00
< div class = "gf-form" >
< label class = "gf-form-label width-7" > Encrypt< / label >
< div class = "gf-form-select-wrapper max-width-15 gf-form-select-wrapper--has-help-icon" >
2018-10-15 19:40:40 -05:00
< 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 >
2018-10-15 12:41:46 -05:00
< info-popover mode = "right-absolute" >
Determines whether or to which extent a secure SSL TCP/IP connection will be negotiated with the server.
< ul >
< li > < i > disable< / i > - Data sent between client and server is not encrypted.< / li >
< li > < i > false< / i > - Data sent between client and server is not encrypted beyond the login packet. (default)< / li >
< li > < i > true< / i > - Data sent between client and server is encrypted.< / li >
< / ul >
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.
< / info-popover >
< / div >
< / div >
2017-12-02 05:40:12 -06:00
< / div >
2020-12-15 10:17:21 -06:00
< h3 class = "page-heading" > Connection limits< / h3 >
2018-10-02 10:43:15 -05:00
2018-09-24 07:35:13 -05:00
< div class = "gf-form-group" >
2018-10-02 10:43:15 -05:00
< div class = "gf-form max-width-15" >
< span class = "gf-form-label width-7" > Max open< / span >
2019-03-06 07:45:13 -06:00
< input type = "number" min = "0" class = "gf-form-input gf-form-input--has-help-icon" ng-model = "ctrl.current.jsonData.maxOpenConns" placeholder = "unlimited" > < / input >
2018-10-02 10:43:15 -05:00
< info-popover mode = "right-absolute" >
The maximum number of open connections to the database. If < i > Max idle connections< / i > is greater than 0 and the
< i > Max open connections< / i > is less than < i > Max idle connections< / i > , then < i > Max idle connections< / i > will be
reduced to match the < i > Max open connections< / i > limit. If set to 0, there is no limit on the number of open
connections.
< / info-popover >
< / div >
< div class = "gf-form max-width-15" >
< span class = "gf-form-label width-7" > Max idle< / span >
2019-03-06 07:45:13 -06:00
< input type = "number" min = "0" class = "gf-form-input gf-form-input--has-help-icon" ng-model = "ctrl.current.jsonData.maxIdleConns" placeholder = "2" > < / input >
2018-10-02 10:43:15 -05:00
< info-popover mode = "right-absolute" >
The maximum number of connections in the idle connection pool. If < i > Max open connections< / i > is greater than 0 but
less than the < i > Max idle connections< / i > , then the < i > Max idle connections< / i > will be reduced to match the
< i > Max open connections< / i > limit. If set to 0, no idle connections are retained.
< / info-popover >
< / div >
< div class = "gf-form max-width-15" >
< span class = "gf-form-label width-7" > Max lifetime< / span >
2019-03-06 07:45:13 -06:00
< input type = "number" min = "0" class = "gf-form-input gf-form-input--has-help-icon" ng-model = "ctrl.current.jsonData.connMaxLifetime" placeholder = "14400" > < / input >
2018-10-02 10:43:15 -05:00
< info-popover mode = "right-absolute" >
The maximum amount of time in seconds a connection may be reused. If set to 0, connections are reused forever.
< / info-popover >
< / div >
2018-09-24 07:35:13 -05:00
< / div >
2020-12-15 10:17:21 -06:00
< h3 class = "page-heading" > MS SQL details< / h3 >
2018-09-05 05:02:57 -05:00
< div class = "gf-form-group" >
< div class = "gf-form-inline" >
< div class = "gf-form" >
< span class = "gf-form-label width-9" > Min time interval< / span >
2019-05-02 04:02:01 -05:00
< input
type="text"
class="gf-form-input width-6 gf-form-input--has-help-icon"
ng-model="ctrl.current.jsonData.timeInterval"
spellcheck='false'
placeholder="1m"
2019-08-29 02:36:10 -05:00
ng-pattern="/^\d+(ms|[Mwdhmsy])$/"
2019-05-02 04:02:01 -05:00
>< / input >
2018-09-05 05:02:57 -05:00
< info-popover mode = "right-absolute" >
A lower limit for the auto group by time interval. Recommended to be set to write frequency,
for example < code > 1m< / code > if your data is written every minute.
< / info-popover >
< / div >
< / div >
< / div >
2017-12-02 05:40:12 -06:00
< div class = "gf-form-group" >
< div class = "grafana-info-box" >
< h5 > User Permission< / h5 >
< p >
2020-12-15 10:17:21 -06:00
The database user should only be granted SELECT permissions on the specified database and tables you want to query.
2017-12-02 05:40:12 -06:00
Grafana does not validate that queries are safe so queries can contain any SQL statement. For example, statements
like < code > USE otherdb;< / code > and < code > DROP TABLE user;< / code > would be executed. To protect against this we
2020-12-15 10:17:21 -06:00
< emphasis > highly< / emphasis > recommmend you create a specific MS SQL user with restricted permissions.
2017-12-02 05:40:12 -06:00
< / p >
< / div >
< / div >