Ad Widget

Collapse

mssql specific queries monitoring with zabbix agent 2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amit.z
    Junior Member
    • May 2024
    • 4

    #1

    mssql specific queries monitoring with zabbix agent 2

    Hey all!

    I am trying to monitor specific queries from mssql uzing zabbix agent 2
    I installed zabbix agent 2 + mssql plugin.
    I have a zabbix user for mssql, and all the builtin queries from the template are working fine.

    I am looking for a way to monitor costume queries, but it looks like something is not configured right, or its a syntax error.

    Example for working query (builtin):
    mssql.db.get["{$MSSQL.URI}","{$MSSQL.USER}","{$MSSQL.PASSWO RD}"]


    Examples for not working queries (costume):
    mssql.query["SELECT COUNT(1) FROM MYDB.MYTABLE (nolock);"]
    mssql.query["SELECT GETDATE();"]

    I also tried to add the query in the macro:
    {$MSSQL_QUERY} > SELECT COUNT(*) FROM sys.tables

    mssql.db.get["{$MSSQL.URI}","{$MSSQL.USER}","{$MSSQL.PASSWO RD}" ,"{$MSSQL_QUERY}"]
    But it won't work.

    If someone knows the right syntax it will help me a lot!

    I am getting 2 errors:
    1. Failed to evaluate metric parameters: Too many parameters.
    2. Unknown metric mssql.query

    Thanks in advance

    Amit
  • Blevar
    Member
    • Jan 2025
    • 68

    #2
    The key you are using is not designed to run queries.
    Try referring to:


    Or - just an idea - create an item which would execute script like:
    Code:
    mysql -h <host_addres> -u <user> -p<password> -D <db_name> -e "<your_SQL_querry>"

    Comment

    Working...