diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-03-20 14:04:01 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-03-20 14:04:01 +0000 |
| commit | dac53ecd0f9665e64f6e0f523de62823bf0a2090 (patch) | |
| tree | 4f66ab367ad1df6bf615aa1161e64bc0355416eb /frontends/php/include/export.inc.php | |
| parent | fdf2f4adc3931e50e59c87517613d6fac71b8d4c (diff) | |
- [DEV-122] improved "Events" screen, added "Event Details" screen (Artem)
- applied patch by scricca: added Host-profiles to export/import (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5508 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/export.inc.php')
| -rw-r--r-- | frontends/php/include/export.inc.php | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/frontends/php/include/export.inc.php b/frontends/php/include/export.inc.php index 66663fac..a86f4a5b 100644 --- a/frontends/php/include/export.inc.php +++ b/frontends/php/include/export.inc.php @@ -34,6 +34,22 @@ 'port' => '', 'status' => '') ), +// based on mod by scricca + XML_TAG_HOSTPROFILE => array( + 'attribures' => array(), + 'elements' => array( + 'devicetype' => '', + 'name' => '', + 'os' => '', + 'serialno' => '', + 'tag' => '', + 'macaddress' => '', + 'hardware' => '', + 'software' => '', + 'contact' => '', + 'location' => '', + 'notes' => '') + ), XML_TAG_ITEM => array( 'attribures' => array( 'type' => '', @@ -306,7 +322,27 @@ if(empty($xml_name)) $xml_name = $db_name; zbx_xmlwriter_write_element ($memory, $xml_name, $data[$db_name]); } - + +// based on mod by scricca + $data = DBfetch(DBselect('SELECT hp.* FROM hosts_profiles hp WHERE hp.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[$db_name])) continue; + if(empty($xml_name)) $xml_name = $db_name; + zbx_xmlwriter_write_element($memory, $xml_name, $data[$db_name]); + } + zbx_xmlwriter_end_element($memory); +//-- + if($db_groups = DBselect('select g.name from groups g, hosts_groups hg'. ' where g.groupid=hg.groupid and hg.hostid='.$hostid)) { |
