zabbix_export: version: '7.0' template_groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 name: Templates/Applications templates: - uuid: c077d6c381904e94a4df88136588b551 template: 'Control-M server by HTTP' name: 'Control-M server by HTTP' description: | This template is designed to get metrics from the Control-M server using the Control-M Automation API with HTTP agent. This template monitors server statistics, discovers jobs and agents using Low Level Discovery. To use this template, macros `{$API.TOKEN}`, `{$API.URI.ENDPOINT}`, and `{$SERVER.NAME}` need to be set. Generated by official Zabbix template tool "Templator" vendor: name: Zabbix version: 7.0-1 groups: - name: Templates/Applications items: - uuid: 94e45567531543119d6e36b4463684c7 name: 'Get agents' type: HTTP_AGENT key: controlm.agents history: '0' value_type: TEXT trends: '0' description: 'Gets agents for the server.' url: '{$API.URI.ENDPOINT}/config/server/{$SERVER.NAME}/agents' headers: - name: x-api-key value: '{$API.TOKEN}' tags: - tag: component value: raw - uuid: 1f60be3e3fe543d697047ffcad7b0a7f name: 'Get jobs' type: HTTP_AGENT key: controlm.jobs history: '0' value_type: TEXT trends: '0' description: 'Gets the status of jobs.' url: '{$API.URI.ENDPOINT}/run/jobs/status' query_fields: - name: ctm value: '{$SERVER.NAME}' headers: - name: x-api-key value: '{$API.TOKEN}' tags: - tag: component value: raw - uuid: 7ae147724e374857a9a28b604e7af014 name: 'Jobs statistics' type: DEPENDENT key: controlm.jobs.statistics delay: '0' history: '0' value_type: TEXT trends: '0' description: 'Gets the statistics of jobs.' preprocessing: - type: JSONPATH parameters: - '$.[''returned'', ''total'']' master_item: key: controlm.jobs tags: - tag: component value: raw - uuid: aa085872149047f681f974e672e0c72c name: 'Jobs returned' type: DEPENDENT key: controlm.jobs.statistics.returned delay: '0' description: 'Gets the count of returned jobs.' preprocessing: - type: JSONPATH parameters: - '$.[0]' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h master_item: key: controlm.jobs.statistics tags: - tag: component value: job - uuid: 8219b115bd5246b6bbb38c7a3b74dfaa name: 'Jobs total' type: DEPENDENT key: controlm.jobs.statistics.total delay: '0' description: 'Gets the count of total jobs.' preprocessing: - type: JSONPATH parameters: - '$.[1]' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h master_item: key: controlm.jobs.statistics tags: - tag: component value: job - uuid: 67ca527f452b43aab2e3171e49f96194 name: 'Get Control-M server stats' type: HTTP_AGENT key: controlm.server.stats history: '0' value_type: TEXT trends: '0' description: 'Gets the statistics of the server.' preprocessing: - type: JSONPATH parameters: - '$.[?(@.name == ''{$SERVER.NAME}'')].first()' error_handler: CUSTOM_ERROR error_handler_params: 'Could not get server stats.' url: '{$API.URI.ENDPOINT}/config/servers' headers: - name: x-api-key value: '{$API.TOKEN}' tags: - tag: component value: raw - uuid: 101afc0212e9410b8954bd1c939aea99 name: 'Server message' type: DEPENDENT key: server.message delay: '0' value_type: TEXT trends: '0' description: 'Gets the metric of the server message.' preprocessing: - type: JSONPATH parameters: - $.message error_handler: CUSTOM_ERROR error_handler_params: 'Could not get server message.' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h master_item: key: controlm.server.stats tags: - tag: component value: server triggers: - uuid: 406307967abf4218bebd9428dd8ecb8b expression: 'last(/Control-M server by HTTP/server.message,#1)="Disconnected"' name: 'Control-M: Server disconnected' opdata: 'Triggered message: {ITEM.VALUE}, Current message: {ITEM.LASTVALUE1}' priority: HIGH description: 'The server is disconnected.' tags: - tag: scope value: availability - uuid: 1d7387fe4cd7462c81daa529b58d0e34 expression: | last(/Control-M server by HTTP/server.message,#1)<>"Connected" and last(/Control-M server by HTTP/server.message,#1)<>"Disconnected" and last(/Control-M server by HTTP/server.message,#1)<>"" name: 'Control-M: Server error' opdata: 'Triggered message: {ITEM.VALUE}, Current message: {ITEM.LASTVALUE1}' priority: HIGH description: 'The server has encountered an error.' tags: - tag: scope value: availability - uuid: b37f0aa295be421ab5e7262135930fcd name: 'Server state' type: DEPENDENT key: server.state delay: '0' description: 'Gets the metric of the server state.' valuemap: name: 'Control-M server status' preprocessing: - type: JSONPATH parameters: - $.state error_handler: CUSTOM_ERROR error_handler_params: 'Could not get server state.' - type: JAVASCRIPT parameters: - | const idx = [ 'Down', 'Up', ].indexOf(value); return idx !== -1 ? idx : 10; - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h master_item: key: controlm.server.stats tags: - tag: component value: server triggers: - uuid: d9f5b1f636ec477c932159fd1c5baf16 expression: | last(/Control-M server by HTTP/server.state)=0 or last(/Control-M server by HTTP/server.state)=10 name: 'Control-M: Server is down' opdata: 'Current state: {ITEM.LASTVALUE1}' priority: HIGH description: 'The server is down.' tags: - tag: scope value: availability - uuid: 2c7ba283ea2d4f2d91d0fa7d33551501 name: 'Server version' type: DEPENDENT key: server.version delay: '0' value_type: TEXT trends: '0' description: 'Gets the metric of the server version.' preprocessing: - type: JSONPATH parameters: - $.version error_handler: CUSTOM_ERROR error_handler_params: 'Could not get server version.' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h master_item: key: controlm.server.stats tags: - tag: component value: server triggers: - uuid: 14cdf1016ab24e5c8b03626fac5af263 expression: | last(/Control-M server by HTTP/server.version,#1)<>last(/Control-M server by HTTP/server.version,#2) and length(last(/Control-M server by HTTP/server.version))>0 recovery_mode: NONE name: 'Control-M: Server version has changed' opdata: 'Old version: {ITEM.VALUE}, Current version: {ITEM.LASTVALUE1}' priority: INFO description: 'The server version has changed. Acknowledge to close the problem manually.' manual_close: 'YES' tags: - tag: scope value: notice discovery_rules: - uuid: 8d44e49d41d1469ba0ad6ad356b056f4 name: 'Agent discovery' type: DEPENDENT key: controlm.agent.discovery delay: '0' description: 'Discovers agents on the server.' item_prototypes: - uuid: b451e6ac1f7a4b819714ee69c4833190 name: 'Agent [{#AGENT.NAME}]: stats' type: DEPENDENT key: 'agent.stats[''{#AGENT.NAME}'']' delay: '0' history: '0' value_type: TEXT trends: '0' description: 'Gets the statistics of an agent.' preprocessing: - type: JSONPATH parameters: - '$.agents.[?(@.nodeid == ''{#AGENT.NAME}'')].first()' error_handler: DISCARD_VALUE master_item: key: controlm.agents tags: - tag: component value: raw - uuid: f72163e7e68d4bb4b2b8fcf3b9afd730 name: 'Agent [{#AGENT.NAME}]: status' type: DEPENDENT key: 'agent.status[''{#AGENT.NAME}'']' delay: '0' description: 'Gets the status of an agent.' valuemap: name: 'Control-M agent status' preprocessing: - type: JSONPATH parameters: - $.status - type: JAVASCRIPT parameters: - | const idx = [ 'Available', 'Unavailable', 'Disabled', 'Disable', 'Discovering', ].indexOf(value); return idx !== -1 ? idx : 10; - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h master_item: key: 'agent.stats[''{#AGENT.NAME}'']' tags: - tag: agent-metric value: status - tag: agent-name value: '{#AGENT.NAME}' - tag: component value: agent trigger_prototypes: - uuid: 22e12e397ad942889895590c28ce3d75 expression: | last(/Control-M server by HTTP/agent.status['{#AGENT.NAME}'],#1)=1 or last(/Control-M server by HTTP/agent.status['{#AGENT.NAME}'],#1)=10 name: 'Control-M: Agent [{#AGENT.NAME}]: status [{ITEM.VALUE}]' priority: AVERAGE description: 'The agent has encountered an issue.' manual_close: 'YES' tags: - tag: scope value: availability - uuid: d7cb3729522c4e5bab9eec4341bbab08 expression: | last(/Control-M server by HTTP/agent.status['{#AGENT.NAME}'],#1)=2 or last(/Control-M server by HTTP/agent.status['{#AGENT.NAME}'],#1)=3 name: 'Control-M: Agent [{#AGENT.NAME}}: status disabled' priority: INFO description: 'The agent is disabled.' manual_close: 'YES' tags: - tag: scope value: availability - uuid: 98e355d74fe9449eaf28272765865434 name: 'Agent [{#AGENT.NAME}]: version' type: DEPENDENT key: 'agent.version[''{#AGENT.NAME}'']' delay: '0' value_type: TEXT trends: '0' description: 'Gets the version number of an agent.' preprocessing: - type: JSONPATH parameters: - $.version error_handler: CUSTOM_VALUE error_handler_params: Unknown - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h master_item: key: 'agent.stats[''{#AGENT.NAME}'']' tags: - tag: agent-metric value: version - tag: agent-name value: '{#AGENT.NAME}' - tag: component value: agent trigger_prototypes: - uuid: 7c494429411b4ede997a7881e52d9b46 expression: 'last(/Control-M server by HTTP/agent.version[''{#AGENT.NAME}''],#1)="Unknown"' name: 'Control-M: Agent [{#AGENT.NAME}]: unknown version' priority: WARNING description: 'The agent version is unknown.' manual_close: 'YES' tags: - tag: scope value: notice - uuid: e67a46b5c61c43e6b42a966f3d68a581 expression: 'last(/Control-M server by HTTP/agent.version[''{#AGENT.NAME}''],#1)<>last(/Control-M server by HTTP/agent.version[''{#AGENT.NAME}''],#2)' recovery_mode: NONE name: 'Control-M: Agent [{#AGENT.NAME}]: version has changed' opdata: 'Old version: {ITEM.VALUE}, Current version: {ITEM.LASTVALUE1}' priority: INFO description: 'The agent version has changed. Acknowledge to close the problem manually.' manual_close: 'YES' tags: - tag: scope value: notice master_item: key: controlm.agents lld_macro_paths: - lld_macro: '{#AGENT.NAME}' path: $.nodeid preprocessing: - type: JSONPATH parameters: - $.agents error_handler: CUSTOM_VALUE error_handler_params: '[]' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h - uuid: 279c680e12f6443a9b096bec45f9bce4 name: 'Jobs discovery' type: DEPENDENT key: controlm.jobs.discovery delay: '0' lifetime: 1d description: 'Discovers jobs on the server.' item_prototypes: - uuid: bbeb9ab5bcb04f8da802d1a63f098107 name: 'Job [{#JOB.ID}]: held status' type: DEPENDENT key: 'job.held[''{#JOB.ID}'']' delay: '0' description: 'Gets the held status of a job.' valuemap: name: 'Control-M true-false' preprocessing: - type: JSONPATH parameters: - $.held - type: JAVASCRIPT parameters: - | const idx = [ 'false', 'true', ].indexOf(value); return idx !== -1 ? idx : 10; master_item: key: 'job.stats[''{#JOB.ID}'']' tags: - tag: component value: job - tag: job-metric value: held - tag: job-name value: '{#JOB.ID}' - uuid: 2759dacfd8da46e1ad9811093c8897ee name: 'Job [{#JOB.ID}]: number of runs' type: DEPENDENT key: 'job.numberOfRuns[''{#JOB.ID}'']' delay: '0' description: 'Gets the number of runs for a job.' preprocessing: - type: JSONPATH parameters: - $.numberOfRuns - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h master_item: key: 'job.stats[''{#JOB.ID}'']' tags: - tag: component value: job - tag: job-metric value: runs - tag: job-name value: '{#JOB.ID}' - uuid: c73c160f2b8e47c8891d7e22b3a1d1bc name: 'Job [{#JOB.ID}]: stats' type: DEPENDENT key: 'job.stats[''{#JOB.ID}'']' delay: '0' history: '0' value_type: TEXT trends: '0' description: 'Gets the statistics of a job.' preprocessing: - type: JSONPATH parameters: - '$.statuses.[?(@.jobId == ''{#JOB.ID}'')].first()' error_handler: DISCARD_VALUE master_item: key: controlm.jobs tags: - tag: component value: raw - uuid: 1348caa83bc94650ba49231bac41aa18 name: 'Job [{#JOB.ID}]: status' type: DEPENDENT key: 'job.status[''{#JOB.ID}'']' delay: '0' description: 'Gets the status of a job.' valuemap: name: 'Control-M job status' preprocessing: - type: JSONPATH parameters: - $.status - type: JAVASCRIPT parameters: - | const idx = [ 'Ended OK', 'Ended Not OK', 'Wait User', 'Wait Resource', 'Wait Host', 'Wait Workload', 'Wait Condition', 'Executing' ].indexOf(value); return idx !== -1 ? idx : 10; - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h master_item: key: 'job.stats[''{#JOB.ID}'']' tags: - tag: component value: job - tag: job-metric value: status - tag: job-name value: '{#JOB.ID}' trigger_prototypes: - uuid: beec4281ad0f4ca7aa5f3020b116fdfd expression: | last(/Control-M server by HTTP/job.status['{#JOB.ID}'],#1)=1 or last(/Control-M server by HTTP/job.status['{#JOB.ID}'],#1)=10 name: 'Control-M: Job [{#JOB.ID}]: status [{ITEM.VALUE}]' priority: WARNING description: 'The job has encountered an issue.' manual_close: 'YES' tags: - tag: scope value: availability - uuid: 4ec3c06e6ff04e919a7a0f21fa490a25 name: 'Job [{#JOB.ID}]: type' type: DEPENDENT key: 'job.type[''{#JOB.ID}'']' delay: '0' description: 'Gets the job type.' valuemap: name: 'Control-M job type' preprocessing: - type: JSONPATH parameters: - $.type - type: JAVASCRIPT parameters: - | const idx = [ 'Command', 'Script', 'File Transfer', 'File Watcher', 'Database', 'Hadoop', 'Dummy', 'Folder', 'Job' ].indexOf(value); return idx !== -1 ? idx : 10; - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h master_item: key: 'job.stats[''{#JOB.ID}'']' tags: - tag: component value: job - tag: job-metric value: type - tag: job-name value: '{#JOB.ID}' master_item: key: controlm.jobs lld_macro_paths: - lld_macro: '{#JOB.ID}' path: $.jobId preprocessing: - type: JSONPATH parameters: - $.statuses error_handler: CUSTOM_VALUE error_handler_params: '[]' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h tags: - tag: class value: software - tag: target value: controlm macros: - macro: '{$API.TOKEN}' type: SECRET_TEXT description: 'A token to use for API connections.' - macro: '{$API.URI.ENDPOINT}' value: '' description: 'The API endpoint is a URI - for example, `https://monitored.controlm.instance:8443/automation-api`.' - macro: '{$SERVER.NAME}' value: '' description: 'The name of the Control-M server.' dashboards: - uuid: f12c2c57e08a4af19e83dd7b1c867d59 name: 'Control-M Overview' pages: - widgets: - type: graph width: '36' height: '5' fields: - type: GRAPH name: graphid.0 value: host: 'Control-M server by HTTP' name: 'Control-M: Jobs statistics' - type: STRING name: reference value: AAAAA - type: graph x: '36' width: '36' height: '5' fields: - type: GRAPH name: graphid.0 value: host: 'Control-M server by HTTP' name: 'Control-M: Server state' - type: STRING name: reference value: AAAAB valuemaps: - uuid: 55b997715e1e4a4cb5272874b975b43a name: 'Control-M agent status' mappings: - value: '0' newvalue: Available - value: '1' newvalue: Unavailable - value: '2' newvalue: Disabled - value: '3' newvalue: Disable - value: '4' newvalue: Discovering - value: '10' newvalue: Unknown - uuid: 14b119c7f4a940ea91a8df8c4b114eca name: 'Control-M job status' mappings: - value: '0' newvalue: 'Ended OK' - value: '1' newvalue: 'Ended Not OK' - value: '2' newvalue: 'Wait User' - value: '3' newvalue: 'Wait Resource' - value: '4' newvalue: 'Wait Host' - value: '5' newvalue: 'Wait Workload' - value: '6' newvalue: 'Wait Condition' - value: '7' newvalue: Executing - value: '10' newvalue: Unknown - uuid: d6b4e3c8d5934bf08aeb19c8a2f52de4 name: 'Control-M job type' mappings: - value: '0' newvalue: Command - value: '1' newvalue: Script - value: '2' newvalue: 'File Transfer' - value: '3' newvalue: 'File Watcher' - value: '4' newvalue: Database - value: '5' newvalue: Hadoop - value: '6' newvalue: Dummy - value: '7' newvalue: Folder - value: '8' newvalue: Job - value: '10' newvalue: Unknown - uuid: f0e3072f0cc44236802ea58f13ebb3ae name: 'Control-M server status' mappings: - value: '0' newvalue: Down - value: '1' newvalue: Up - value: '10' newvalue: Unknown - uuid: 37a4770c51184c5e9a8d1306625babf3 name: 'Control-M true-false' mappings: - value: '0' newvalue: 'false' - value: '1' newvalue: 'true' - value: '10' newvalue: Unknown graphs: - uuid: afbfbcdb9b0949c7851fc809049d573f name: 'Control-M: Jobs statistics' graph_items: - color: 00FF00 item: host: 'Control-M server by HTTP' key: controlm.jobs.statistics.returned - sortorder: '1' color: 0000FF item: host: 'Control-M server by HTTP' key: controlm.jobs.statistics.total - uuid: 349829f644cd472d8caeae0059ca8527 name: 'Control-M: Server state' graph_items: - color: 00FF00 item: host: 'Control-M server by HTTP' key: server.state