Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSSQL plugin: Invalid columns at SQL 2014 #7021

Closed
biohazardxxx opened this issue Feb 13, 2020 · 1 comment · Fixed by #7144
Closed

MSSQL plugin: Invalid columns at SQL 2014 #7021

biohazardxxx opened this issue Feb 13, 2020 · 1 comment · Fixed by #7144
Labels
area/sqlserver bug unexpected problem or unintended behavior help wanted Request for community participation, code, contribution
Milestone

Comments

@biohazardxxx
Copy link

Columns 'total_cpu_usage_ms' and 'total_scheduler_delay_ms' in sys.dm_os_schedulers are only available from SQL Server 2016 on:
https://docs.microsoft.com/de-de/sql/relational-databases/system-dynamic-management-views/sys-dm-os-schedulers-transact-sql?view=sql-server-ver15
Therefore plugin generates an error on SQL 2014 and earlier. Maybe a check for version could be done and based on that query the columns or not.

Relevant telegraf.conf:

[[inputs.sqlserver]]
servers = [
"Server=localhost;Port=1433;User Id=telegraf;Password=Telegraf;app name=telegraf;log=1;",
]
query_version = 2

System info:

telegraf-1.13.3_windows_amd64.zip
SQL Server: 2014 12.0.4100.1
SQL Server collation: Latin1_General_BIN2
InfluxDB: 1.7.5

Expected behavior:

No error "Invalid column name"

Actual behavior:

2020-02-12T14:01:16Z I! Loaded inputs: sqlserver
2020-02-12T14:01:16Z I! Loaded aggregators:
2020-02-12T14:01:16Z I! Loaded processors:
2020-02-12T14:01:16Z I! Loaded outputs: influxdb
2020-02-12T14:01:16Z I! Tags enabled: host=SV000016 org=casas
2020-02-12T14:01:16Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"SV000016", Flush Interval:10s
2020-02-12T14:01:20Z I! Invalid column name 'total_cpu_usage_ms'.
2020-02-12T14:01:20Z I! Invalid column name 'total_scheduler_delay_ms'.
2020-02-12T14:01:20Z E! [inputs.sqlserver] Error in plugin: mssql: Invalid column name 'total_scheduler_delay_ms'.

@danielnelson danielnelson added area/sqlserver bug unexpected problem or unintended behavior labels Feb 14, 2020
@llmuculusll
Copy link

llmuculusll commented Feb 28, 2020

I have exactly the same problem.

telegraf-1.12.0_windows_amd64.zip
SQL Server: 2008 R2 SP3 10.50.6000.34 x64

2020-02-27T17:31:51Z I! Loaded inputs: win_perf_counters sqlserver exec exec exec
2020-02-27T17:31:51Z I! Loaded aggregators: 
2020-02-27T17:31:51Z I! Loaded processors: 
2020-02-27T17:31:51Z I! Loaded outputs: influxdb
2020-02-27T17:31:51Z I! Tags enabled: host=WIN-**** ip=**.**.**.** org=**** project=*** service=mssql
2020-02-27T17:31:51Z I! [agent] Config: Interval:20s, Quiet:false, Hostname:"WIN-****", Flush Interval:10s
2020-02-27T17:32:00Z I! Invalid column name 'total_cpu_usage_ms'.
2020-02-27T17:32:00Z I! Invalid column name 'total_scheduler_delay_ms'.
2020-02-27T17:32:00Z E! [inputs.sqlserver] Error in plugin: mssql: Invalid column name 'total_scheduler_delay_ms'.
2020-02-27T17:32:00Z I! Invalid column name 'database_id'.
2020-02-27T17:32:00Z E! [inputs.sqlserver] Error in plugin: mssql: Invalid column name 'database_id'.

@danielnelson danielnelson added the help wanted Request for community participation, code, contribution label Feb 28, 2020
@danielnelson danielnelson added this to the 1.14.0 milestone Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sqlserver bug unexpected problem or unintended behavior help wanted Request for community participation, code, contribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants