{"id":142,"date":"2024-05-10T10:24:57","date_gmt":"2024-05-10T10:24:57","guid":{"rendered":"https:\/\/www.kwenie.com\/?page_id=142"},"modified":"2025-05-06T12:55:44","modified_gmt":"2025-05-06T12:55:44","slug":"kumomta","status":"publish","type":"page","link":"https:\/\/www.kwenie.com\/index.php\/blog\/kumomta\/","title":{"rendered":"KumoMTA"},"content":{"rendered":"\n<p>As a supporter of Open Source software we support one product in particular which is <a href=\"http:\/\/kumomta.org\">KumoMTA<\/a>. Currently they don&#8217;t support prefab Debian 12 packages. So for now I will create Debian 12 packages of the kumota-dev version so now and then.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<div>\n<iframe style=\"height:300px;width:600px;border:none;\" src=\"https:\/\/www.kwenie.com\/kumomta\/\" title=\"KumoMTA downloads\"><\/iframe>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<p class=\"has-larger-font-size\"><strong>Zabbix KumoMTA metrics template<\/strong><\/p>\n\n\n\n<p>KumoMTA has a nice metrics API on the URL \/metrics.json to fetch data from KumoMTA. I created some items which are in general handy to monitor KumoMTA and a dashboard.<\/p>\n\n\n\n<p>In KumoMTA you do need to configure HTTP API access. I configured it on port 8000 using the following config in the init.lua in the kumo.on(\u00ednit&#8217;, function() section:<\/p>\n\n\n\n<pre class=\"wp-block-code has-background-color has-midnight-gradient-background has-text-color has-background has-small-font-size\"><code>-- Configure HTTP Listeners for injection and management APIs.\n-- See https:\/\/docs.kumomta.com\/userguide\/configuration\/httplisteners\/\nkumo.start_http_listener {\nlisten = '0.0.0.0:8000',\n-- allowed to access any http endpoint without additional auth\ntrusted_hosts = { '127.0.0.1', '::1' , '&lt;internal IP of KumoServer' },\n}<\/code><\/pre>\n\n\n\n<p>For the template to work you only need a working zabbix agent which can do the web.page.get function on the KumoMTA server:<\/p>\n\n\n\n<pre class=\"wp-block-code has-background-color has-midnight-gradient-background has-text-color has-background\"><code>web.page.get&#91;{$KUMOMTA_HOST},\/metrics.json,{$KUMOMTA_PORT}]<\/code><\/pre>\n\n\n\n<p>To get started import the following zabbix_kumomta_temnplate.zip into your Zabbix and assign it to a KumoMTA host.<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-32a1f293-a087-46f9-8eb1-4044b89df08a\" href=\"https:\/\/www.kwenie.com\/nw\/wordpress\/wp-content\/uploads\/2024\/05\/zabbix_kumomta_template.zip\">zabbix_kumomta_template<\/a><a href=\"https:\/\/www.kwenie.com\/nw\/wordpress\/wp-content\/uploads\/2024\/05\/zabbix_kumomta_template.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-32a1f293-a087-46f9-8eb1-4044b89df08a\">Download<\/a><\/div>\n\n\n\n<p>An examample of the Zabbix Dashboard graphs is here:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"571\" src=\"https:\/\/www.kwenie.com\/nw\/wordpress\/wp-content\/uploads\/2024\/05\/KumoMTA_Zabbix_DashboardGraph-1024x571.png\" alt=\"\" class=\"wp-image-154\" srcset=\"https:\/\/www.kwenie.com\/nw\/wordpress\/wp-content\/uploads\/2024\/05\/KumoMTA_Zabbix_DashboardGraph-1024x571.png 1024w, https:\/\/www.kwenie.com\/nw\/wordpress\/wp-content\/uploads\/2024\/05\/KumoMTA_Zabbix_DashboardGraph-300x167.png 300w, https:\/\/www.kwenie.com\/nw\/wordpress\/wp-content\/uploads\/2024\/05\/KumoMTA_Zabbix_DashboardGraph-768x428.png 768w, https:\/\/www.kwenie.com\/nw\/wordpress\/wp-content\/uploads\/2024\/05\/KumoMTA_Zabbix_DashboardGraph-1536x856.png 1536w, https:\/\/www.kwenie.com\/nw\/wordpress\/wp-content\/uploads\/2024\/05\/KumoMTA_Zabbix_DashboardGraph-1200x669.png 1200w, https:\/\/www.kwenie.com\/nw\/wordpress\/wp-content\/uploads\/2024\/05\/KumoMTA_Zabbix_DashboardGraph.png 1835w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Local zabbix script on KumoMTA server<\/h4>\n\n\n\n<p>Little update on 2025-05-06<br>Apparently this only works if you don&#8217;t have that many queues in KumoMTA, otherwise the API request will send too much info and Zabbix will choke on it.<\/p>\n\n\n\n<p>So for most uses you will need to use a script on the local KumoMTA server to filter info from the API call:<br>vi \/usr\/local\/bin\/get_kumomta_stats.sh<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\nPARAMETER=$1\ncurl -s http:\/\/localhost:8000\/metrics.json | jq .${PARAMETER}<\/code><\/pre>\n\n\n\n<p>Make the file executable using:<br><code>chmod 755 \/usr\/local\/bin\/get_kumomta_stats.sh<\/code><\/p>\n\n\n\n<p>zabbix_agentd.d\/kumomta-script.conf:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>UserParameter=kumomta&#91;*], bash \/usr\/local\/bin\/get_kumomta_stats.sh $1\n<\/code><\/pre>\n\n\n\n<p>The zabbix template looks like:<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>zabbix_export:\n  version: '6.4'\n  template_groups:\n    - uuid: dc579cd7a1a34222933f24f52a68bcd8\n      name: 'Linux servers'\n  templates:\n    - uuid: b06e8e57c49445729ca8cdd4ea3a2e4a\n      template: 'Template KumoMTA Stats'\n      name: 'Template KumoMTA Stats'\n      description: 'Template to filter out generic Metric information of KumoMTA using a script in \/usr\/local\/bin\/get_kumomta_stats.sh'\n      groups:\n        - name: 'Linux servers'\n      items:\n        - uuid: e54038aae17f4ef8825946a8aae1a13b\n          name: 'Kumo: connection count smtp_client'\n          key: 'kumomta&#91;connection_count.value.service.smtp_client]'\n          description: 'connection count of the smtp_client'\n        - uuid: 0d9d104c9f214cd1ad9e213fbf4168de\n          name: 'Kumo: Memory Usage'\n          key: 'kumomta&#91;memory_usage.value]'\n          description: 'Messages Delivered in Kumomta'\n          preprocessing:\n            - type: MULTIPLIER\n              parameters:\n                - '0.000001'\n        - uuid: 4b82210a0b1f4f79810107edf12ea12c\n          name: 'Kumo: Message count'\n          key: 'kumomta&#91;message_count.value]'\n          description: 'Number of messages in Kumomta'\n        - uuid: 2df3e4ab1a2449c5af45fddc69f2e327\n          name: 'Kumo: Messages Delivered'\n          key: 'kumomta&#91;total_messages_delivered.value.service.smtp_client]'\n          description: 'Messages Delivered in Kumomta'\n          preprocessing:\n            - type: SIMPLE_CHANGE\n              parameters:\n                - ''\n        - uuid: 54c7fe4ad90642be90388d256efc339f\n          name: 'Kumo: Messages failed'\n          key: 'kumomta&#91;total_messages_fail.value.service.smtp_client]'\n          description: 'Failed messages in Kumomta'\n          preprocessing:\n            - type: SIMPLE_CHANGE\n              parameters:\n                - ''\n        - uuid: 614fd94521bb4350beb1479d41d9ca2e\n          name: 'Kumo: Messages Transfail'\n          key: 'kumomta&#91;total_messages_transfail.value.service.smtp_client]'\n          description: 'Transient failed messages in Kumomta'\n          preprocessing:\n            - type: SIMPLE_CHANGE\n              parameters:\n                - ''\n      tags:\n        - tag: kumomta\n          value: 'true'\n      macros:\n        - macro: '{$KUMOMTA_HOST}'\n          value: 127.0.0.1\n          description: 'The IP address of the KumoMTA server for fetching metrics.json'\n        - macro: '{$KUMOMTA_LOG_HOOK}'\n          value: log_hook\n        - macro: '{$KUMOMTA_PORT}'\n          value: '8000'\n          description: 'The Port of the above KumoMTA server for fetching metrics.json'\n  graphs:\n    - uuid: 6d1af032ed8746b885596fab8c9887f2\n      name: 'Kumo: Message count'\n      graph_items:\n        - sortorder: '1'\n          color: 1A7C11\n          item:\n            host: 'Template KumoMTA Stats'\n            key: 'kumomta&#91;message_count.value]'<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>As a supporter of Open Source software we support one product in particular which is KumoMTA. Currently they don&#8217;t support prefab Debian 12 packages. So for now I will create Debian 12 packages of the kumota-dev version so now and then. Zabbix KumoMTA metrics template KumoMTA has a nice metrics API on the URL \/metrics.json [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":21,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-142","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.kwenie.com\/index.php\/wp-json\/wp\/v2\/pages\/142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kwenie.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.kwenie.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.kwenie.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kwenie.com\/index.php\/wp-json\/wp\/v2\/comments?post=142"}],"version-history":[{"count":0,"href":"https:\/\/www.kwenie.com\/index.php\/wp-json\/wp\/v2\/pages\/142\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.kwenie.com\/index.php\/wp-json\/wp\/v2\/pages\/21"}],"wp:attachment":[{"href":"https:\/\/www.kwenie.com\/index.php\/wp-json\/wp\/v2\/media?parent=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}