Ad Widget

Collapse

Cannot setup MSSQL Plugin to collect data from remote SQL servers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zaynelov
    Junior Member
    • Jul 2023
    • 4

    #1

    Cannot setup MSSQL Plugin to collect data from remote SQL servers

    Hi,

    I have several Microsoft SQL servers. I found that mssql plugin with agent2 has the ability to collect data from multiple remote hosts. This setup suits me well because there is no need to install stuff on multiple machines. So I wanted to setup only the agent2 located on the zabbix server itself to collect the data. Here are the steps I performed:

    1) installed agent2 on the zabbix server (upgraded from the old agent)
    2) installed mssql plugin from the debian repository (Debian 12)
    3) setup username/password on SQLQ server with the appropriate rights to collect data (info from several data sources)
    4) added Sessions data in the mssql.conf and restarted the agent

    Code:
    Plugins.MSSQL.Sessions.SQLQ.Uri=sqlserver://<SQLQIP>:1433
    Plugins.MSSQL.Sessions.SQLQ.User=zbx_monitor
    Plugins.MSSQL.Sessions.SQLQ.Password=<REDACTED>
    5) imported template_db_mssql_agent2.yaml template to the zabbix server

    6) I am not quite sure for this step but I added "MSSQL by Zabbix agent 2" to the SQLQ host and it does not work with the following error:

    Code:
    2319376:20240806:214355.503 item "SQLQ:mssql.availability.group.get["{$MSSQL.URI}","{$MSSQL.USER}","{$MSSQL.PASSWORD}"]" became not supported: Unsupported item key.
    2319368:20240806:214358.506 discovery rule "SQLQ:mssql.database.discovery" became not supported: Unsupported item key.
    2319376:20240806:214358.507 item "SQLQ:mssql.db.get["{$MSSQL.URI}","{$MSSQL.USER}","{$MSSQL.PASSWORD}"]" became not supported: Unsupported item key.
    2319367:20240806:214359.503 discovery rule "SQLQ:mssql.job.discovery" became not supported: Unsupported item key.
    2319376:20240806:214359.504 item "SQLQ:mssql.job.status.get["{$MSSQL.URI}","{$MSSQL.USER}","{$MSSQL.PASSWORD}"]" became not supported: Unsupported item key.
    2319376:20240806:214400.501 item "SQLQ:mssql.last.backup.get["{$MSSQL.URI}","{$MSSQL.USER}","{$MSSQL.PASSWORD}"]" became not supported: Unsupported item key.
    2319376:20240806:214400.501 item "SQLQ:mssql.perfcounter.get["{$MSSQL.URI}","{$MSSQL.USER}","{$MSSQL.PASSWORD}"]" became not supported: Unsupported item key.
    2319376:20240806:214400.501 item "SQLQ:mssql.access_methods.raw" became not supported: Unsupported item key.
    2319376:20240806:214400.502 item "SQLQ:mssql.buffer_manager.raw" became not supported: Unsupported item key.
    2319376:20240806:214400.502 item "SQLQ:mssql.cache_info.raw" became not supported: Unsupported item key.
    2319376:20240806:214400.502 item "SQLQ:mssql.db_info.raw" became not supported: Unsupported item key.
    2319376:20240806:214400.502 item "SQLQ:mssql.general_statistics.raw" became not supported: Unsupported item key.
    2319376:20240806:214400.502 item "SQLQ:mssql.latches_info.raw" became not supported: Unsupported item key.
    2319376:20240806:214400.502 item "SQLQ:mssql.locks_info.raw" became not supported: Unsupported item key.
    ​
    I also tried to add "MSSQL by Zabbix agent 2" to the zabbix host (where zabbix agent 2 is working) and it does not work with the following error:

    Code:
    2319376:20240806:220336.507 item "zabbix:mssql.local.db.get["{$MSSQL.URI}","{$MSSQL.USER}","{$MSSQL.PASSWO RD}"]" became not supported: Failed to evaluate metric parameters: invalid first parameter "URI": parse "sqlserver://<Put your URI here>": invalid character " " in host name.
    2319368:20240806:220337.501 discovery rule "zabbix:mssql.mirroring.discovery" became not supported: Failed to evaluate metric parameters: invalid first parameter "URI": parse "sqlserver://<Put your URI here>": invalid character " " in host name.
    2319376:20240806:220337.512 item "zabbix:mssql.mirroring.get["{$MSSQL.URI}","{$MSSQL.USER}","{$MSSQL.PASSWO RD}"]" became not supported: Failed to evaluate metric parameters: invalid first parameter "URI": parse "sqlserver://<Put your URI here>": invalid character " " in host name.
    2319367:20240806:220338.503 discovery rule "zabbix:mssql.non.local.db.discovery" became not supported: Failed to evaluate metric parameters: invalid first parameter "URI": parse "sqlserver://<Put your URI here>": invalid character " " in host name.
    2319376:20240806:220338.505 item "zabbix:mssql.nonlocal.db.get["{$MSSQL.URI}","{$MSSQL.USER}","{$MSSQL.PASSWO RD}"]" became not supported: Failed to evaluate metric parameters: invalid first parameter "URI": parse "sqlserver://<Put your URI here>": invalid character " " in host name.
    2319368:20240806:220342.502 discovery rule "zabbix:mssql.quorum.discovery" became not supported: Failed to evaluate metric parameters: invalid first parameter "URI": parse "sqlserver://<Put your URI here>": invalid character " " in host name.
    ​I suppose that I am missing something small but I cannot manage it.

    For example how I connect the agent configuration on the zabbix server with the monitored hosts? My URI, username and password are in the configuration file.

    Any suggestions?
  • Kasiarz
    Junior Member
    • Aug 2024
    • 1

    #2
    I have the same thing

    Comment

    Working...