string configuration.export(object parameters)
This method allows to export configuration data as a serialized string.
(object)
Parameters defining the objects to be exported and the format to use.
Parameter | Type | Description |
---|---|---|
format (required) |
string | Format in which the data must be exported. Possible values: json - JSON;xml - XML. |
options (required) |
object | Objects to be exported. The options object has the following parameters:groups - (array) IDs of host groups to export;hosts - (array) IDs of hosts to export;images - (array) IDs of images to export;maps - (array) IDs of maps to export.screens - (array) IDs of screens to export;templates - (array) IDs of templates to export;valueMaps - (array) IDs of value maps to export; |
(string)
Returns a serialized string containing the requested configuration data.
Export the configuration of template "10571" as an XML string.
Request:
{
"jsonrpc": "2.0",
"method": "configuration.export",
"params": {
"options": {
"templates": [
"10571"
]
},
"format": "xml"
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<zabbix_export><version>4.0</version><date>2020-01-01T12:00:00Z</date><groups><group><name>Templates</name></group></groups><templates><template><template>New template</template><name>New template</name><description/><groups><group><name>Templates</name></group></groups><applications><application><name>Apache</name></application><application><name>CPU</name></application><application><name>Zabbix server</name></application></applications><items><item><name>Zabbix agent ping</name><type>0</type><snmp_community/><snmp_oid/><key>agent.ping</key><delay>1m</delay><history>90d</history><trends>365d</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><params/><ipmi_sensor/><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>Zabbix server</name></application></applications><valuemap><name>Zabbix agent ping</name></valuemap><logtimefmt/><preprocessing/><jmx_endpoint/><timeout>3s</timeout><url/><query_fields/><posts/><status_codes>200</status_codes><follow_redirects>1</follow_redirects><post_type>0</post_type><http_proxy/><headers/><retrieve_mode>0</retrieve_mode><request_method>0</request_method><output_format>0</output_format><allow_traps>0</allow_traps><ssl_cert_file/><ssl_key_file/><ssl_key_password/><verify_peer>0</verify_peer><verify_host>0</verify_host><master_item/></item><item><name>Apache server uptime</name><type>18</type><snmp_community/><snmp_oid/><key>apache.server.uptime</key><delay>0</delay><history>90d</history><trends>0</trends><status>0</status><value_type>4</value_type><allowed_hosts/><units/><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><params/><ipmi_sensor/><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>Apache</name></application></applications><valuemap/><logtimefmt/><preprocessing><step><type>5</type><params><dt>Server uptime: (.*)</dt>\n\\1</params></step></preprocessing><jmx_endpoint/><timeout>3s</timeout><url/><query_fields/><posts/><status_codes>200</status_codes><follow_redirects>1</follow_redirects><post_type>0</post_type><http_proxy/><headers/><retrieve_mode>0</retrieve_mode><request_method>0</request_method><output_format>0</output_format><allow_traps>0</allow_traps><ssl_cert_file/><ssl_key_file/><ssl_key_password/><verify_peer>0</verify_peer><verify_host>0</verify_host><master_item><key>web.page.get[127.0.0.1/server-status]</key></master_item></item><item><name>CPU load</name><type>0</type><snmp_community/><snmp_oid/><key>system.cpu.load</key><delay>1m</delay><history>90d</history><trends>365d</trends><status>0</status><value_type>0</value_type><allowed_hosts/><units/><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><params/><ipmi_sensor/><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>CPU</name></application></applications><valuemap/><logtimefmt/><preprocessing/><jmx_endpoint/><timeout>3s</timeout><url/><query_fields/><posts/><status_codes>200</status_codes><follow_redirects>1</follow_redirects><post_type>0</post_type><http_proxy/><headers/><retrieve_mode>0</retrieve_mode><request_method>0</request_method><output_format>0</output_format><allow_traps>0</allow_traps><ssl_cert_file/><ssl_key_file/><ssl_key_password/><verify_peer>0</verify_peer><verify_host>0</verify_host><master_item/></item><item><name>Apache server status</name><type>0</type><snmp_community/><snmp_oid/><key>web.page.get[127.0.0.1/server-status]</key><delay>1m</delay><history>90d</history><trends>0</trends><status>0</status><value_type>4</value_type><allowed_hosts/><units/><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><params/><ipmi_sensor/><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>Apache</name></application></applications><valuemap/><logtimefmt/><preprocessing/><jmx_endpoint/><timeout>3s</timeout><url/><query_fields/><posts/><status_codes>200</status_codes><follow_redirects>1</follow_redirects><post_type>0</post_type><http_proxy/><headers/><retrieve_mode>0</retrieve_mode><request_method>0</request_method><output_format>0</output_format><allow_traps>0</allow_traps><ssl_cert_file/><ssl_key_file/><ssl_key_password/><verify_peer>0</verify_peer><verify_host>0</verify_host><master_item/></item></items><discovery_rules/><httptests/><macros/><templates/><screens/></template></templates><triggers><trigger><expression>{New template:system.cpu.load.avg(3m)}>2</expression><recovery_mode>0</recovery_mode><recovery_expression/><name>CPU load too high on 'New host' for 3 minutes</name><correlation_mode>0</correlation_mode><correlation_tag/><url/><status>0</status><priority>2</priority><description/><type>0</type><manual_close>0</manual_close><dependencies/><tags/></trigger></triggers><value_maps><value_map><name>Zabbix agent ping</name><mappings><mapping><value>0</value><newvalue>Not available</newvalue></mapping><mapping><value>1</value><newvalue>Available</newvalue></mapping></mappings></value_map></value_maps></zabbix_export>\n",
"id": 1
}
CConfiguration::export() in frontends/php/include/classes/api/services/CConfiguration.php.