<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export><version>5.0</version><date>2021-11-21T22:10:12Z</date><groups><group><name>Templates/Applications</name></group></groups><templates><template><template>App Citrix License Sever</template><name>App Citrix License Sever</name><description>## Overview

This Template doesn't require any scripts on the target machine.


It is able to enumerate and discover the installed licenses.


Following properties will be monitored (to be extended):


* List of installed licenses
* License expiration


## Author

WorkSimple GmbH

</description><groups><group><name>Templates/Applications</name></group></groups><applications><application><name>Citrix</name></application></applications><discovery_rules><discovery_rule><name>Citrix Licenses discovery</name><key>wmi.getall[&quot;ROOT\CitrixLicensing&quot;,&quot;SELECT SerialNumber FROM Citrix_GT_License WHERE SerialNumber &lt;&gt; ''&quot;]</key><lifetime>5d</lifetime><item_prototypes><item_prototype><name>Citrix License {#CITRIX_LIC} validity period</name><key>wmi.get[&quot;ROOT\CitrixLicensing&quot;,&quot;SELECT ExpirationDate FROM Citrix_GT_License WHERE SerialNumber = '{#CITRIX_LIC}'&quot;]</key><delay>1h</delay><units>uptime</units><applications><application><name>Citrix</name></application></applications><preprocessing><step><type>JAVASCRIPT</type><params>var year = parseInt(value[0]+value[1]+value[2]+value[3]);
var month = parseInt(value[4]+value[5]);
var day = parseInt(value[6]+value[7]);
var expiry = new Date(year, month-1, day)
var current = new Date();
var duration = expiry - current;
duration = Math.floor(duration/1000);
return duration;  </params></step></preprocessing><trigger_prototypes><trigger_prototype><expression>{avg(#3)}&lt;{$CITRIX_LIC.EXPIRY.WARN}</expression><name>Citrix License {#CITRIX_LIC} is about to expire</name><opdata>Expires in {ITEM.LASTVALUE1}</opdata><priority>WARNING</priority><manual_close>YES</manual_close></trigger_prototype></trigger_prototypes></item_prototype></item_prototypes><graph_prototypes><graph_prototype><name>Citrix Licenses validity</name><show_work_period>NO</show_work_period><show_triggers>NO</show_triggers><graph_items><graph_item><sortorder>1</sortorder><color>2774A4</color><calc_fnc>ALL</calc_fnc><item><host>App Citrix License Sever</host><key>wmi.get[&quot;ROOT\CitrixLicensing&quot;,&quot;SELECT ExpirationDate FROM Citrix_GT_License WHERE SerialNumber = '{#CITRIX_LIC}'&quot;]</key></item></graph_item></graph_items><discover>NO_DISCOVER</discover></graph_prototype></graph_prototypes><lld_macro_paths><lld_macro_path><lld_macro>{#CITRIX_LIC}</lld_macro><path>$.SerialNumber</path></lld_macro_path></lld_macro_paths></discovery_rule></discovery_rules><macros><macro><macro>{$CITRIX_LIC.EXPIRY.CRITICAL}</macro><value>691200</value><description>The critical threshold of time for a license to expire in seconds.</description></macro><macro><macro>{$CITRIX_LIC.EXPIRY.WARN}</macro><value>1209600</value><description>The warning threshold of time for a license to expire in seconds.</description></macro></macros></template></templates></zabbix_export>
