<zabbix_export>
  <version>7.2</version>
  <template_groups>
    <template_group>
      <uuid>a571c0d144b14fd4a87a9d9b2aa9fcd6</uuid>
      <name>Templates/Applications</name>
    </template_group>
  </template_groups>
  <templates>
    <template>
      <uuid>f1250bd1e3ab4955bdd82f3c5f8dd71c</uuid>
      <template>Template OPC Unified Architecture by Zabbix agent 2</template>
      <name>Template OPC Unified Architecture by Zabbix agent 2</name>
      <description>Version: 3-1436c20</description>
      <groups>
        <group>
          <name>Templates/Applications</name>
        </group>
      </groups>
      <items>
        <item>
          <uuid>effbf93c30e74b0088ec1e27fd23b17c</uuid>
          <name>OPC UA Server Status (ns=0;i=2256)</name>
          <key>opcua.get["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}","ns=0;i=2256"]</key>
          <history>7d</history>
          <value_type>TEXT</value_type>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
        </item>
        <item>
          <uuid>27f8d82c2aef415e8cd822d034bcdc52</uuid>
          <name>OPC UA Server Current Time (ns=0;i=2258)</name>
          <key>opcua.get["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}","ns=0;i=2258"]</key>
          <history>7d</history>
          <value_type>FLOAT</value_type>
          <units>unixtime</units>
          <preprocessing>
            <step>
              <type>JAVASCRIPT</type>
              <parameters>
                <parameter>return Math.floor(Date.parse(value) / 1000);</parameter>
              </parameters>
            </step>
          </preprocessing>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
        </item>
        <item>
          <uuid>3980fdef5aeb4794bba33ae95ba32ab4</uuid>
          <name>OPC UA Server State (ns=0;i=2259)</name>
          <key>opcua.get["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}","ns=0;i=2259"]</key>
          <history>7d</history>
          <valuemap>
            <name>OPC UA ServerState</name>
          </valuemap>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
        </item>
        <item>
          <uuid>c352998a289d4b54a007e2469a77d976</uuid>
          <name>OPC UA Certificate Days Until Expiration (info)</name>
          <type>DEPENDENT</type>
          <key>opcua.info.cert.days_until_expiration</key>
          <history>7d</history>
          <value_type>FLOAT</value_type>
          <units>!days</units>
          <preprocessing>
            <step>
              <type>JSONPATH</type>
              <parameters>
                <parameter>$.certificate.days_until_expiration</parameter>
              </parameters>
            </step>
          </preprocessing>
          <master_item>
            <key>opcua.info["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}"]</key>
          </master_item>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
          <triggers>
            <trigger>
              <uuid>d35cb8df7bb443fda3ac843be62d3fcd</uuid>
              <expression>last(/Template OPC Unified Architecture by Zabbix agent 2/opcua.info.cert.days_until_expiration)&lt;30 and last(/Template OPC Unified Architecture by Zabbix agent 2/opcua.info.cert.days_until_expiration)&gt;=0</expression>
              <name>OPC UA certificate expires in less than 30 days</name>
              <priority>WARNING</priority>
            </trigger>
            <trigger>
              <uuid>227c59e5afb84aea945d07bd8521b631</uuid>
              <expression>last(/Template OPC Unified Architecture by Zabbix agent 2/opcua.info.cert.days_until_expiration)&lt;0</expression>
              <name>OPC UA certificate has expired</name>
              <priority>HIGH</priority>
            </trigger>
          </triggers>
        </item>
        <item>
          <uuid>3cc55dd02a1646c09009456903557eb9</uuid>
          <name>OPC UA Certificate Issuer (info)</name>
          <type>DEPENDENT</type>
          <key>opcua.info.cert.issuer</key>
          <history>7d</history>
          <value_type>TEXT</value_type>
          <preprocessing>
            <step>
              <type>JSONPATH</type>
              <parameters>
                <parameter>$.certificate.issuer</parameter>
              </parameters>
            </step>
          </preprocessing>
          <master_item>
            <key>opcua.info["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}"]</key>
          </master_item>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
        </item>
        <item>
          <uuid>a19f8c2bef8d4a10b1e88e788e136158</uuid>
          <name>OPC UA Certificate Valid Until (info)</name>
          <type>DEPENDENT</type>
          <key>opcua.info.cert.not_after</key>
          <history>7d</history>
          <value_type>FLOAT</value_type>
          <units>unixtime</units>
          <preprocessing>
            <step>
              <type>JSONPATH</type>
              <parameters>
                <parameter>$.certificate.not_after</parameter>
              </parameters>
            </step>
            <step>
              <type>JAVASCRIPT</type>
              <parameters>
                <parameter>return Math.floor(Date.parse(value) / 1000);</parameter>
              </parameters>
            </step>
          </preprocessing>
          <master_item>
            <key>opcua.info["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}"]</key>
          </master_item>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
        </item>
        <item>
          <uuid>db5d12a99a5c4dec884605be93265b1c</uuid>
          <name>OPC UA Certificate Valid From (info)</name>
          <type>DEPENDENT</type>
          <key>opcua.info.cert.not_before</key>
          <history>7d</history>
          <value_type>FLOAT</value_type>
          <units>unixtime</units>
          <preprocessing>
            <step>
              <type>JSONPATH</type>
              <parameters>
                <parameter>$.certificate.not_before</parameter>
              </parameters>
            </step>
            <step>
              <type>JAVASCRIPT</type>
              <parameters>
                <parameter>return Math.floor(Date.parse(value) / 1000);</parameter>
              </parameters>
            </step>
          </preprocessing>
          <master_item>
            <key>opcua.info["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}"]</key>
          </master_item>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
        </item>
        <item>
          <uuid>eea4b8eed51e4590b48fea414683cc6b</uuid>
          <name>OPC UA Certificate Subject (info)</name>
          <type>DEPENDENT</type>
          <key>opcua.info.cert.subject</key>
          <history>7d</history>
          <value_type>TEXT</value_type>
          <preprocessing>
            <step>
              <type>JSONPATH</type>
              <parameters>
                <parameter>$.certificate.subject</parameter>
              </parameters>
            </step>
          </preprocessing>
          <master_item>
            <key>opcua.info["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}"]</key>
          </master_item>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
        </item>
        <item>
          <uuid>b6ff60408e824423a806cd493f244801</uuid>
          <name>OPC UA Server Current Time (info)</name>
          <type>DEPENDENT</type>
          <key>opcua.info.current_time</key>
          <history>7d</history>
          <value_type>FLOAT</value_type>
          <units>unixtime</units>
          <preprocessing>
            <step>
              <type>JSONPATH</type>
              <parameters>
                <parameter>$.current_time</parameter>
              </parameters>
            </step>
            <step>
              <type>JAVASCRIPT</type>
              <parameters>
                <parameter>return Math.floor(Date.parse(value) / 1000);</parameter>
              </parameters>
            </step>
          </preprocessing>
          <master_item>
            <key>opcua.info["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}"]</key>
          </master_item>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
        </item>
        <item>
          <uuid>397c7dba06e34fd9b14145675b6dde37</uuid>
          <name>OPC UA Server Current Session Count (info)</name>
          <type>DEPENDENT</type>
          <key>opcua.info.session_count</key>
          <history>7d</history>
          <preprocessing>
            <step>
              <type>JSONPATH</type>
              <parameters>
                <parameter>$.current_session_count</parameter>
              </parameters>
            </step>
          </preprocessing>
          <master_item>
            <key>opcua.info["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}"]</key>
          </master_item>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
        </item>
        <item>
          <uuid>06cf855f7571424d923f4d0f0aa7e6a5</uuid>
          <name>OPC UA Server Start Time (info)</name>
          <type>DEPENDENT</type>
          <key>opcua.info.start_time</key>
          <history>7d</history>
          <value_type>FLOAT</value_type>
          <units>unixtime</units>
          <preprocessing>
            <step>
              <type>JSONPATH</type>
              <parameters>
                <parameter>$.start_time</parameter>
              </parameters>
            </step>
            <step>
              <type>JAVASCRIPT</type>
              <parameters>
                <parameter>return Math.floor(Date.parse(value) / 1000);</parameter>
              </parameters>
            </step>
          </preprocessing>
          <master_item>
            <key>opcua.info["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}"]</key>
          </master_item>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
        </item>
        <item>
          <uuid>e8a44f9f29324e71b71ac6fd8bbe345d</uuid>
          <name>OPC UA Server State Name (info)</name>
          <type>DEPENDENT</type>
          <key>opcua.info.state</key>
          <history>7d</history>
          <value_type>CHAR</value_type>
          <preprocessing>
            <step>
              <type>JSONPATH</type>
              <parameters>
                <parameter>$.state</parameter>
              </parameters>
            </step>
          </preprocessing>
          <master_item>
            <key>opcua.info["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}"]</key>
          </master_item>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
        </item>
        <item>
          <uuid>00237613331342f2b72b432881c85963</uuid>
          <name>OPC UA Server State Code (info)</name>
          <type>DEPENDENT</type>
          <key>opcua.info.state_code</key>
          <history>7d</history>
          <valuemap>
            <name>OPC UA ServerState</name>
          </valuemap>
          <preprocessing>
            <step>
              <type>JSONPATH</type>
              <parameters>
                <parameter>$.state_code</parameter>
              </parameters>
            </step>
          </preprocessing>
          <master_item>
            <key>opcua.info["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}"]</key>
          </master_item>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
        </item>
        <item>
          <uuid>1330d9d3e11747219506fe1396d8c2e9</uuid>
          <name>OPC UA Server Current Subscription Count (info)</name>
          <type>DEPENDENT</type>
          <key>opcua.info.subscription_count</key>
          <history>7d</history>
          <preprocessing>
            <step>
              <type>JSONPATH</type>
              <parameters>
                <parameter>$.current_subscription_count</parameter>
              </parameters>
            </step>
          </preprocessing>
          <master_item>
            <key>opcua.info["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}"]</key>
          </master_item>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
        </item>
        <item>
          <uuid>4e294ee15487404b88ec7a16f165b891</uuid>
          <name>OPC UA Server Info</name>
          <key>opcua.info["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}"]</key>
          <history>0</history>
          <value_type>TEXT</value_type>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
        </item>
        <item>
          <uuid>14ba6839dd2c47a99c18edc578438ba1</uuid>
          <name>OPC UA service ping</name>
          <key>opcua.ping["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}"]</key>
          <history>7d</history>
          <valuemap>
            <name>Service state</name>
          </valuemap>
          <tags>
            <tag>
              <tag>Application</tag>
              <value>OPC UA</value>
            </tag>
          </tags>
          <triggers>
            <trigger>
              <uuid>c2893e24078f402eaca2b3d0a676dfae</uuid>
              <expression>last(/Template OPC Unified Architecture by Zabbix agent 2/opcua.ping["{$OPCUA.URI}","{$OPCUA.USER}","{$OPCUA.PASSWORD}"])=0</expression>
              <name>OPC UA server is unreachable</name>
              <priority>AVERAGE</priority>
            </trigger>
          </triggers>
        </item>
      </items>
      <macros>
        <macro>
          <macro>{$OPCUA.PASSWORD}</macro>
          <type>SECRET_TEXT</type>
        </macro>
        <macro>
          <macro>{$OPCUA.URI}</macro>
          <value>opc.tcp://127.0.0.1:4840</value>
        </macro>
        <macro>
          <macro>{$OPCUA.USER}</macro>
        </macro>
      </macros>
      <valuemaps>
        <valuemap>
          <uuid>85c9d0854bd04ad2bbf830a60e6c1b6b</uuid>
          <name>OPC UA ServerState</name>
          <mappings>
            <mapping>
              <value>0</value>
              <newvalue>Running</newvalue>
            </mapping>
            <mapping>
              <value>1</value>
              <newvalue>Failed</newvalue>
            </mapping>
            <mapping>
              <value>2</value>
              <newvalue>NoConfiguration</newvalue>
            </mapping>
            <mapping>
              <value>3</value>
              <newvalue>Suspended</newvalue>
            </mapping>
            <mapping>
              <value>4</value>
              <newvalue>Shutdown</newvalue>
            </mapping>
            <mapping>
              <value>5</value>
              <newvalue>Test</newvalue>
            </mapping>
            <mapping>
              <value>6</value>
              <newvalue>CommunicationFault</newvalue>
            </mapping>
            <mapping>
              <value>7</value>
              <newvalue>Unknown</newvalue>
            </mapping>
          </mappings>
        </valuemap>
        <valuemap>
          <uuid>17a776aa01e047f394cf4801233d095d</uuid>
          <name>Service state</name>
          <mappings>
            <mapping>
              <value>0</value>
              <newvalue>Down</newvalue>
            </mapping>
            <mapping>
              <value>1</value>
              <newvalue>Up</newvalue>
            </mapping>
          </mappings>
        </valuemap>
      </valuemaps>
    </template>
  </templates>
</zabbix_export>
