[ZBX-4638] Macros doesn't work for 'Database monitor' items Created: 2012 Feb 10  Updated: 2017 May 30  Resolved: 2012 Oct 03

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: 1.8.10, 2.0.2, 2.1.0
Fix Version/s: 2.0.4rc1, 2.1.0

Type: Problem report Priority: Major
Reporter: Pavel Timofeev Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: database, odbc, unixodbc
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

zabbix-server-1.8.10, unixODBC-2.3.1, mysql-connector-odbc-3.51.30, FreeBSD 9.0 RELEASE amd64



 Description   

Item parameters for MySQL threads:
DSN=

{HOSTNAME}
user=monitoring
password=mypasss
sql=select count from PROCESSLIST;

Zabbix log:
43244:20120210:132155.197 Failed to connect to DSN '{HOSTNAME}

' : Error: failed connection [[unixODBC][Driver Manager]Data source name not found, and no default driver specified] (0)

However, Zabbix documentation (http://www.zabbix.com/documentation/1.8/manual/config/macros) says about support macro for Items.
P.S. Zabbix documentation doen't contain any info about 'database monitor' item type. So bad.



 Comments   
Comment by Oleksii Zagorskyi [ 2012 Feb 11 ]

About "So bad" -> see ZBXNEXT-460

Actually a field "Additional parameters" for ODBC items it's not an item key, it's additional field. This field stored in the database "items.params".
So, it's closer to a feature request than to the bug.

Related item types:ssh agent, telnet agent, calculated.

Comment by Pavel Timofeev [ 2012 Feb 11 ]

It's so sad.

When I use database monitor I see:

  1. tail /tmp/zabbix_server.log
    Error in my_thread_global_end(): 1 threads didn't exit
    Error in my_thread_global_end(): 1 threads didn't exit
    Error in my_thread_global_end(): 1 threads didn't exit
    Error in my_thread_global_end(): 1 threads didn't exit
    Don't you know is it zabbix_server problem, mysql-connector-odbc or unixODBC?
Comment by Pavel Timofeev [ 2012 Feb 11 ]

Sorry my_thread_global_end() error has gone after upgrading mysql-connector-odbc to 5.1.9

Comment by Pavel Timofeev [ 2012 Feb 12 ]

> Sorry my_thread_global_end() error has gone after upgrading mysql-connector-odbc to 5.1.9
Nope, it's still here =(

Comment by Pavel Timofeev [ 2012 Feb 14 ]

http://lab4.org/wiki/Zabbix_Database_Monitor_English
'Requirements for the SQL queries' was very useful

Comment by Alexander Vladishev [ 2012 Sep 06 ]

Available in the development branch svn://svn.zabbix.com/branches/dev/ZBX-4638

Updated documentation:
http://www.zabbix.com/documentation/2.0/manual/appendix/macros/supported_by_location

Comment by Andris Mednis [ 2012 Oct 02 ]

(1) Testing with database monitor item using DSN=

{HOSTNAME} causes crash, while DSN=localhost does not crash:
27145:20121002:182214.650 In substitute_simple_macros() data:'DSN={HOSTNAME}

user=zabbix20
password=xxxx
sql="select current_date;"'
27145:20121002:182214.650 Got signal [signal:11(SIGSEGV),reason:1,refaddr:0x10]. Crashing ...
...
27145:20121002:182214.651 === Backtrace: ===
27145:20121002:182214.653 12: ./sbin/zabbix_server(print_fatal_info+0x9e) [0x44395e]
27145:20121002:182214.653 11: ./sbin/zabbix_server() [0x442d39]
27145:20121002:182214.653 10: /lib/x86_64-linux-gnu/libc.so.6(+0x324f0) [0x7f2bb0a8b4f0]
27145:20121002:182214.653 9: /lib/x86_64-linux-gnu/libc.so.6(+0x7fc21) [0x7f2bb0ad8c21]
27145:20121002:182214.653 8: /lib/x86_64-linux-gnu/libc.so.6(__strdup+0x16) [0x7f2bb0ad8936]
27145:20121002:182214.653 7: ./sbin/zabbix_server(zbx_strdup2+0x3f) [0x445e9f]
27145:20121002:182214.653 6: ./sbin/zabbix_server(substitute_simple_macros+0x20d) [0x4598fd]
27145:20121002:182214.653 5: ./sbin/zabbix_server() [0x41818e]
27145:20121002:182214.653 4: ./sbin/zabbix_server(main_poller_loop+0x8f) [0x4197cf]

<Sasha> RESOLVED in r30476.

Comment by Andris Mednis [ 2012 Oct 05 ]

Successfully tested.

Comment by Alexander Vladishev [ 2012 Oct 05 ]

Available in pre-2.0.4 r30656 and pre-2.1.0 (trunk) r30657.

Generated at Sat Apr 27 05:50:32 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.