--- /var/www/zabbix/include/export.inc.php 2008-02-19 16:37:42.000000000 +0100 +++ /root/export.inc.php 2008-02-29 11:02:29.000000000 +0100 @@ -34,6 +34,23 @@ 'port' => '', 'status' => '') ), +// mod by scricca + XML_TAG_HOSTPROFILE => array( + 'attribures' => array(), + 'elements' => array( + 'p_devicetype' => '', + 'p_name' => '', + 'p_os' => '', + 'p_serialno' => '', + 'p_tag' => '', + 'p_macaddress' => '', + 'p_hardware' => '', + 'p_software' => '', + 'p_contact' => '', + 'p_location' => '', + 'p_notes' => '') + ), +// mod by scricca XML_TAG_ITEM => array( 'attribures' => array( 'type' => '', @@ -300,6 +317,27 @@ if(empty($xml_name)) $xml_name = $db_name; zbx_xmlwriter_write_element ($memory, $xml_name, $data[$db_name]); } + // mod by scricca + $data = DBfetch(DBselect('select * from hosts_profiles where hostid='.$hostid)); + if(!$data) return false; + + zbx_xmlwriter_start_element ($memory,XML_TAG_HOSTPROFILE); + + $map =& $ZBX_EXPORT_MAP[XML_TAG_HOSTPROFILE]; + + foreach($map['attribures'] as $db_name => $xml_name) + { + if(empty($xml_name)) $xml_name = $db_name; + zbx_xmlwriter_write_attribute($memory, $xml_name, $data[$db_name]); + } + foreach($map['elements'] as $db_name => $xml_name) + { + if(empty($data[substr($db_name,2)])) continue; + if(empty($xml_name)) $xml_name = $db_name; + zbx_xmlwriter_write_element ($memory, $xml_name, $data[substr($db_name,2)]); + } + zbx_xmlwriter_end_element($memory); + // end mod by scricca if($db_groups = DBselect('select g.name from groups g, hosts_groups hg'. ' where g.groupid=hg.groupid and hg.hostid='.$hostid))