<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
    <version>5.0</version>
    <date>2020-12-25T04:51:45Z</date>
    <groups>
        <group>
            <name>SXZ-Route</name>
        </group>
    </groups>
    <templates>
        <template>
            <template>SXZ-Router</template>
            <name>SXZ-Router</name>
            <description>神行者路由模版</description>
            <groups>
                <group>
                    <name>SXZ-Route</name>
                </group>
            </groups>
            <applications>
                <application>
                    <name>cpu-temp</name>
                </application>
                <application>
                    <name>disk-part-total</name>
                </application>
                <application>
                    <name>disk-part-used</name>
                </application>
                <application>
                    <name>sxz-eth</name>
                </application>
                <application>
                    <name>sxz-lan</name>
                </application>
                <application>
                    <name>sxz-snmptrap</name>
                </application>
                <application>
                    <name>sxz-wan</name>
                </application>
                <application>
                    <name>sxz-xwan</name>
                </application>
            </applications>
            <items>
                <item>
                    <name>CPU -Temp</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.4.1.2021.13.16.2.1.3.1</snmp_oid>
                    <key>cpu.temp</key>
                    <value_type>FLOAT</value_type>
                    <units>℃</units>
                    <applications>
                        <application>
                            <name>cpu-temp</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>MULTIPLIER</type>
                            <params>0.001</params>
                        </step>
                    </preprocessing>
                    <triggers>
                        <trigger>
                            <expression>{last(0)}&gt;75</expression>
                            <name>CPU - Temp Alarm</name>
                            <status>DISABLED</status>
                            <priority>WARNING</priority>
                        </trigger>
                    </triggers>
                </item>
                <item>
                    <name>Interface-status</name>
                    <type>SNMP_TRAP</type>
                    <key>snmptrap[&quot;Interface&quot;]</key>
                    <delay>0</delay>
                    <trends>0</trends>
                    <value_type>LOG</value_type>
                    <applications>
                        <application>
                            <name>sxz-snmptrap</name>
                        </application>
                    </applications>
                    <logtimefmt>%Y-%m-%d %H:%M:%S</logtimefmt>
                    <triggers>
                        <trigger>
                            <expression>{str(down)}=1</expression>
                            <name>接口状态</name>
                            <status>DISABLED</status>
                            <priority>HIGH</priority>
                        </trigger>
                    </triggers>
                </item>
                <item>
                    <name>sysUpTimeInstance</name>
                    <type>SNMP_TRAP</type>
                    <key>snmptrap[&quot;Service&quot;]</key>
                    <delay>0</delay>
                    <trends>0</trends>
                    <value_type>LOG</value_type>
                    <applications>
                        <application>
                            <name>sxz-snmptrap</name>
                        </application>
                    </applications>
                    <logtimefmt>%Y-%m-%d %H:%M:%S</logtimefmt>
                    <triggers>
                        <trigger>
                            <expression>{str(down)}=1</expression>
                            <name>服务状态</name>
                            <status>DISABLED</status>
                            <priority>DISASTER</priority>
                        </trigger>
                    </triggers>
                </item>
                <item>
                    <name>神行者磁盘Total</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.2.1.25.2.3.1.5.31</snmp_oid>
                    <key>sxz.disk.part.total</key>
                    <delay>5m</delay>
                    <units>Bytes</units>
                    <applications>
                        <application>
                            <name>disk-part-total</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>MULTIPLIER</type>
                            <params>4096</params>
                        </step>
                    </preprocessing>
                </item>
                <item>
                    <name>神行者磁盘used</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.2.1.25.2.3.1.6.31</snmp_oid>
                    <key>sxz.disk.part.used</key>
                    <delay>5m</delay>
                    <units>Bytes</units>
                    <applications>
                        <application>
                            <name>disk-part-used</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>MULTIPLIER</type>
                            <params>4096</params>
                        </step>
                    </preprocessing>
                </item>
            </items>
            <discovery_rules>
                <discovery_rule>
                    <name>ethernet-interface</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>discovery[{#XSID},1.3.6.1.4.1.1500.20.1.4,{#XSNAME},1.3.6.1.4.1.1500.20.1.1]</snmp_oid>
                    <key>ethernet.traffic.discovery</key>
                    <delay>5m</delay>
                    <lifetime>365d</lifetime>
                    <item_prototypes>
                        <item_prototype>
                            <name>XS{#XSID} : Bps In</name>
                            <type>SNMP_AGENT</type>
                            <snmp_oid>1.3.6.1.4.1.1500.20.1.3.{#XSID}</snmp_oid>
                            <key>ethernet-in-[{#XSNAME}]</key>
                            <units>bps</units>
                            <applications>
                                <application>
                                    <name>sxz-eth</name>
                                </application>
                            </applications>
                        </item_prototype>
                        <item_prototype>
                            <name>XS{#XSID} : Bps Out</name>
                            <type>SNMP_AGENT</type>
                            <snmp_oid>1.3.6.1.4.1.1500.20.1.2.{#XSID}</snmp_oid>
                            <key>ethernet-out-[{#XSNAME}]</key>
                            <units>bps</units>
                        </item_prototype>
                    </item_prototypes>
                    <graph_prototypes>
                        <graph_prototype>
                            <name>{#XSNAME}-traffic</name>
                            <graph_items>
                                <graph_item>
                                    <drawtype>FILLED_REGION</drawtype>
                                    <color>009900</color>
                                    <item>
                                        <host>SXZ-Router</host>
                                        <key>ethernet-in-[{#XSNAME}]</key>
                                    </item>
                                </graph_item>
                                <graph_item>
                                    <sortorder>1</sortorder>
                                    <color>0000EE</color>
                                    <item>
                                        <host>SXZ-Router</host>
                                        <key>ethernet-out-[{#XSNAME}]</key>
                                    </item>
                                </graph_item>
                            </graph_items>
                        </graph_prototype>
                    </graph_prototypes>
                </discovery_rule>
                <discovery_rule>
                    <name>lan-interface</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>discovery[{#LANID},1.3.6.1.4.1.1500.60.1.1,{#LANNAME},1.3.6.1.4.1.1500.60.1.2]</snmp_oid>
                    <key>lan.traffic.discovery</key>
                    <delay>5m</delay>
                    <lifetime>365d</lifetime>
                    <item_prototypes>
                        <item_prototype>
                            <name>Lan{#LANID} : Bps In</name>
                            <type>SNMP_AGENT</type>
                            <snmp_oid>1.3.6.1.4.1.1500.60.1.6.{#LANID}</snmp_oid>
                            <key>traffice-in-lan[{#LANID}]</key>
                            <units>bps</units>
                            <applications>
                                <application>
                                    <name>sxz-lan</name>
                                </application>
                            </applications>
                        </item_prototype>
                        <item_prototype>
                            <name>Lan{#LANID} : Bps Out</name>
                            <type>SNMP_AGENT</type>
                            <snmp_oid>1.3.6.1.4.1.1500.60.1.5.{#LANID}</snmp_oid>
                            <key>traffice-out-lan[{#LANID}]</key>
                            <applications>
                                <application>
                                    <name>sxz-lan</name>
                                </application>
                            </applications>
                        </item_prototype>
                    </item_prototypes>
                    <graph_prototypes>
                        <graph_prototype>
                            <name>{#LANNAME}-traffic</name>
                            <graph_items>
                                <graph_item>
                                    <sortorder>1</sortorder>
                                    <drawtype>FILLED_REGION</drawtype>
                                    <color>009900</color>
                                    <item>
                                        <host>SXZ-Router</host>
                                        <key>traffice-in-lan[{#LANID}]</key>
                                    </item>
                                </graph_item>
                                <graph_item>
                                    <sortorder>2</sortorder>
                                    <color>0000EE</color>
                                    <item>
                                        <host>SXZ-Router</host>
                                        <key>traffice-out-lan[{#LANID}]</key>
                                    </item>
                                </graph_item>
                            </graph_items>
                        </graph_prototype>
                    </graph_prototypes>
                </discovery_rule>
                <discovery_rule>
                    <name>wan-interface</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>discovery[{#WANID},1.3.6.1.4.1.1500.70.1.1,{#WANNAME},1.3.6.1.4.1.1500.70.1.2]</snmp_oid>
                    <key>wan.traffic.discovery</key>
                    <delay>5m</delay>
                    <lifetime>365d</lifetime>
                    <item_prototypes>
                        <item_prototype>
                            <name>Wan{#WANID} : Bps In</name>
                            <type>SNMP_AGENT</type>
                            <snmp_oid>1.3.6.1.4.1.1500.70.1.6.{#WANID}</snmp_oid>
                            <key>traffice-in-wan[{#WANID}]</key>
                            <units>bps</units>
                            <applications>
                                <application>
                                    <name>sxz-eth</name>
                                </application>
                                <application>
                                    <name>sxz-wan</name>
                                </application>
                            </applications>
                        </item_prototype>
                        <item_prototype>
                            <name>Wan{#WANID} : Bps Out</name>
                            <type>SNMP_AGENT</type>
                            <snmp_oid>1.3.6.1.4.1.1500.70.1.5.{#WANID}</snmp_oid>
                            <key>traffice-out-wan[{#WANID}]</key>
                            <units>bps</units>
                            <applications>
                                <application>
                                    <name>sxz-wan</name>
                                </application>
                            </applications>
                        </item_prototype>
                        <item_prototype>
                            <name>Wan{#WANID} : v4delay</name>
                            <type>SNMP_AGENT</type>
                            <snmp_oid>1.3.6.1.4.1.1500.70.1.7.{#WANID}</snmp_oid>
                            <key>traffice-v4delay[{#WANID}]</key>
                            <value_type>FLOAT</value_type>
                            <units>ms</units>
                            <applications>
                                <application>
                                    <name>sxz-wan</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>MULTIPLIER</type>
                                    <params>0.001</params>
                                </step>
                            </preprocessing>
                        </item_prototype>
                        <item_prototype>
                            <name>Wan{#WANID} : Connections</name>
                            <type>SNMP_AGENT</type>
                            <snmp_oid>1.3.6.1.4.1.1500.70.1.9.{#WANID}</snmp_oid>
                            <key>traffice-wburst[{#WANID}]</key>
                            <applications>
                                <application>
                                    <name>sxz-wan</name>
                                </application>
                            </applications>
                        </item_prototype>
                        <item_prototype>
                            <name>Wan{#WANID} : status</name>
                            <type>SNMP_AGENT</type>
                            <snmp_oid>1.3.6.1.4.1.1500.70.1.3.{#WANID}</snmp_oid>
                            <key>traffice-wstatus4[{#WANID}]</key>
                            <applications>
                                <application>
                                    <name>sxz-wan</name>
                                </application>
                            </applications>
                        </item_prototype>
                    </item_prototypes>
                    <graph_prototypes>
                        <graph_prototype>
                            <name>{#WANNAME}-status</name>
                            <graph_items>
                                <graph_item>
                                    <sortorder>1</sortorder>
                                    <drawtype>BOLD_LINE</drawtype>
                                    <color>1A7C11</color>
                                    <item>
                                        <host>SXZ-Router</host>
                                        <key>traffice-v4delay[{#WANID}]</key>
                                    </item>
                                </graph_item>
                                <graph_item>
                                    <sortorder>2</sortorder>
                                    <drawtype>BOLD_LINE</drawtype>
                                    <color>F63100</color>
                                    <item>
                                        <host>SXZ-Router</host>
                                        <key>traffice-wburst[{#WANID}]</key>
                                    </item>
                                </graph_item>
                                <graph_item>
                                    <sortorder>3</sortorder>
                                    <drawtype>GRADIENT_LINE</drawtype>
                                    <color>2774A4</color>
                                    <item>
                                        <host>SXZ-Router</host>
                                        <key>traffice-wstatus4[{#WANID}]</key>
                                    </item>
                                </graph_item>
                            </graph_items>
                        </graph_prototype>
                        <graph_prototype>
                            <name>{#WANNAME}-traffic</name>
                            <percent_left>95</percent_left>
                            <graph_items>
                                <graph_item>
                                    <sortorder>1</sortorder>
                                    <drawtype>FILLED_REGION</drawtype>
                                    <color>009900</color>
                                    <item>
                                        <host>SXZ-Router</host>
                                        <key>traffice-in-wan[{#WANID}]</key>
                                    </item>
                                </graph_item>
                                <graph_item>
                                    <sortorder>2</sortorder>
                                    <color>0000EE</color>
                                    <item>
                                        <host>SXZ-Router</host>
                                        <key>traffice-out-wan[{#WANID}]</key>
                                    </item>
                                </graph_item>
                            </graph_items>
                        </graph_prototype>
                    </graph_prototypes>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>var regex = /&quot;{#WANNAME}&quot;:&quot;([0-9 A-F ]*) &quot;}/;
var m;
do {
  m = regex.exec(value)
  if (m) {
    var str = '';
    hex = m[1];
	hex = hex.replace(/ /g,'');
    for (var n = 0; n &lt; hex.length; n += 2) {
        if (hex.substr(n, 2) != '00'){
			str += String.fromCharCode(parseInt(hex.substr(n, 2), 16));
		}
    }
    value = value.replace(m[1], str);
  }
} while (m);
return (value);</params>
                        </step>
                    </preprocessing>
                </discovery_rule>
                <discovery_rule>
                    <name>xwan-interface</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>discovery[{#XWANCOUNT},1.3.6.1.4.1.1500.80.1.1,{#XWANNAME},1.3.6.1.4.1.1500.80.1.2,{#XWANID},1.3.6.1.4.1.1500.80.1.7]</snmp_oid>
                    <key>xwan.traffic.discovery</key>
                    <delay>5m</delay>
                    <lifetime>365d</lifetime>
                    <item_prototypes>
                        <item_prototype>
                            <name>XWAN-{#XWANID} : Connections</name>
                            <type>SNMP_AGENT</type>
                            <snmp_oid>1.3.6.1.4.1.1500.80.1.3.{#XWANCOUNT}</snmp_oid>
                            <key>connections-xwan[{#XWANID}]</key>
                            <applications>
                                <application>
                                    <name>sxz-xwan</name>
                                </application>
                            </applications>
                        </item_prototype>
                        <item_prototype>
                            <name>XWAN-{#XWANID} : Bps In</name>
                            <type>SNMP_AGENT</type>
                            <snmp_oid>1.3.6.1.4.1.1500.80.1.6.{#XWANCOUNT}</snmp_oid>
                            <key>traffice-in-xwan[{#XWANID}]</key>
                            <units>bps</units>
                            <applications>
                                <application>
                                    <name>sxz-xwan</name>
                                </application>
                            </applications>
                        </item_prototype>
                        <item_prototype>
                            <name>XWAN-{#XWANID} : Bps Out</name>
                            <type>SNMP_AGENT</type>
                            <snmp_oid>1.3.6.1.4.1.1500.80.1.5.{#XWANCOUNT}</snmp_oid>
                            <key>traffice-out-xwan[{#XWANID}]</key>
                            <units>bps</units>
                            <applications>
                                <application>
                                    <name>sxz-xwan</name>
                                </application>
                            </applications>
                        </item_prototype>
                        <item_prototype>
                            <name>XWAN-{#XWANID} : delay</name>
                            <type>SNMP_AGENT</type>
                            <snmp_oid>1.3.6.1.4.1.1500.80.1.4.{#XWANCOUNT}</snmp_oid>
                            <key>xwan-delay[{#XWANID}]</key>
                            <value_type>FLOAT</value_type>
                            <units>ms</units>
                            <applications>
                                <application>
                                    <name>sxz-xwan</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>MULTIPLIER</type>
                                    <params>0.001</params>
                                </step>
                            </preprocessing>
                        </item_prototype>
                    </item_prototypes>
                    <graph_prototypes>
                        <graph_prototype>
                            <name>{#XWANNAME}[{#XWANID}]-status</name>
                            <graph_items>
                                <graph_item>
                                    <sortorder>1</sortorder>
                                    <drawtype>BOLD_LINE</drawtype>
                                    <color>A54F10</color>
                                    <item>
                                        <host>SXZ-Router</host>
                                        <key>xwan-delay[{#XWANID}]</key>
                                    </item>
                                </graph_item>
                                <graph_item>
                                    <sortorder>2</sortorder>
                                    <drawtype>GRADIENT_LINE</drawtype>
                                    <color>0080FF</color>
                                    <item>
                                        <host>SXZ-Router</host>
                                        <key>connections-xwan[{#XWANID}]</key>
                                    </item>
                                </graph_item>
                            </graph_items>
                        </graph_prototype>
                        <graph_prototype>
                            <name>{#XWANNAME}[{#XWANID}]-traffic</name>
                            <graph_items>
                                <graph_item>
                                    <sortorder>1</sortorder>
                                    <color>1A7C11</color>
                                    <item>
                                        <host>SXZ-Router</host>
                                        <key>traffice-in-xwan[{#XWANID}]</key>
                                    </item>
                                </graph_item>
                                <graph_item>
                                    <sortorder>2</sortorder>
                                    <color>F63100</color>
                                    <item>
                                        <host>SXZ-Router</host>
                                        <key>traffice-out-xwan[{#XWANID}]</key>
                                    </item>
                                </graph_item>
                            </graph_items>
                        </graph_prototype>
                    </graph_prototypes>
                </discovery_rule>
            </discovery_rules>
            <macros>
                <macro>
                    <macro>{$SNMP_COMMUNITY}</macro>
                </macro>
            </macros>
        </template>
    </templates>
    <triggers>
        <trigger>
            <expression>{SXZ-Router:sxz.disk.part.used.last(0)}/{SXZ-Router:sxz.disk.part.total.last(0)}*100&gt;85</expression>
            <name>磁盘使用率超过85%</name>
            <priority>HIGH</priority>
        </trigger>
    </triggers>
    <graphs>
        <graph>
            <name>CPU温度</name>
            <graph_items>
                <graph_item>
                    <color>1A7C11</color>
                    <item>
                        <host>SXZ-Router</host>
                        <key>cpu.temp</key>
                    </item>
                </graph_item>
            </graph_items>
        </graph>
        <graph>
            <name>磁盘使用率</name>
            <width>600</width>
            <height>340</height>
            <yaxismax>0</yaxismax>
            <show_work_period>NO</show_work_period>
            <show_triggers>NO</show_triggers>
            <type>PIE</type>
            <show_3d>YES</show_3d>
            <graph_items>
                <graph_item>
                    <color>969696</color>
                    <item>
                        <host>SXZ-Router</host>
                        <key>sxz.disk.part.total</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>1</sortorder>
                    <color>F63100</color>
                    <item>
                        <host>SXZ-Router</host>
                        <key>sxz.disk.part.used</key>
                    </item>
                </graph_item>
            </graph_items>
        </graph>
    </graphs>
</zabbix_export>
