zabbix_export: version: '6.0' date: '2021-11-21T22:10:14Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 name: Templates/Applications templates: - uuid: 5f082e8400b8436cbfa275517a8339e0 template: 'App Citrix License Sever' name: 'App Citrix License Sever' 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 groups: - name: Templates/Applications discovery_rules: - uuid: 5c222aacb447499085522664816c90b1 name: 'Citrix Licenses discovery' key: 'wmi.getall["ROOT\CitrixLicensing","SELECT SerialNumber FROM Citrix_GT_License WHERE SerialNumber <> ''''"]' lifetime: 5d item_prototypes: - uuid: ea75e91188bd417faf531f9737cfe9bc name: 'Citrix License {#CITRIX_LIC} validity period' key: 'wmi.get["ROOT\CitrixLicensing","SELECT ExpirationDate FROM Citrix_GT_License WHERE SerialNumber = ''{#CITRIX_LIC}''"]' delay: 1h units: uptime preprocessing: - type: JAVASCRIPT parameters: - | 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; tags: - tag: Application value: Citrix trigger_prototypes: - uuid: 2fc7695871ae4b248e8af6dfe48c929b expression: 'avg(/App Citrix License Sever/wmi.get["ROOT\CitrixLicensing","SELECT ExpirationDate FROM Citrix_GT_License WHERE SerialNumber = ''{#CITRIX_LIC}''"],#3)<{$CITRIX_LIC.EXPIRY.WARN}' name: 'Citrix License {#CITRIX_LIC} is about to expire' opdata: 'Expires in {ITEM.LASTVALUE1}' priority: WARNING manual_close: 'YES' graph_prototypes: - uuid: e0404a2286fb45c0be9d160becc1085b name: 'Citrix Licenses validity' show_work_period: 'NO' show_triggers: 'NO' graph_items: - sortorder: '1' color: 2774A4 calc_fnc: ALL item: host: 'App Citrix License Sever' key: 'wmi.get["ROOT\CitrixLicensing","SELECT ExpirationDate FROM Citrix_GT_License WHERE SerialNumber = ''{#CITRIX_LIC}''"]' discover: NO_DISCOVER lld_macro_paths: - lld_macro: '{#CITRIX_LIC}' path: $.SerialNumber macros: - macro: '{$CITRIX_LIC.EXPIRY.CRITICAL}' value: '691200' description: 'The critical threshold of time for a license to expire in seconds.' - macro: '{$CITRIX_LIC.EXPIRY.WARN}' value: '1209600' description: 'The warning threshold of time for a license to expire in seconds.'