I have a custom .net c# executable that I created and it uses command line switches to retrieve different metric values from MSSQL and sends them back to PRTG. I use this to monitor my production MSSQL db performance. It all works well on my test server and returns valid values with valid exit codes. It all works well on my production server as well.
There is only one value that it does not work with in production and PRTG complains that the value for for the variable is too large and it can not handle it... Error is as follows:
Protocol Error: Value was either too large or too small for an Int32. at System.Convert.ToInt32(Int64 value) at System.Int64.System.IConvertible.ToInt32(IFormatProvider provider) at System.Convert.ToInt32(Object value) at SQLmetrics.SQL.SQLquery(String a (code: PE023)
As far as I know PRTG can only handle Long(float) and int32, anything else is a no no. I tried 64 as well and it doesn't handle that well either. Anyone know of a solution to get around this?
Article Comments
One addition regarding "As far as I know PRTG can only handle Long(float) and int32, anything else is a no no": Devs told me that PRTG calculates internally using Int64, so we assume the error is in the script itself somewhere. It should not happen when you use for example the aforementioned SQL sensor.
Kind regards,
Erhard
Aug, 2017 - Permalink
Erhard, Yes the problem is with PRTG, because it can not accept anything larger than 32 bit. This is not an issue in my test environment and the script reports the right values. My database is enormous and even working with 64bit inside the script PRTG complains about the intiger being 64 and not 32. So while PRTG may internally be working with 64 bit intigers, it will not accept these values from the script. I will try the SQL v2 sensor.
Aug, 2017 - Permalink
Hello there,
Have you tried achieving the same with our MS SQL V2 sensor? Give it a try and see how that goes.
See also: Configuration of SQL v2 Sensors.
Kind regards,
Erhard
Aug, 2017 - Permalink