Ad Widget

Collapse

Help getting SQL Query for Item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamesaphaigh
    Junior Member
    • Dec 2025
    • 1

    #1

    Help getting SQL Query for Item

    I'd be really grateful for some assistance as I think I've hit a dead end and what I though would be a 'relatively' simple task.

    We run an osTicket helpdesk (in a MariaDB database) and I wanted to get the current ticket counts (open, pending etc.) to display on our zabbix dashboard. Simple, I thought, as I already have the SQL query as it displays on our PowerBI KPI board. However, I feel as though my zabbix or linux skill may be hampering me here.

    Zabbix Environment:
    zabbix 7.4.6
    alma 9

    osTicket Environment:
    Windows 2022
    MariaDB 10.11

    Work completed so far:
    • Installed MariaDB ODBC driver (3.1) on zabbix server
    • edited odbc.ini and odbcinst.ini
    • confirmed connection to MariaDB via command
      Code:
      isql MariaDB
    • confirmed SQL query returns data
    • added item to osTicket host as 'Database monitor' with the key 'db.odbc.get[Tickets,MariaDB,]'
    However I get the error:

    Cannot connect to ODBC DSN: [SQL_ERROR]:[HY000][2002][[unixODBC][ma-3.1.22]Can't connect to server on 'osTicket Server' (13)]

    Searches suggest that its a permissions issue, however as the isql command works, I don't think it can be a server to server issue. My current thinking is that the user the zabbix-server is using, may not have permission to access the DSN, but when I manually try to call the driver in the 'key' I get the same issue.

    Can anyone point me in the right direction?

    Thanks
  • Viktors Fomics
    Member
    • Oct 2025
    • 42

    #2
    Hello

    The "Can't connect to server on 'osTicket Server' (13)" is very likely related to SELinux, should be a good idea to test if it works with SELinux set to permissive mode temporarily (sudo setenforce 0).

    Comment

    Working...