Ad Widget

Collapse

Issues with MS SQL monitoring - https://github.com/sfuerte/zbx-mssql

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Issues with MS SQL monitoring - https://github.com/sfuerte/zbx-mssql

    Hi All,

    I am using https://github.com/sfuerte/zbx-mssql and running into a few issues.

    Zabbix Server: 4.2.1
    Zabbix Agent: 4.2.1
    Windows Server 2008
    SQL 2008

    The PowerShell script keeps on returning some errors:

    ```
    Exception calling "Open" with "0" argument(s): "A network-related or instance-specific error occurred while establishin
    g a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct
    and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 25 - Connectio
    n string is not valid)"
    At C:\Program Files\Zabbix Agent\scripts\mssql_basename.ps1:44 char:21
    + $connection.Open <<<< ()
    + CategoryInfo : NotSpecified: ( [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

    Exception calling "Fill" with "1" argument(s): "A network-related or instance-specific error occurred while establishin
    g a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct
    and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 25 - Connectio
    n string is not valid)"
    At C:\Program Files\Zabbix Agent\scripts\mssql_basename.ps1:53 char:21
    + $SqlAdapter.Fill <<<< ($DataSet) > $null
    + CategoryInfo : NotSpecified: ( [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException
    ```

    If I replace "$SQLServer" on line 40 in the mssql_basename.ps1 script with the actual server name, it returns some DB names. So I presume the DB access is fine.

    Also trying to get the ODBC connector working because Powershell didn't...

    I get an "Cannot execute ODBC query: [SQL_ERROR]:[42000][156][[FreeTDS][SQL Server]Incorrect syntax near the keyword 'FROM'.]" error when running the query "select '{"data":[', (SELECT STUFF((SELECT ',' + '{"{#DBNAME}":"' + [Name] + '"}' + FROM master..sysdatabases ORDER BY [Name] FOR XML PATH('')), 1, 1, '')) ,']}' FOR XML PATH('')"

    Any help? Or another way to monitor SQL 2008 from Zabbix 4.2.1?
Working...
X