Aller au contenu principal

template-apache

Ce template est un fichier de configuration pour Zabbix, un outil de surveillance de réseau et d'infrastructure. Il est utilisé pour surveiller un serveur Apache, un serveur web populaire. Le template est structuré en JSON et contient plusieurs sections qui définissent comment Zabbix doit collecter et afficher les données de performance et de statut d'Apache.

{
"zabbix_export": {
"version": "7.2",
"template_groups": [
{
"uuid": "a571c0d144b14fd4a87a9d9b2aa9fcd6",
"name": "Templates/Applications"
}
],
"templates": [
{
"uuid": "a8d91e4f36794e32b73090d5edf3d7ae",
"template": "TPL_APACHE_MEKOO",
"name": "TPL_APACHE_MEKOO",
"description": "Get metrics from mod_status module using HTTP agent.\nhttps://httpd.apache.org/docs/current/mod/mod_status.html\n\nYou can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384764-discussion-thread-for-official-zabbix-template-apache\n\nGenerated by official Zabbix template tool \"Templator\"",
"vendor": {
"name": "Zabbix",
"version": "7.2-1"
},
"groups": [
{
"name": "Templates/Applications"
}
],
"items": [
{
"uuid": "2d3ebb059bd944ee8a7b95e2c60b08f0",
"name": "Total bytes",
"type": "DEPENDENT",
"key": "apache.bytes",
"value_type": "FLOAT",
"units": "B",
"description": "The total bytes served.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$[\"Total kBytes\"]"
]
},
{
"type": "MULTIPLIER",
"parameters": [
"1024"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "network"
}
]
},
{
"uuid": "be97c53d82f846cdbc2d0ec640435b6f",
"name": "Bytes per second",
"type": "DEPENDENT",
"key": "apache.bytes.rate",
"value_type": "FLOAT",
"units": "Bps",
"description": "It is calculated as a rate of change for total bytes statistics.\n`BytesPerSec` is not used, as it counts the average since the last Apache server start.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$[\"Total kBytes\"]"
]
},
{
"type": "MULTIPLIER",
"parameters": [
"1024"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "network"
}
]
},
{
"uuid": "5919f29c692b468fb5642e83f408c2e5",
"name": "Total requests",
"type": "DEPENDENT",
"key": "apache.requests",
"description": "The total number of the Apache server accesses.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$[\"Total Accesses\"]"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "network"
}
]
},
{
"uuid": "7e1e674a23d24fafa31b76a048fe9fd0",
"name": "Requests per second",
"type": "DEPENDENT",
"key": "apache.requests.rate",
"value_type": "FLOAT",
"description": "It is calculated as a rate of change for the \"Total requests\" statistics.\n`ReqPerSec` is not used, as it counts the average since the last Apache server start.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$[\"Total Accesses\"]"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "network"
}
]
},
{
"uuid": "5a4bd2d6c2874d888ec4c82409e1c711",
"name": "Uptime",
"type": "DEPENDENT",
"key": "apache.uptime",
"units": "uptime",
"description": "The service uptime expressed in seconds.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.ServerUptimeSeconds"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
],
"triggers": [
{
"uuid": "7872d9665c234f45941ca26206e0255c",
"expression": "last(/TPL_APACHE_MEKOO/apache.uptime)<10m",
"name": "Apache: Service has been restarted",
"event_name": "Apache: Service has been restarted (uptime < 10m)",
"priority": "INFO",
"description": "Uptime is less than 10 minutes.",
"manual_close": "YES",
"tags": [
{
"tag": "scope",
"value": "notice"
}
]
}
]
},
{
"uuid": "78a611c2b15c4ae8949257b6fdf922f1",
"name": "Version",
"type": "DEPENDENT",
"key": "apache.version",
"value_type": "CHAR",
"description": "The Apache service version.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.ServerVersion"
]
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"1d"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
],
"triggers": [
{
"uuid": "5124b17918f545758ca5c936332f51cd",
"expression": "last(/TPL_APACHE_MEKOO/apache.version,#1)<>last(/TPL_APACHE_MEKOO/apache.version,#2) and length(last(/TPL_APACHE_MEKOO/apache.version))>0",
"name": "Apache: Version has changed",
"event_name": "Apache: Version has changed (new version: {ITEM.VALUE})",
"priority": "INFO",
"description": "Apache version has changed. Acknowledge to close the problem manually.",
"manual_close": "YES",
"tags": [
{
"tag": "scope",
"value": "notice"
}
]
}
]
},
{
"uuid": "35f48761ec6d451bbb8b0d80cd0ccd91",
"name": "Workers idle cleanup",
"type": "DEPENDENT",
"key": "apache.workers.cleanup",
"description": "The number of workers in cleanup state.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.Workers.cleanup"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
]
},
{
"uuid": "ebd391702cbd432ab458578a3cb45361",
"name": "Workers closing connection",
"type": "DEPENDENT",
"key": "apache.workers.closing",
"description": "The number of workers in closing state.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.Workers.closing"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
]
},
{
"uuid": "6a961707e7084d8ebc09f572b15ef1fd",
"name": "Workers DNS lookup",
"type": "DEPENDENT",
"key": "apache.workers.dnslookup",
"description": "The number of workers in `dnslookup` state.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.Workers.dnslookup"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
]
},
{
"uuid": "fd383c9ace4647deb9d3e3882554b8d0",
"name": "Workers finishing",
"type": "DEPENDENT",
"key": "apache.workers.finishing",
"description": "The number of workers in finishing state.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.Workers.finishing"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
]
},
{
"uuid": "2a02413c0e9144b4a70b8a5a71d680e0",
"name": "Workers keepalive (read)",
"type": "DEPENDENT",
"key": "apache.workers.keepalive",
"description": "The number of workers in `keepalive` state.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.Workers.keepalive"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
]
},
{
"uuid": "ed71fb2ec75f4537a2937293add75274",
"name": "Workers logging",
"type": "DEPENDENT",
"key": "apache.workers.logging",
"description": "The number of workers in logging state.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.Workers.logging"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
]
},
{
"uuid": "6c38147f9f3449a194f36a6e6d828865",
"name": "Workers reading request",
"type": "DEPENDENT",
"key": "apache.workers.reading",
"description": "The number of workers in reading state.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.Workers.reading"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
]
},
{
"uuid": "47856ac3b68644e0861b593d3083d35b",
"name": "Workers sending reply",
"type": "DEPENDENT",
"key": "apache.workers.sending",
"description": "The number of workers in sending state.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.Workers.sending"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
]
},
{
"uuid": "60cf954a40594cf69afdd1bf0319c031",
"name": "Workers slot with no current process",
"type": "DEPENDENT",
"key": "apache.workers.slot",
"description": "The number of slots with no current process.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.Workers.slot"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
]
},
{
"uuid": "441c797164bf4c8da8112d78240abc43",
"name": "Workers starting up",
"type": "DEPENDENT",
"key": "apache.workers.starting",
"description": "The number of workers in starting state.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.Workers.starting"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
]
},
{
"uuid": "ec87e89ee9304acd8c7a76e863cb4443",
"name": "Workers waiting for connection",
"type": "DEPENDENT",
"key": "apache.workers.waiting",
"description": "The number of workers in waiting state.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.Workers.waiting"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
]
},
{
"uuid": "b52addb50ccb415fb63eaf67076991c1",
"name": "Total workers busy",
"type": "DEPENDENT",
"key": "apache.workers_total.busy",
"description": "The total number of busy worker threads/processes.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.BusyWorkers"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
]
},
{
"uuid": "6955f78c203b435987b5ab75a1114867",
"name": "Total workers idle",
"type": "DEPENDENT",
"key": "apache.workers_total.idle",
"description": "The total number of idle worker threads/processes.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.IdleWorkers"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
]
},
{
"uuid": "267ca6fe038346e5be1113f3bf9b4023",
"name": "Service response time",
"key": "net.tcp.service.perf[http,\"{$APACHE.STATUS.HOST}\",\"{$APACHE.STATUS.PORT}\"]",
"value_type": "FLOAT",
"units": "s",
"tags": [
{
"tag": "component",
"value": "application"
},
{
"tag": "component",
"value": "health"
}
]
},
{
"uuid": "369f00e2970048c786ce3bd609e65566",
"name": "Service ping",
"key": "net.tcp.service[http,\"{$APACHE.STATUS.HOST}\",\"{$APACHE.STATUS.PORT}\"]",
"valuemap": {
"name": "Service state"
},
"preprocessing": [
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"10m"
]
}
],
"tags": [
{
"tag": "component",
"value": "application"
},
{
"tag": "component",
"value": "health"
}
]
},
{
"uuid": "99b1a38ed45b4212974b0bea72b076d2",
"name": "Get processes summary",
"key": "proc.get[{$APACHE.PROCESS.NAME.PARAMETER},,,summary]",
"history": "0",
"value_type": "TEXT",
"description": "The aggregated data of summary metrics for all processes.",
"tags": [
{
"tag": "component",
"value": "raw"
}
]
},
{
"uuid": "115413a0f5ab4caba418ab841ad81eba",
"name": "Get status",
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]",
"history": "1h",
"value_type": "TEXT",
"description": "Getting data from a machine-readable version of the Apache status page.\nFor more information see Apache Module [mod_status](https://httpd.apache.org/docs/current/mod/mod_status.html).",
"preprocessing": [
{
"type": "JAVASCRIPT",
"parameters": [
"var lines = value.split('\\n');\nvar output = {},\n\tworkers = {\n\t\t'_': 0, 'S': 0, 'R': 0, 'W': 0,\n\t\t'K': 0, 'D': 0, 'C': 0, 'L': 0,\n\t\t'G': 0, 'I': 0, '.': 0\n\t};\n\nfor (var i = 0; i < lines.length; i++) {\n\tvar line = lines[i].match(/([A-z0-9 ]+): (.*)/);\n\n\tif (line !== null) {\n\t\toutput[line[1]] = isNaN(line[2]) ? line[2] : Number(line[2]);\n\t}\n}\n\noutput.ServerUptimeSeconds = output.ServerUptimeSeconds || output.Uptime;\noutput.ServerVersion = output.ServerVersion || output.Server;\n\nif (typeof output.Scoreboard === 'string') {\n\tfor (var i = 0; i < output.Scoreboard.length; i++) {\n\t\tvar char = output.Scoreboard[i];\n\n\t\tworkers[char]++;\n\t}\n}\n\noutput.Workers = {\n\twaiting: workers['_'], starting: workers['S'], reading: workers['R'],\n\tsending: workers['W'], keepalive: workers['K'], dnslookup: workers['D'],\n\tclosing: workers['C'], logging: workers['L'], finishing: workers['G'],\n\tcleanup: workers['I'], slot: workers['.']\n};\n\nreturn JSON.stringify(output);"
]
}
],
"tags": [
{
"tag": "component",
"value": "raw"
}
]
}
],
"discovery_rules": [
{
"uuid": "36a82bdda7754c51a05da3bb0b65b83e",
"name": "Event MPM discovery",
"type": "DEPENDENT",
"key": "apache.mpm.event.discovery",
"description": "The discovery of additional metrics if the event Multi-Processing Module (MPM) is used.\nFor more details see [Apache MPM event](https://httpd.apache.org/docs/current/mod/event.html).",
"item_prototypes": [
{
"uuid": "99df2ff5970b4497887371bcd16d5ada",
"name": "Bytes per request",
"type": "DEPENDENT",
"key": "apache.bytes[per_request{#SINGLETON}]",
"value_type": "FLOAT",
"units": "B",
"description": "The average number of client requests per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.BytesPerReq"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "connection"
}
]
},
{
"uuid": "2e0692f36b924b52ab7b2ff7788b641d",
"name": "Connections async closing",
"type": "DEPENDENT",
"key": "apache.connections[async_closing{#SINGLETON}]",
"description": "The number of asynchronous connections in closing state (applicable only to the event MPM).",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.ConnsAsyncClosing"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "connection"
}
]
},
{
"uuid": "33d3fec8f45c493097bab986d5ea1e55",
"name": "Connections async keepalive",
"type": "DEPENDENT",
"key": "apache.connections[async_keep_alive{#SINGLETON}]",
"description": "The number of asynchronous connections in keepalive state (applicable only to the event MPM).",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.ConnsAsyncKeepAlive"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "connection"
}
]
},
{
"uuid": "9ad0e5c49e7c4b939eb7977a5158953f",
"name": "Connections async writing",
"type": "DEPENDENT",
"key": "apache.connections[async_writing{#SINGLETON}]",
"description": "The number of asynchronous connections in writing state (applicable only to the event MPM).",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.ConnsAsyncWriting"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "connection"
}
]
},
{
"uuid": "0fbfbfae187040c790bb4d68f9e2fae5",
"name": "Connections total",
"type": "DEPENDENT",
"key": "apache.connections[total{#SINGLETON}]",
"description": "The number of total connections.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.ConnsTotal"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "connection"
}
]
},
{
"uuid": "778a1bfeaa1b474ba529e6c0a55a9949",
"name": "Number of async processes",
"type": "DEPENDENT",
"key": "apache.process[num{#SINGLETON}]",
"description": "The number of asynchronous processes.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.Processes"
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
]
}
],
"graph_prototypes": [
{
"uuid": "4845e6716bd74e7698406e6d8389eba5",
"name": "Apache: Current async connections{#SINGLETON}",
"graph_items": [
{
"color": "199C0D",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.connections[async_closing{#SINGLETON}]"
}
},
{
"sortorder": "1",
"color": "F63100",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.connections[async_keep_alive{#SINGLETON}]"
}
},
{
"sortorder": "2",
"color": "00611C",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.connections[async_writing{#SINGLETON}]"
}
},
{
"sortorder": "3",
"drawtype": "BOLD_LINE",
"color": "F7941D",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.connections[total{#SINGLETON}]"
}
}
]
},
{
"uuid": "19ecb4e04c3742daac1a0e06d5f98c0c",
"name": "Apache: Current async processes{#SINGLETON}",
"graph_items": [
{
"drawtype": "GRADIENT_LINE",
"color": "199C0D",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.process[num{#SINGLETON}]"
}
}
]
}
],
"master_item": {
"key": "web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"]"
},
"preprocessing": [
{
"type": "JAVASCRIPT",
"parameters": [
"return JSON.stringify(JSON.parse(value).ServerMPM === 'event'\n\t? [{'{#SINGLETON}': ''}] : []);"
]
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"3h"
]
}
]
},
{
"uuid": "357a2a1f056a4f59985e858d72e0bdae",
"name": "Apache process discovery",
"type": "DEPENDENT",
"key": "apache.proc.discovery",
"filter": {
"evaltype": "AND",
"conditions": [
{
"macro": "{#APACHE.NAME}",
"value": "{$APACHE.PROCESS_NAME}"
}
]
},
"description": "The discovery of the Apache process summary.",
"item_prototypes": [
{
"uuid": "458bfecc83f64540838e3ffc3a7f3cb1",
"name": "Get process data",
"type": "DEPENDENT",
"key": "apache.proc.get[{#APACHE.NAME}]",
"history": "0",
"value_type": "TEXT",
"description": "The summary metrics aggregated by a process {#APACHE.NAME}.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.[?(@[\"name\"]==\"{#APACHE.NAME}\")].first()"
],
"error_handler": "CUSTOM_VALUE",
"error_handler_params": "Failed to retrieve process {#APACHE.NAME} data"
}
],
"master_item": {
"key": "proc.get[{$APACHE.PROCESS.NAME.PARAMETER},,,summary]"
},
"tags": [
{
"tag": "component",
"value": "raw"
}
]
},
{
"uuid": "233b5466014640e4b990ffd81fa19fa1",
"name": "Number of running processes",
"type": "DEPENDENT",
"key": "apache.proc.num[{#APACHE.NAME}]",
"description": "The number of running processes {#APACHE.NAME}.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.processes"
],
"error_handler": "CUSTOM_VALUE",
"error_handler_params": "0"
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"1h"
]
}
],
"master_item": {
"key": "apache.proc.get[{#APACHE.NAME}]"
},
"tags": [
{
"tag": "component",
"value": "system"
}
],
"trigger_prototypes": [
{
"uuid": "b62f49b09d6b4c6ca01ff60cd9dd2209",
"expression": "last(/TPL_APACHE_MEKOO/apache.proc.num[{#APACHE.NAME}])=0",
"name": "Apache: Process is not running",
"priority": "HIGH",
"tags": [
{
"tag": "scope",
"value": "availability"
}
]
}
]
},
{
"uuid": "683d4489dbb549f3bb5b45d3c2696c4f",
"name": "Memory usage, %",
"type": "DEPENDENT",
"key": "apache.proc.pmem[{#APACHE.NAME}]",
"value_type": "FLOAT",
"units": "%",
"description": "The percentage of real memory used by a process {#APACHE.NAME}.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.pmem"
],
"error_handler": "DISCARD_VALUE"
}
],
"master_item": {
"key": "apache.proc.get[{#APACHE.NAME}]"
},
"tags": [
{
"tag": "component",
"value": "memory"
}
]
},
{
"uuid": "384bf197e6a241b3b63bb89d009bba6b",
"name": "Memory usage (rss)",
"type": "DEPENDENT",
"key": "apache.proc.rss[{#APACHE.NAME}]",
"units": "B",
"description": "The summary of resident set size memory used by a process {#APACHE.NAME} expressed in bytes.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.rss"
],
"error_handler": "DISCARD_VALUE"
}
],
"master_item": {
"key": "apache.proc.get[{#APACHE.NAME}]"
},
"tags": [
{
"tag": "component",
"value": "memory"
}
]
},
{
"uuid": "f20b7a01ff134a128c54ea83af8557e2",
"name": "Memory usage (vsize)",
"type": "DEPENDENT",
"key": "apache.proc.vmem[{#APACHE.NAME}]",
"units": "B",
"description": "The summary of virtual memory used by a process {#APACHE.NAME} expressed in bytes.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.vsize"
],
"error_handler": "DISCARD_VALUE"
}
],
"master_item": {
"key": "apache.proc.get[{#APACHE.NAME}]"
},
"tags": [
{
"tag": "component",
"value": "memory"
}
]
},
{
"uuid": "b73280fb0af64c7899abfc74cc074b13",
"name": "CPU utilization",
"key": "proc.cpu.util[{#APACHE.NAME}]",
"value_type": "FLOAT",
"units": "%",
"description": "The percentage of the CPU utilization by a process {#APACHE.NAME}.",
"tags": [
{
"tag": "component",
"value": "cpu"
}
]
}
],
"trigger_prototypes": [
{
"uuid": "0166ec63913e4bbea25c54b458b3213a",
"expression": "nodata(/TPL_APACHE_MEKOO/web.page.get[\"{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}\"],30m)=1 and last(/TPL_APACHE_MEKOO/apache.proc.num[{#APACHE.NAME}])>0",
"name": "Apache: Failed to fetch status page",
"event_name": "Apache: Failed to fetch status page (or no data for 30m)",
"priority": "WARNING",
"description": "Zabbix has not received any data for items for the last 30 minutes.",
"manual_close": "YES",
"dependencies": [
{
"name": "Apache: Service is down",
"expression": "last(/TPL_APACHE_MEKOO/net.tcp.service[http,\"{$APACHE.STATUS.HOST}\",\"{$APACHE.STATUS.PORT}\"])=0 and last(/TPL_APACHE_MEKOO/apache.proc.num[{#APACHE.NAME}])>0"
}
],
"tags": [
{
"tag": "scope",
"value": "availability"
}
]
},
{
"uuid": "e24dbf9b89c34d839cb12a22b1103df3",
"expression": "last(/TPL_APACHE_MEKOO/net.tcp.service[http,\"{$APACHE.STATUS.HOST}\",\"{$APACHE.STATUS.PORT}\"])=0 and last(/TPL_APACHE_MEKOO/apache.proc.num[{#APACHE.NAME}])>0",
"name": "Apache: Service is down",
"priority": "AVERAGE",
"manual_close": "YES",
"tags": [
{
"tag": "scope",
"value": "availability"
}
]
},
{
"uuid": "128905793a4b4a1db5a49f87e87d3383",
"expression": "min(/TPL_APACHE_MEKOO/net.tcp.service.perf[http,\"{$APACHE.STATUS.HOST}\",\"{$APACHE.STATUS.PORT}\"],5m)>{$APACHE.RESPONSE_TIME.MAX.WARN} and last(/TPL_APACHE_MEKOO/apache.proc.num[{#APACHE.NAME}])>0",
"name": "Apache: Service response time is too high",
"event_name": "Apache: Service response time is too high (over {$APACHE.RESPONSE_TIME.MAX.WARN}s for 5m)",
"priority": "WARNING",
"manual_close": "YES",
"dependencies": [
{
"name": "Apache: Service is down",
"expression": "last(/TPL_APACHE_MEKOO/net.tcp.service[http,\"{$APACHE.STATUS.HOST}\",\"{$APACHE.STATUS.PORT}\"])=0 and last(/TPL_APACHE_MEKOO/apache.proc.num[{#APACHE.NAME}])>0"
}
],
"tags": [
{
"tag": "scope",
"value": "performance"
}
]
}
],
"graph_prototypes": [
{
"uuid": "d317a2ccde4f4a2ab20e983b27ae64e2",
"name": "Apache: Memory usage[{#APACHE.NAME}]",
"graph_items": [
{
"drawtype": "BOLD_LINE",
"color": "199C0D",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.proc.vmem[{#APACHE.NAME}]"
}
},
{
"sortorder": "1",
"drawtype": "BOLD_LINE",
"color": "F63100",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.proc.rss[{#APACHE.NAME}]"
}
}
]
}
],
"master_item": {
"key": "proc.get[{$APACHE.PROCESS.NAME.PARAMETER},,,summary]"
},
"lld_macro_paths": [
{
"lld_macro": "{#APACHE.NAME}",
"path": "$.name"
}
]
}
],
"tags": [
{
"tag": "class",
"value": "software"
},
{
"tag": "target",
"value": "apache"
}
],
"macros": [
{
"macro": "{$APACHE.PROCESS.NAME.PARAMETER}",
"description": "The process name of the Apache web server used in the item key `proc.get`. It could be specified if the correct process name is known."
},
{
"macro": "{$APACHE.PROCESS_NAME}",
"value": "(httpd|apache2)",
"description": "The process name filter for the Apache process discovery."
},
{
"macro": "{$APACHE.RESPONSE_TIME.MAX.WARN}",
"value": "10",
"description": "The maximum Apache response time expressed in seconds for a trigger expression."
},
{
"macro": "{$APACHE.STATUS.HOST}",
"value": "127.0.0.1",
"description": "The hostname or IP address of the Apache status page."
},
{
"macro": "{$APACHE.STATUS.PATH}",
"value": "server-status?auto",
"description": "The URL path."
},
{
"macro": "{$APACHE.STATUS.PORT}",
"value": "80",
"description": "The port of the Apache status page."
},
{
"macro": "{$APACHE.STATUS.SCHEME}",
"value": "http",
"description": "The request scheme, which may be either HTTP or HTTPS."
}
],
"dashboards": [
{
"uuid": "c27c68fb9c234a09b4023076b45affc1",
"name": "Apache performance",
"pages": [
{
"name": "General",
"widgets": [
{
"type": "graph",
"width": "72",
"height": "7",
"fields": [
{
"type": "GRAPH",
"name": "graphid.0",
"value": {
"host": "TPL_APACHE_MEKOO",
"name": "Apache: Worker states"
}
},
{
"type": "STRING",
"name": "reference",
"value": "AAAAA"
}
]
},
{
"type": "graph",
"y": "7",
"width": "36",
"height": "5",
"fields": [
{
"type": "GRAPH",
"name": "graphid.0",
"value": {
"host": "TPL_APACHE_MEKOO",
"name": "Apache: Requests per second"
}
},
{
"type": "STRING",
"name": "reference",
"value": "AAAAB"
}
]
},
{
"type": "graphprototype",
"y": "12",
"width": "36",
"height": "5",
"fields": [
{
"type": "INTEGER",
"name": "columns",
"value": "1"
},
{
"type": "GRAPH_PROTOTYPE",
"name": "graphid.0",
"value": {
"host": "TPL_APACHE_MEKOO",
"name": "Apache: Current async connections{#SINGLETON}"
}
},
{
"type": "STRING",
"name": "reference",
"value": "AAAAD"
}
]
},
{
"type": "graph",
"x": "36",
"y": "7",
"width": "36",
"height": "5",
"fields": [
{
"type": "GRAPH",
"name": "graphid.0",
"value": {
"host": "TPL_APACHE_MEKOO",
"name": "Apache: Workers total"
}
},
{
"type": "STRING",
"name": "reference",
"value": "AAAAC"
}
]
},
{
"type": "graphprototype",
"x": "36",
"y": "12",
"width": "36",
"height": "5",
"fields": [
{
"type": "INTEGER",
"name": "columns",
"value": "1"
},
{
"type": "GRAPH_PROTOTYPE",
"name": "graphid.0",
"value": {
"host": "TPL_APACHE_MEKOO",
"name": "Apache: Current async processes{#SINGLETON}"
}
},
{
"type": "STRING",
"name": "reference",
"value": "AAAAE"
}
]
}
]
}
]
}
],
"valuemaps": [
{
"uuid": "452297e814a84b08a72730a7b777e378",
"name": "Service state",
"mappings": [
{
"value": "0",
"newvalue": "Down"
},
{
"value": "1",
"newvalue": "Up"
}
]
}
]
}
],
"graphs": [
{
"uuid": "dfc5334e77ce45d286145cc08d036f38",
"name": "Apache: Requests per second",
"graph_items": [
{
"drawtype": "GRADIENT_LINE",
"color": "199C0D",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.requests.rate"
}
}
]
},
{
"uuid": "6f646e8c11b04e8a835b81bc17824593",
"name": "Apache: Worker states",
"graph_items": [
{
"color": "199C0D",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.workers.dnslookup"
}
},
{
"sortorder": "1",
"color": "F63100",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.workers.cleanup"
}
},
{
"sortorder": "2",
"color": "00611C",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.workers.logging"
}
},
{
"sortorder": "3",
"color": "F7941D",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.workers.reading"
}
},
{
"sortorder": "4",
"color": "FC6EA3",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.workers.sending"
}
},
{
"sortorder": "5",
"color": "6C59DC",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.workers.starting"
}
},
{
"sortorder": "6",
"color": "C7A72D",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.workers.closing"
}
},
{
"sortorder": "7",
"color": "BA2A5D",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.workers.finishing"
}
},
{
"sortorder": "8",
"color": "F230E0",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.workers.keepalive"
}
},
{
"sortorder": "9",
"color": "5CCD18",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.workers.slot"
}
},
{
"sortorder": "10",
"color": "BB2A02",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.workers.waiting"
}
}
]
},
{
"uuid": "121c2d4feb0b4b53b027f1566107ab29",
"name": "Apache: Workers total",
"type": "STACKED",
"graph_items": [
{
"color": "199C0D",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.workers_total.busy"
}
},
{
"sortorder": "1",
"color": "F63100",
"item": {
"host": "TPL_APACHE_MEKOO",
"key": "apache.workers_total.idle"
}
}
]
}
]
}
}

Structure du Template

  1. Version:

    • "version": "7.2" : Indique la version de Zabbix pour laquelle ce template est conçu.
  2. Groupes de Templates:

    • "template_groups" : Définit un groupe de templates appelé "Templates/Applications". Ce groupe est utilisé pour organiser les templates dans Zabbix.
  3. Templates:

    • "templates" : Contient un seul template nommé "TPL_APACHE_MEKOO". Ce template est spécifiquement conçu pour surveiller un serveur Apache.

    • Description:

      • Le template est conçu pour collecter des métriques à partir du module mod_status d'Apache, qui fournit des informations sur l'état du serveur web.
    • Items:

      • Les "items" sont des éléments de données que Zabbix surveille. Chaque item a un nom, un type, une clé, et d'autres attributs qui définissent comment les données sont collectées et traitées.
      • Exemples d'items :
        • "Total bytes" : Surveille le nombre total d'octets servis par Apache.
        • "Requests per second" : Surveille le nombre de requêtes par seconde.
        • "Uptime" : Surveille le temps de fonctionnement du serveur Apache.
        • "Version" : Surveille la version d'Apache en cours d'exécution.
        • "Workers" : Surveille l'état des workers (processus ou threads) d'Apache, comme ceux en attente, en lecture, en écriture, etc.
    • Triggers:

      • Les "triggers" sont des conditions qui déclenchent des alertes. Par exemple, un trigger peut être configuré pour alerter si le temps de fonctionnement d'Apache est inférieur à 10 minutes, ce qui pourrait indiquer un redémarrage récent.
    • Discovery Rules:

      • Les "discovery rules" sont utilisées pour découvrir automatiquement des éléments à surveiller. Par exemple, ce template inclut une règle de découverte pour les processus Apache et les connexions asynchrones.
    • Graphs:

      • Les "graphs" sont des représentations visuelles des données collectées. Par exemple, un graphique peut montrer le nombre de requêtes par seconde ou l'état des workers d'Apache.
    • Dashboards:

      • Les "dashboards" sont des tableaux de bord personnalisés qui affichent des graphiques et des informations clés. Ce template inclut un tableau de bord appelé "Apache performance" qui affiche des graphiques sur les performances d'Apache.
    • Macros:

      • Les "macros" sont des variables qui peuvent être utilisées pour personnaliser le template. Par exemple, {$APACHE.STATUS.HOST} peut être défini pour spécifier l'hôte où Apache est en cours d'exécution.
    • Valuemaps:

      • Les "valuemaps" sont utilisées pour mapper des valeurs brutes à des valeurs plus lisibles. Par exemple, une valuemap peut mapper la valeur 1 à "Up" (en ligne) et 0 à "Down" (hors ligne).

Fonctionnalités Principales

  • Surveillance des Métriques d'Apache:

    • Le template surveille des métriques clés comme le nombre de requêtes, le nombre d'octets servis, le temps de fonctionnement, et l'état des workers.
  • Alertes Automatiques:

    • Des triggers sont configurés pour alerter en cas de problèmes, comme un redémarrage récent d'Apache ou une augmentation du temps de réponse.
  • Découverte Automatique:

    • Le template peut découvrir automatiquement les processus Apache et les connexions asynchrones, ce qui facilite la surveillance dans des environnements dynamiques.
  • Visualisation des Données:

    • Les graphiques et tableaux de bord fournissent une vue claire et concise des performances d'Apache, facilitant l'analyse et le dépannage.

Utilisation

Pour utiliser ce template dans Zabbix, vous devez l'importer dans votre instance Zabbix et l'appliquer aux hôtes qui exécutent Apache. Vous devrez peut-être ajuster les macros pour correspondre à votre environnement spécifique (par exemple, l'adresse IP ou le port du serveur Apache).

En résumé, ce template est un outil puissant pour surveiller et analyser les performances d'un serveur Apache, en fournissant des alertes en temps réel et des visualisations claires des données de performance.