<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
    <version>5.2</version>
    <date>2026-10-07T00:00:00Z</date>
    <groups>
        <group>
            <name>Templates/MiRCA</name>
        </group>
    </groups>
    <templates>
        <template>
            <template>MiRCA Port 1 Serial capture</template>
            <name>MiRCA Port 1 Serial capture</name>
            <description>MiRCA serial port 1 running the 'Serial capture' protocol (protocol id 7). SNMP v2c over the Ethernet interface, tree .1.3.6.1.4.1.2021.13.16.4.2.1 (doc/ports.md). Link 'MiRCA Device' too. Diagnostic recording of raw serial traffic (listen only). The recording itself is downloaded from /api/capture?port=N.</description>
            <groups>
                <group>
                    <name>Templates/MiRCA</name>
                </group>
            </groups>
            <applications>
                <application>
                    <name>Port 1</name>
                </application>
                <application>
                    <name>Capture</name>
                </application>
            </applications>
            <items>
                <item>
                    <name>Port 1: protocol</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.4.1.2021.13.16.4.2.1.1</snmp_oid>
                    <key>mirca.p1.protocol</key>
                    <delay>{$MIRCA.INTERVAL.SLOW}</delay>
                    <history>14d</history>
                    <trends>365d</trends>
                    <value_type>UNSIGNED</value_type>
                    <description>Protocol configured on the port</description>
                    <applications>
                        <application>
                            <name>Port 1</name>
                        </application>
                    </applications>
                    <valuemap>
                        <name>MiRCA protocol</name>
                    </valuemap>
                </item>
                <item>
                    <name>Port 1: online</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.4.1.2021.13.16.4.2.1.2</snmp_oid>
                    <key>mirca.p1.online</key>
                    <delay>{$MIRCA.INTERVAL}</delay>
                    <history>14d</history>
                    <trends>365d</trends>
                    <value_type>UNSIGNED</value_type>
                    <description>1 while the device answers. All values read 0 while it is offline.</description>
                    <applications>
                        <application>
                            <name>Port 1</name>
                        </application>
                    </applications>
                    <valuemap>
                        <name>MiRCA online</name>
                    </valuemap>
                </item>
                <item>
                    <name>Port 1: seconds since last reply</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.4.1.2021.13.16.4.2.1.3</snmp_oid>
                    <key>mirca.p1.age</key>
                    <delay>{$MIRCA.INTERVAL}</delay>
                    <history>14d</history>
                    <trends>365d</trends>
                    <value_type>FLOAT</value_type>
                    <units>s</units>
                    <description>-1: no reply since boot</description>
                    <applications>
                        <application>
                            <name>Port 1</name>
                        </application>
                    </applications>
                </item>
                <item>
                    <name>Port 1: Bytes received</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.4.1.2021.13.16.4.2.1.40.1</snmp_oid>
                    <key>mirca.p1.m[bytes]</key>
                    <delay>{$MIRCA.INTERVAL}</delay>
                    <history>14d</history>
                    <trends>365d</trends>
                    <value_type>FLOAT</value_type>
                    <description>Metric 1 'bytes'</description>
                    <applications>
                        <application>
                            <name>Capture</name>
                        </application>
                    </applications>
                </item>
                <item>
                    <name>Port 1: Frames recorded</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.4.1.2021.13.16.4.2.1.40.2</snmp_oid>
                    <key>mirca.p1.m[frames]</key>
                    <delay>{$MIRCA.INTERVAL}</delay>
                    <history>14d</history>
                    <trends>365d</trends>
                    <value_type>FLOAT</value_type>
                    <description>Metric 2 'frames'</description>
                    <applications>
                        <application>
                            <name>Capture</name>
                        </application>
                    </applications>
                </item>
                <item>
                    <name>Port 1: Buffer used</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.4.1.2021.13.16.4.2.1.40.3</snmp_oid>
                    <key>mirca.p1.m[buffer_used]</key>
                    <delay>{$MIRCA.INTERVAL}</delay>
                    <history>14d</history>
                    <trends>365d</trends>
                    <value_type>FLOAT</value_type>
                    <units>%</units>
                    <description>Metric 3 'buffer_used'</description>
                    <applications>
                        <application>
                            <name>Capture</name>
                        </application>
                    </applications>
                </item>
                <item>
                    <name>Port 1: Frames not recorded (buffer full)</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.4.1.2021.13.16.4.2.1.40.4</snmp_oid>
                    <key>mirca.p1.m[frames_dropped]</key>
                    <delay>{$MIRCA.INTERVAL}</delay>
                    <history>14d</history>
                    <trends>365d</trends>
                    <value_type>FLOAT</value_type>
                    <description>Metric 4 'frames_dropped'</description>
                    <applications>
                        <application>
                            <name>Capture</name>
                        </application>
                    </applications>
                </item>
            </items>
            <macros>
                <macro>
                    <macro>{$MIRCA.INTERVAL}</macro>
                    <value>30s</value>
                    <description>Polling interval of live values</description>
                </macro>
                <macro>
                    <macro>{$MIRCA.INTERVAL.SLOW}</macro>
                    <value>5m</value>
                    <description>Polling interval of slowly changing values (capacity, cycles, energy counters)</description>
                </macro>
                <macro>
                    <macro>{$MIRCA.OFFLINE.TIME}</macro>
                    <value>5m</value>
                    <description>How long the device may stay silent before a problem is raised</description>
                </macro>
            </macros>
        </template>
        <template>
            <template>MiRCA Port 2 Serial capture</template>
            <name>MiRCA Port 2 Serial capture</name>
            <description>MiRCA serial port 2 running the 'Serial capture' protocol (protocol id 7). SNMP v2c over the Ethernet interface, tree .1.3.6.1.4.1.2021.13.16.4.2.2 (doc/ports.md). Link 'MiRCA Device' too. Diagnostic recording of raw serial traffic (listen only). The recording itself is downloaded from /api/capture?port=N.</description>
            <groups>
                <group>
                    <name>Templates/MiRCA</name>
                </group>
            </groups>
            <applications>
                <application>
                    <name>Port 2</name>
                </application>
                <application>
                    <name>Capture</name>
                </application>
            </applications>
            <items>
                <item>
                    <name>Port 2: protocol</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.4.1.2021.13.16.4.2.2.1</snmp_oid>
                    <key>mirca.p2.protocol</key>
                    <delay>{$MIRCA.INTERVAL.SLOW}</delay>
                    <history>14d</history>
                    <trends>365d</trends>
                    <value_type>UNSIGNED</value_type>
                    <description>Protocol configured on the port</description>
                    <applications>
                        <application>
                            <name>Port 2</name>
                        </application>
                    </applications>
                    <valuemap>
                        <name>MiRCA protocol</name>
                    </valuemap>
                </item>
                <item>
                    <name>Port 2: online</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.4.1.2021.13.16.4.2.2.2</snmp_oid>
                    <key>mirca.p2.online</key>
                    <delay>{$MIRCA.INTERVAL}</delay>
                    <history>14d</history>
                    <trends>365d</trends>
                    <value_type>UNSIGNED</value_type>
                    <description>1 while the device answers. All values read 0 while it is offline.</description>
                    <applications>
                        <application>
                            <name>Port 2</name>
                        </application>
                    </applications>
                    <valuemap>
                        <name>MiRCA online</name>
                    </valuemap>
                </item>
                <item>
                    <name>Port 2: seconds since last reply</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.4.1.2021.13.16.4.2.2.3</snmp_oid>
                    <key>mirca.p2.age</key>
                    <delay>{$MIRCA.INTERVAL}</delay>
                    <history>14d</history>
                    <trends>365d</trends>
                    <value_type>FLOAT</value_type>
                    <units>s</units>
                    <description>-1: no reply since boot</description>
                    <applications>
                        <application>
                            <name>Port 2</name>
                        </application>
                    </applications>
                </item>
                <item>
                    <name>Port 2: Bytes received</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.4.1.2021.13.16.4.2.2.40.1</snmp_oid>
                    <key>mirca.p2.m[bytes]</key>
                    <delay>{$MIRCA.INTERVAL}</delay>
                    <history>14d</history>
                    <trends>365d</trends>
                    <value_type>FLOAT</value_type>
                    <description>Metric 1 'bytes'</description>
                    <applications>
                        <application>
                            <name>Capture</name>
                        </application>
                    </applications>
                </item>
                <item>
                    <name>Port 2: Frames recorded</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.4.1.2021.13.16.4.2.2.40.2</snmp_oid>
                    <key>mirca.p2.m[frames]</key>
                    <delay>{$MIRCA.INTERVAL}</delay>
                    <history>14d</history>
                    <trends>365d</trends>
                    <value_type>FLOAT</value_type>
                    <description>Metric 2 'frames'</description>
                    <applications>
                        <application>
                            <name>Capture</name>
                        </application>
                    </applications>
                </item>
                <item>
                    <name>Port 2: Buffer used</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.4.1.2021.13.16.4.2.2.40.3</snmp_oid>
                    <key>mirca.p2.m[buffer_used]</key>
                    <delay>{$MIRCA.INTERVAL}</delay>
                    <history>14d</history>
                    <trends>365d</trends>
                    <value_type>FLOAT</value_type>
                    <units>%</units>
                    <description>Metric 3 'buffer_used'</description>
                    <applications>
                        <application>
                            <name>Capture</name>
                        </application>
                    </applications>
                </item>
                <item>
                    <name>Port 2: Frames not recorded (buffer full)</name>
                    <type>SNMP_AGENT</type>
                    <snmp_oid>1.3.6.1.4.1.2021.13.16.4.2.2.40.4</snmp_oid>
                    <key>mirca.p2.m[frames_dropped]</key>
                    <delay>{$MIRCA.INTERVAL}</delay>
                    <history>14d</history>
                    <trends>365d</trends>
                    <value_type>FLOAT</value_type>
                    <description>Metric 4 'frames_dropped'</description>
                    <applications>
                        <application>
                            <name>Capture</name>
                        </application>
                    </applications>
                </item>
            </items>
            <macros>
                <macro>
                    <macro>{$MIRCA.INTERVAL}</macro>
                    <value>30s</value>
                    <description>Polling interval of live values</description>
                </macro>
                <macro>
                    <macro>{$MIRCA.INTERVAL.SLOW}</macro>
                    <value>5m</value>
                    <description>Polling interval of slowly changing values (capacity, cycles, energy counters)</description>
                </macro>
                <macro>
                    <macro>{$MIRCA.OFFLINE.TIME}</macro>
                    <value>5m</value>
                    <description>How long the device may stay silent before a problem is raised</description>
                </macro>
            </macros>
        </template>
    </templates>
    <triggers>
        <trigger>
            <expression>{MiRCA Port 1 Serial capture:mirca.p1.protocol.last()}&lt;&gt;7</expression>
            <name>Port 1: protocol is not Serial capture (template does not match port settings)</name>
            <priority>WARNING</priority>
            <description>The port runs protocol {ITEM.LASTVALUE}. Change the port settings or link another template.</description>
        </trigger>
        <trigger>
            <expression>{MiRCA Port 1 Serial capture:mirca.p1.m[buffer_used].last()}&gt;=100</expression>
            <name>Port 1: capture buffer is full, frames are dropped</name>
            <priority>INFO</priority>
            <manual_close>YES</manual_close>
        </trigger>
        <trigger>
            <expression>{MiRCA Port 2 Serial capture:mirca.p2.protocol.last()}&lt;&gt;7</expression>
            <name>Port 2: protocol is not Serial capture (template does not match port settings)</name>
            <priority>WARNING</priority>
            <description>The port runs protocol {ITEM.LASTVALUE}. Change the port settings or link another template.</description>
        </trigger>
        <trigger>
            <expression>{MiRCA Port 2 Serial capture:mirca.p2.m[buffer_used].last()}&gt;=100</expression>
            <name>Port 2: capture buffer is full, frames are dropped</name>
            <priority>INFO</priority>
            <manual_close>YES</manual_close>
        </trigger>
    </triggers>
    <value_maps>
        <value_map>
            <name>MiRCA online</name>
            <mappings>
                <mapping>
                    <value>0</value>
                    <newvalue>Offline</newvalue>
                </mapping>
                <mapping>
                    <value>1</value>
                    <newvalue>Online</newvalue>
                </mapping>
            </mappings>
        </value_map>
        <value_map>
            <name>MiRCA protocol</name>
            <mappings>
                <mapping>
                    <value>0</value>
                    <newvalue>Off</newvalue>
                </mapping>
                <mapping>
                    <value>1</value>
                    <newvalue>Victron VE.Bus</newvalue>
                </mapping>
                <mapping>
                    <value>2</value>
                    <newvalue>JK BMS 4G-GPS</newvalue>
                </mapping>
                <mapping>
                    <value>3</value>
                    <newvalue>PACE BMS</newvalue>
                </mapping>
                <mapping>
                    <value>4</value>
                    <newvalue>JBD BMS</newvalue>
                </mapping>
                <mapping>
                    <value>5</value>
                    <newvalue>JK BMS Modbus</newvalue>
                </mapping>
                <mapping>
                    <value>6</value>
                    <newvalue>Deye inverter Modbus</newvalue>
                </mapping>
                <mapping>
                    <value>7</value>
                    <newvalue>Serial capture</newvalue>
                </mapping>
                <mapping>
                    <value>8</value>
                    <newvalue>JK BMS parallel bus</newvalue>
                </mapping>
            </mappings>
        </value_map>
    </value_maps>
</zabbix_export>
