Ad Widget

Collapse

BUGFIX: Zabbix server DBping error on oracle

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shmuma
    Member
    • Nov 2007
    • 49

    #1

    BUGFIX: Zabbix server DBping error on oracle

    Hello,

    when we use oracle database, watchdog process always terminated at zabbix_server startup. This caused by 1 DB connection restriction used when we initialize libsqlora8: sqlo_init(SQLO_OFF, 1, 100) in zbx_db_connect.

    In this code:
    Code:
    void main_watchdog_loop()
    {
    	/* Disable writing to database in zabbix_syslog() */
    	CONFIG_ENABLE_LOG = 0;
    
    	DBconnect(ZBX_DB_CONNECT_NORMAL);
    	init_config();
    
    	for(;;)
    	{
    		ping_database();
    		sleep(60);
    	}
    	/* We will never reach this point */
    	DBclose();
    }
    We always hold one connection opened before init_config call, and trying to open new connection in ping_database. So, it's better to close first connection because we don't need it after init_config:
    Code:
    void main_watchdog_loop()
    {
    	/* Disable writing to database in zabbix_syslog() */
    	CONFIG_ENABLE_LOG = 0;
    
    	DBconnect(ZBX_DB_CONNECT_NORMAL);
    	init_config();
    	DBclose();
    
    	for(;;)
    	{
    		ping_database();
    		sleep(60);
    	}
    	/* We will never reach this point */
    }
    Patch against 1.4.4 attached to this message.
    Attached Files
Working...