new script and template
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import requests
|
||||||
|
import json
|
||||||
|
|
||||||
|
bitcoin_api_url = 'https://api.coinmarketcap.com/v1/ticker/'
|
||||||
|
r = requests.get(bitcoin_api_url)
|
||||||
|
report = r.json()
|
||||||
|
json_encoded = json.dumps(report)
|
||||||
|
print(json_encoded)
|
||||||
@@ -0,0 +1,356 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<zabbix_export>
|
||||||
|
<version>4.2</version>
|
||||||
|
<date>2019-06-14T08:30:45Z</date>
|
||||||
|
<groups>
|
||||||
|
<group>
|
||||||
|
<name>Templates/Applications</name>
|
||||||
|
</group>
|
||||||
|
</groups>
|
||||||
|
<templates>
|
||||||
|
<template>
|
||||||
|
<template>Information</template>
|
||||||
|
<name>Information</name>
|
||||||
|
<description/>
|
||||||
|
<groups>
|
||||||
|
<group>
|
||||||
|
<name>Templates/Applications</name>
|
||||||
|
</group>
|
||||||
|
</groups>
|
||||||
|
<applications>
|
||||||
|
<application>
|
||||||
|
<name>Courses</name>
|
||||||
|
</application>
|
||||||
|
</applications>
|
||||||
|
<items>
|
||||||
|
<item>
|
||||||
|
<name>Coins</name>
|
||||||
|
<type>10</type>
|
||||||
|
<snmp_community/>
|
||||||
|
<snmp_oid/>
|
||||||
|
<key>Coins</key>
|
||||||
|
<delay>10m</delay>
|
||||||
|
<history>1d</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>Courses</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>BTC</name>
|
||||||
|
<type>18</type>
|
||||||
|
<snmp_community/>
|
||||||
|
<snmp_oid/>
|
||||||
|
<key>course.bitcoin</key>
|
||||||
|
<delay>0</delay>
|
||||||
|
<history>30d</history>
|
||||||
|
<trends>30d</trends>
|
||||||
|
<status>0</status>
|
||||||
|
<value_type>0</value_type>
|
||||||
|
<allowed_hosts/>
|
||||||
|
<units>$</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>Courses</name>
|
||||||
|
</application>
|
||||||
|
</applications>
|
||||||
|
<valuemap/>
|
||||||
|
<logtimefmt/>
|
||||||
|
<preprocessing>
|
||||||
|
<step>
|
||||||
|
<type>12</type>
|
||||||
|
<params>$[0]['price_usd']</params>
|
||||||
|
<error_handler>0</error_handler>
|
||||||
|
<error_handler_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>Coins</key>
|
||||||
|
</master_item>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<name>ETH</name>
|
||||||
|
<type>18</type>
|
||||||
|
<snmp_community/>
|
||||||
|
<snmp_oid/>
|
||||||
|
<key>course.ethereum</key>
|
||||||
|
<delay>0</delay>
|
||||||
|
<history>30d</history>
|
||||||
|
<trends>30d</trends>
|
||||||
|
<status>0</status>
|
||||||
|
<value_type>0</value_type>
|
||||||
|
<allowed_hosts/>
|
||||||
|
<units>$</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>Courses</name>
|
||||||
|
</application>
|
||||||
|
</applications>
|
||||||
|
<valuemap/>
|
||||||
|
<logtimefmt/>
|
||||||
|
<preprocessing>
|
||||||
|
<step>
|
||||||
|
<type>12</type>
|
||||||
|
<params>$[1]['price_usd']</params>
|
||||||
|
<error_handler>0</error_handler>
|
||||||
|
<error_handler_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>Coins</key>
|
||||||
|
</master_item>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<name>LTC</name>
|
||||||
|
<type>18</type>
|
||||||
|
<snmp_community/>
|
||||||
|
<snmp_oid/>
|
||||||
|
<key>course.litecoin</key>
|
||||||
|
<delay>0</delay>
|
||||||
|
<history>30d</history>
|
||||||
|
<trends>30d</trends>
|
||||||
|
<status>0</status>
|
||||||
|
<value_type>0</value_type>
|
||||||
|
<allowed_hosts/>
|
||||||
|
<units>$</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>Courses</name>
|
||||||
|
</application>
|
||||||
|
</applications>
|
||||||
|
<valuemap/>
|
||||||
|
<logtimefmt/>
|
||||||
|
<preprocessing>
|
||||||
|
<step>
|
||||||
|
<type>12</type>
|
||||||
|
<params>$[3]['price_usd']</params>
|
||||||
|
<error_handler>0</error_handler>
|
||||||
|
<error_handler_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>Coins</key>
|
||||||
|
</master_item>
|
||||||
|
</item>
|
||||||
|
</items>
|
||||||
|
<discovery_rules/>
|
||||||
|
<httptests/>
|
||||||
|
<macros/>
|
||||||
|
<templates/>
|
||||||
|
<screens/>
|
||||||
|
<tags/>
|
||||||
|
</template>
|
||||||
|
</templates>
|
||||||
|
<graphs>
|
||||||
|
<graph>
|
||||||
|
<name>Coins</name>
|
||||||
|
<width>900</width>
|
||||||
|
<height>200</height>
|
||||||
|
<yaxismin>0.0000</yaxismin>
|
||||||
|
<yaxismax>100.0000</yaxismax>
|
||||||
|
<show_work_period>1</show_work_period>
|
||||||
|
<show_triggers>0</show_triggers>
|
||||||
|
<type>0</type>
|
||||||
|
<show_legend>1</show_legend>
|
||||||
|
<show_3d>0</show_3d>
|
||||||
|
<percent_left>0.0000</percent_left>
|
||||||
|
<percent_right>0.0000</percent_right>
|
||||||
|
<ymin_type_1>0</ymin_type_1>
|
||||||
|
<ymax_type_1>0</ymax_type_1>
|
||||||
|
<ymin_item_1>0</ymin_item_1>
|
||||||
|
<ymax_item_1>0</ymax_item_1>
|
||||||
|
<graph_items>
|
||||||
|
<graph_item>
|
||||||
|
<sortorder>0</sortorder>
|
||||||
|
<drawtype>0</drawtype>
|
||||||
|
<color>4000FF</color>
|
||||||
|
<yaxisside>0</yaxisside>
|
||||||
|
<calc_fnc>2</calc_fnc>
|
||||||
|
<type>0</type>
|
||||||
|
<item>
|
||||||
|
<host>Information</host>
|
||||||
|
<key>course.bitcoin</key>
|
||||||
|
</item>
|
||||||
|
</graph_item>
|
||||||
|
<graph_item>
|
||||||
|
<sortorder>1</sortorder>
|
||||||
|
<drawtype>0</drawtype>
|
||||||
|
<color>FFFF00</color>
|
||||||
|
<yaxisside>0</yaxisside>
|
||||||
|
<calc_fnc>2</calc_fnc>
|
||||||
|
<type>0</type>
|
||||||
|
<item>
|
||||||
|
<host>Information</host>
|
||||||
|
<key>course.ethereum</key>
|
||||||
|
</item>
|
||||||
|
</graph_item>
|
||||||
|
<graph_item>
|
||||||
|
<sortorder>2</sortorder>
|
||||||
|
<drawtype>0</drawtype>
|
||||||
|
<color>F7941D</color>
|
||||||
|
<yaxisside>0</yaxisside>
|
||||||
|
<calc_fnc>2</calc_fnc>
|
||||||
|
<type>0</type>
|
||||||
|
<item>
|
||||||
|
<host>Information</host>
|
||||||
|
<key>course.litecoin</key>
|
||||||
|
</item>
|
||||||
|
</graph_item>
|
||||||
|
</graph_items>
|
||||||
|
</graph>
|
||||||
|
</graphs>
|
||||||
|
</zabbix_export>
|
||||||
Reference in New Issue
Block a user