Ad Widget

Collapse

Problems with importing host & proxy with same name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Emir Imamagic
    Member
    • Mar 2008
    • 67

    #1

    Problems with importing host & proxy with same name

    Hello,

    Zabbix 1.6 handles incorrectly importing in case when host and proxy with the same name exist. I believe that having host and proxy with the same name is standard situation and should be supported.

    I manually created proxy with the name A. When I imported configuration for host A, I realized that the proxy was gone. I think that this part of code from import.inc.php (line 81):
    Code:
    if($host_data = DBfetch(DBselect('SELECT hostid FROM hosts'.
                                                    ' WHERE host='.zbx_dbstr($data['name']).
                                                            ' AND '.DBin_node('hostid',get_current_nodeid(false)))))
    assumes that the host already exists and simple overruns it.

    Since importing of proxies is supported, this part code should be changed to take into account host's status. Checking if host exists should then go in the EndElement handler, since you don't have status information until then.

    Cheers,
    emir
Working...