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

Case problem in SQL ServerPlugin script #1702

Closed
scott53326 opened this issue Sep 2, 2016 · 8 comments
Closed

Case problem in SQL ServerPlugin script #1702

scott53326 opened this issue Sep 2, 2016 · 8 comments
Labels
bug unexpected problem or unintended behavior

Comments

@scott53326
Copy link

scott53326 commented Sep 2, 2016

I'm not a developer (nor DBA), so I could be way off here, but it appears that the sql server plugin has an issue with SQL Server instances that have a collation that is set to cases sensitive in the sqlserver.go script.

the baselineDate and currentlineDate column are originally being set as:

GETDATE() AS baselineDate
GETDATE() AS currentlineDate

but then later on are used as:
(DATEDIFF(SECOND,baseLineDate,currentLineDate)) <-- with Capitalization of the "L"'s for both.

This produces the following errors when running telegraf with the sqlserver plugin input enabled on A SQL instance that's collation is set to a case sensitive type:

2016/09/02 10:12:13 Invalid column name 'baseLineDate'.
2016/09/02 10:12:13 Invalid column name 'currentLineDate'.
2016/09/02 10:12:13 Invalid column name 'baseLineDate'.
2016/09/02 10:12:13 Invalid column name 'currentLineDate'.
2016/09/02 10:12:13 Invalid column name 'baseLineDate'.
2016/09/02 10:12:13 Invalid column name 'currentLineDate'.
2016/09/02 10:12:13 Invalid column name 'baseLineDate'.
2016/09/02 10:12:13 Invalid column name 'currentLineDate'.
2016/09/02 10:12:13 mssql: Invalid column name 'currentLineDate'.

I am using the latest windows telegraf client.

Thanks,
-Scott

@sparrc
Copy link
Contributor

sparrc commented Sep 2, 2016

by "latest" which version do you mean? 0.13 or 1.0rc?

cc @StianOvrevage @zensqlmonitor

@scott53326
Copy link
Author

Sorry, I meant telegraf-1.0.0-rc1_windows_amd64.zip from the download page.

-Scott

@zensqlmonitor
Copy link
Contributor

It is just a problem of collation, not related to any telegraf version.
The case sensitive collation is quite rare :-)
I will update the code soon.

@scott53326
Copy link
Author

Thanks,

Yeah this SQL Server is used for an ERP System. So case sensitive collation is required for this software.

@sparrc sparrc added the bug unexpected problem or unintended behavior label Sep 9, 2016
@sparrc
Copy link
Contributor

sparrc commented Sep 28, 2016

fixed by #1748

@sparrc sparrc closed this as completed Sep 28, 2016
@sparrc sparrc mentioned this issue Sep 28, 2016
3 tasks
@biohazardxxx
Copy link

Hi, this appears again for me with the latest Telegraf version telegraf-1.13.3_windows_amd64.zip.
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=SOMeName org=some
2020-02-12T14:01:16Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"SOMeName", 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
Copy link
Contributor

@biohazardxxx Can you open a new issue, please make sure to include your plugin configuration and server version.

@biohazardxxx
Copy link

done #7021
Actually the problem is caused by the columns not existing in older SQL Server versions. Just as reference for future readers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

5 participants