zabbix_export: version: '6.0' date: '2021-11-21T21:55:08Z' groups: - uuid: 7df96b18c230490a9a0a9e2307226338 name: Templates templates: - uuid: 795a522fe34440a0b501ad47f4b9b18f template: Eocortex name: Eocortex description: | ## Overview This template will monitor the following items of a Eocortex (or Macroscop) server: - Service State (Windows Service) - Eocortex version (through the API) - Last recording (by monitoring D:\EocortexArchive\ArchiveLogicDrive.xml, if you have more drives or different drive letters this needs modifying) - Total number of camera's (through the API) - Number of offline camera's (through the API) - CPU usage (i raised the default trigger because it's common for a Eocortex server doing video analytics to have high CPU usage) It needs two macro's to be configured on the host: {$EOCORTEX\_PASSWORD} Eocortex password in MD5 hash {$EOCORTEX\_USER} = Eocortex Username The user doesnt need any specific permissions in Eocortex. It's all configured with active checks, so make sure your agent works with the active checks or change it to passive checks. The agent will connect to localhost; if you have multiple Eocortex servers, just add all servers. I'm using Zabbix 4.4.4 but there is nothing very specific so it will probably also work on older versions. ## Author ARAS Security B.V. groups: - name: Templates items: - uuid: 41b1f845721c4b2e8e73a1450546e6cc name: 'Agent ping' type: ZABBIX_ACTIVE key: agent.ping triggers: - uuid: e92f1225c319488facf425ce9fb3d6ac expression: 'nodata(/Eocortex/agent.ping,1800s)=1' name: 'Agent offline for 30 minutes' priority: WARNING - uuid: a7d602aa93914d2d8c3a7943b00cb532 name: 'Average disk read queue length' type: ZABBIX_ACTIVE key: 'perf_counter[\234(_Total)\1402]' delay: '60' history: 7d value_type: FLOAT description: 'Full counter name: \PhysicalDisk(_Total)\Avg. Disk Read Queue Length' request_method: POST - uuid: a47061f6d3e74793af35f3c079b4c432 name: 'Average disk write queue length' type: ZABBIX_ACTIVE key: 'perf_counter[\234(_Total)\1404]' delay: '60' history: 7d value_type: FLOAT description: 'Full counter name: \PhysicalDisk(_Total)\Avg. Disk Write Queue Length' request_method: POST - uuid: de58222112f94713a59e4875a81bcbcc name: 'Eocortex Service' type: ZABBIX_ACTIVE key: 'service_state[EocortexServer]' delay: 30s valuemap: name: 'Windows service state' request_method: POST tags: - tag: Application value: Eocortex triggers: - uuid: 582b8f01390445c8bca1859f09f53df2 expression: 'last(/Eocortex/service_state[EocortexServer])<>0' name: 'Eocortex Service not running on {HOST.NAME}' priority: HIGH - uuid: 81f80b8cbd8b48e1af76c8570afccf8d name: 'Processor load (5 min average)' type: ZABBIX_ACTIVE key: 'system.cpu.load[percpu,avg5]' delay: '60' history: 7d value_type: FLOAT request_method: POST triggers: - uuid: 8fe00abb24184e318a2153da9bcf9efe expression: 'last(/Eocortex/system.cpu.load[percpu,avg5])>60' name: 'Processor load is too high on {HOST.NAME}' priority: HIGH - uuid: a9dd0a01b65e49c0b99329f5c6629dda name: 'Free swap space' type: ZABBIX_ACTIVE key: 'system.swap.size[,free]' delay: '60' history: 7d units: B request_method: POST - uuid: cf4c37b3c4d74b29bde71d6e2a3df9d5 name: 'Total swap space' type: ZABBIX_ACTIVE key: 'system.swap.size[,total]' delay: '3600' history: 7d units: B request_method: POST - uuid: 454621d0c13147b4a3d8b52fb1832ffc name: 'System information' type: ZABBIX_ACTIVE key: system.uname delay: '3600' history: 7d trends: '0' value_type: CHAR inventory_link: OS request_method: POST - uuid: bcebb52c436d4d3aa477f7d642633ded name: 'System uptime' type: ZABBIX_ACTIVE key: system.uptime delay: '60' history: 7d units: uptime request_method: POST - uuid: 5c370b97305248aeb33dcc2c3cf1ef57 name: 'Last recording' type: ZABBIX_ACTIVE key: 'vfs.file.time[D:\EocortexArchive\ArchiveLogicDrive.xml,modify]' units: unixtime tags: - tag: Application value: Eocortex triggers: - uuid: a62b5052d88348bbbecb41a6526b14c4 expression: 'now() - last(/Eocortex/vfs.file.time[D:\EocortexArchive\ArchiveLogicDrive.xml,modify])>300' name: 'Recording stopped for more then 5 minutes' priority: HIGH - uuid: 671ef169e2a0489aaa47d2c51e089310 name: 'Free disk space on C: (percentage)' type: ZABBIX_ACTIVE key: 'vfs.fs.size[C:,pfree]' delay: 60m value_type: FLOAT units: '%' triggers: - uuid: f1f04dd9276c4c558d66443c8d3728ab expression: 'last(/Eocortex/vfs.fs.size[C:,pfree])<20' name: 'Free disk space is less than 20% on volume C:' priority: WARNING - uuid: 0c9a0fae127942678ef4d8b6295e1a06 name: 'Free memory' type: ZABBIX_ACTIVE key: 'vm.memory.size[free]' delay: '60' history: 7d units: B request_method: POST - uuid: 686afc60beab42ca8991ac162b5e8513 name: 'Total memory' type: ZABBIX_ACTIVE key: 'vm.memory.size[total]' delay: '3600' history: 7d units: B request_method: POST - uuid: 59c274ed0cc3482fb1321b87e5fab495 name: 'Number of camera''s' type: ZABBIX_ACTIVE key: 'web.page.get[127.0.0.1,/command?type=getchannelsstates&login={$EOCORTEX_USER}&password={$EOCORTEX_PASSWORD}&responsetype=json,8080]' delay: 60m preprocessing: - type: JAVASCRIPT parameters: - | var count = (value.match(/MainVideo/g) || []).length; return count tags: - tag: Application value: Eocortex - uuid: 93c3a3753bc441bcac51e2b1d4ccfbe6 name: 'Eocortex Version' type: ZABBIX_ACTIVE key: 'web.page.get[127.0.0.1,/configex?login={$EOCORTEX_USER}&password={$EOCORTEX_PASSWORD}&responsetype=json,8080]' delay: 90m trends: '0' value_type: CHAR preprocessing: - type: REGEX parameters: - '(?<=ServerVersion["]:\s["])[\d|.]*' - \0 tags: - tag: Application value: Eocortex - uuid: f40c5bc6275a48828ee5800c7c6886ba name: 'Number of camera''s offline' type: ZABBIX_ACTIVE key: 'web.page.get[localhost,/command?type=getchannelsstates&login={$EOCORTEX_USER}&password={$EOCORTEX_PASSWORD}&responsetype=json,8080]' preprocessing: - type: JAVASCRIPT parameters: - | var count = (value.match(/["]Type["]\:\s*\"MainVideo["]\,\s*["]State["]\:\s*["]NoConnection["]/g) || []).length; return count tags: - tag: Application value: Eocortex triggers: - uuid: 0e9229c6d3224f7aa485b626a8accdb6 expression: 'last(/Eocortex/web.page.get[localhost,/command?type=getchannelsstates&login={$EOCORTEX_USER}&password={$EOCORTEX_PASSWORD}&responsetype=json,8080])=1' name: 'Camera offline on {HOST.NAME}' priority: WARNING - uuid: 804a05ed6c6a4d9c81b87edf2e210afe expression: 'last(/Eocortex/web.page.get[localhost,/command?type=getchannelsstates&login={$EOCORTEX_USER}&password={$EOCORTEX_PASSWORD}&responsetype=json,8080])>1' name: 'Multiple camera''s offline on {HOST.NAME}' priority: WARNING valuemaps: - uuid: 89d41fa9c48049e39b9202b130588411 name: 'Windows service state' mappings: - value: '0' newvalue: Running - value: '1' newvalue: Paused - value: '2' newvalue: 'Start pending' - value: '3' newvalue: 'Pause pending' - value: '4' newvalue: 'Continue pending' - value: '5' newvalue: 'Stop pending' - value: '6' newvalue: Stopped - value: '7' newvalue: Unknown - value: '255' newvalue: 'No such service'