So like the title says:
Works and gives a 1 as response, changing a value in the macro to an incorrect one results in output 0.
In the MSSQL.conf beside the system.path i have also set the CustomQueriesDir paramater.
And that is all i have in the conf file.
A file with the MyCquery.sql extension contains the following query
Nothing special but the scenario is that during a software install of the product I want to monitor the database name i flexibel so i want to use a host macro to set this up.
In the following code block are the item keys i tried but all fail with the same message:
{$DBNAME} = TheDBname.table.dbo.name
The first few alo
The error: Failed to execute handler: failed to execute handler: failed to query: mssql: Must declare the table variable "@p1".
The query's work fine with database.table.dbo.name when running it with the same user credentials in SQL Management Studio
In the Zabbix agent log I see
Code:
mssql.ping[sqlserver://{$1DBSERVER}:{$1DBPORT},{$1MSSQL_USER},{$1MSSQL_PASSWORD}]
In the MSSQL.conf beside the system.path i have also set the CustomQueriesDir paramater.
And that is all i have in the conf file.
A file with the MyCquery.sql extension contains the following query
Code:
SELECT [Application], [Hostname], [Status] FROM @p1
In the following code block are the item keys i tried but all fail with the same message:
{$DBNAME} = TheDBname.table.dbo.name
Code:
mssql.custom.query[sqlserver://{$1DBSERVER}:{$1DBPORT},{$1MSSQL_USER},{$1MSSQL_PASSWORD},MyCquery,TheDBname.table.dbo.name]
mssql.custom.query[sqlserver://{$1DBSERVER}:{$1DBPORT},{$1MSSQL_USER},{$1MSSQL_PASSWORD},MyCquery,'TheDBname.table.dbo.name']
mssql.custom.query[sqlserver://{$1DBSERVER}:{$1DBPORT},{$1MSSQL_USER},{$1MSSQL_PASSWORD},MyCquery,"TheDBname.table.dbo.name"]
mssql.custom.query[sqlserver://{$1DBSERVER}:{$1DBPORT},{$1MSSQL_USER},{$1MSSQL_PASSWORD},MyCquery,{$DBNAME}]
The error: Failed to execute handler: failed to execute handler: failed to query: mssql: Must declare the table variable "@p1".
The query's work fine with database.table.dbo.name when running it with the same user credentials in SQL Management Studio
In the Zabbix agent log I see
[MSSQL] Creating new connection to "sqlserver://my-db-server", with user "zabbix" to database "", with CA certificate "", trust server certificate "", host name in certificate "" encrypt "", TLS min version ""
Comment