{"id":12636,"date":"2022-05-07T23:39:05","date_gmt":"2022-05-07T20:39:05","guid":{"rendered":"https:\/\/kifarunix.com\/?p=12636"},"modified":"2024-03-09T14:13:34","modified_gmt":"2024-03-09T11:13:34","slug":"monitor-windows-system-metrics-using-sensu","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/monitor-windows-system-metrics-using-sensu\/","title":{"rendered":"Monitor Windows System Metrics using Sensu"},"content":{"rendered":"\n<p>Follow through this guide to learn how you can easily monitor Windows system metrics using Sensu. <a href=\"https:\/\/sensu.io\/about\" target=\"_blank\" rel=\"noreferrer noopener\">Sensu<\/a>&nbsp;is an opensource infrastructure and application monitoring tool. You will learn to monitor such metrics as CPU usage, memory usage, disk usage etc.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Monitor Windows System Metrics using Sensu<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Configure Sensu Agent Entity Subscription<\/h3>\n\n\n\n<p>As described in the guide below, you need to add the Windows system agent into a specific subscription;<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/how-to-monitor-linux-system-metrics-using-sensu\/#agent-subscription\" target=\"_blank\" rel=\"noreferrer noopener\">Configure Sensu Agent Entity Subscription<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sensuctl entity update WorkBox<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>? Entity Class: agent\n? Subscriptions: windows\nUpdated<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sensuctl entity list<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\n     ID      Class     OS          Subscriptions                  Last Seen            \n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n  WorkBox    agent   windows   <strong>windows<\/strong>,entity:WorkBox   2022-05-07 20:02:11 +0000 UTC  \n  debian11   agent   linux     linux,entity:debian11    2022-05-07 20:02:03 +0000 UTC  \n  rocky8     agent   linux     linux,entity:rocky8      2022-05-07 20:02:13 +0000 UTC\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Next, install Sensu Checks Plugins<\/h3>\n\n\n\n<p>As described in the guide below, install Sensu checks plugins;<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/how-to-monitor-linux-system-metrics-using-sensu\/#sensu-checks\" target=\"_blank\" rel=\"noreferrer noopener\">Install Sensu Check Plugins on the Sensu Backend<\/a><\/p>\n\n\n\n<p>To confirm installed checks plugins;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sensuctl asset list<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\n         Name                                             URL                                        Hash    \n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n  check-cpu-usage      \/\/assets.bonsai.sensu.io\/...\/check-cpu-usage_0.2.2_windows_amd64.tar.gz      900cfdf  \n  check-cpu-usage      \/\/assets.bonsai.sensu.io\/...\/check-cpu-usage_0.2.2_darwin_amd64.tar.gz       db81ee7  \n  check-cpu-usage      \/\/assets.bonsai.sensu.io\/...\/check-cpu-usage_0.2.2_linux_armv7.tar.gz        400aacc  \n  check-cpu-usage      \/\/assets.bonsai.sensu.io\/...\/check-cpu-usage_0.2.2_linux_arm64.tar.gz        bef7802  \n  check-cpu-usage      \/\/assets.bonsai.sensu.io\/...\/check-cpu-usage_0.2.2_linux_386.tar.gz          a2dcb53  \n  check-cpu-usage      \/\/assets.bonsai.sensu.io\/...\/check-cpu-usage_0.2.2_linux_amd64.tar.gz        2453973  \n  check-disk-usage     \/\/assets.bonsai.sensu.io\/...\/check-disk-usage_0.7.0_windows_amd64.tar.gz     e28c0da  \n  check-disk-usage     \/\/assets.bonsai.sensu.io\/...\/check-disk-usage_0.7.0_darwin_amd64.tar.gz      2b3a8f1  \n  check-disk-usage     \/\/assets.bonsai.sensu.io\/...\/check-disk-usage_0.7.0_linux_armv7.tar.gz       0c2c5ce  \n  check-disk-usage     \/\/assets.bonsai.sensu.io\/...\/check-disk-usage_0.7.0_linux_arm64.tar.gz       f5234e9  \n  check-disk-usage     \/\/assets.bonsai.sensu.io\/...\/check-disk-usage_0.7.0_linux_386.tar.gz         102f2ca  \n  check-disk-usage     \/\/assets.bonsai.sensu.io\/...\/check-disk-usage_0.7.0_linux_amd64.tar.gz       0b76e77  \n  check-memory-usage   \/\/assets.bonsai.sensu.io\/...\/check-memory-usage_0.2.2_windows_amd64.tar.gz   90a997a  \n  check-memory-usage   \/\/assets.bonsai.sensu.io\/...\/check-memory-usage_0.2.2_darwin_amd64.tar.gz    57ebebe  \n  check-memory-usage   \/\/assets.bonsai.sensu.io\/...\/check-memory-usage_0.2.2_linux_armv7.tar.gz     6f7d0d2  \n  check-memory-usage   \/\/assets.bonsai.sensu.io\/...\/check-memory-usage_0.2.2_linux_arm64.tar.gz     94a41f3  \n  check-memory-usage   \/\/assets.bonsai.sensu.io\/...\/check-memory-usage_0.2.2_linux_386.tar.gz       125f9c1  \n  check-memory-usage   \/\/assets.bonsai.sensu.io\/...\/check-memory-usage_0.2.2_linux_amd64.tar.gz     663985d\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Define Sensu Monitoring Command Checks<\/h3>\n\n\n\n<p>Next, <a href=\"https:\/\/kifarunix.com\/how-to-monitor-linux-system-metrics-using-sensu\/#create-checks-commands\" target=\"_blank\" rel=\"noreferrer noopener\">Create Sensu Monitoring Command Checks<\/a>.<\/p>\n\n\n\n<p>Since we already defined the checks and define Subscription for Linux systems, you need to update these checks to be run against windows as well.<\/p>\n\n\n\n<p>For example, to update the check_cpu check;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sensuctl check update check_cpu<\/code><\/pre>\n\n\n\n<p>Sample update prompts.<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\n? Command: check-cpu-usage -w 80 -c 90\n? Interval: 300\n? Cron: \n? Timeout: 0\n? TTL: \n<strong>? Subscriptions: linux,windows<\/strong>\n? Handlers: \n? Runtime Assets: check-cpu-usage\n? Publish: true\n? Check Proxy Entity Name: \n? Check STDIN: false\n? High Flap Threshold: 0\n? Low Flap Threshold: 0\n? Metric Format: \n? Metric Handlers: \n? Round Robin false\nUpdated\n<\/code><\/pre>\n\n\n\n<p>Update the rest or create new checks as you so wish;<\/p>\n\n\n\n<p>This is how my checks look like;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sensuctl check list<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\n     Name                 Command               Interval   Cron   Timeout   TTL   Subscriptions   Handlers         Assets         Hooks   Publish?   Stdin?   Metric Format   Metric Handlers  \n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n  check_cpu    check-cpu-usage -w 80 -c 90           300                0     0   linux,windows              check-cpu-usage              true       false                                     \n  check_disk   check-disk-usage -w 75 -c 85          300                0     0   linux,windows              check-disk-usage             true       false                                     \n  check_mem    check-memory-usage -w 75 -c 90        300                0     0   linux,windows              check-memory-usage           true       false                                     \n  check_swap   check-swap-usage -w 75 -c 90          300                0     0   linux                      check-memory-usage           true       false \n<\/code><\/pre>\n\n\n\n<p>The three checks have been defined to run against both Linux and Windows system subscription.<\/p>\n\n\n\n<p>As you are done updating the checks, they should have been executed already.<\/p>\n\n\n\n<p>Verify the event data;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sensuctl event list | grep WorkBox<\/code><\/pre>\n\n\n\n<p>Sample output;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\n  WorkBox    check_cpu    check-cpu-usage OK: 0.39% CPU usage | cpu_idle=99.61, cpu_system=0.00, cpu_user=0.39, cpu_nice=0.00, cpu_iowait=0.00, cpu_irq=0.00, cpu_softirq=0.00, cpu_steal=0.00, cpu_guest=0.00, cpu_guestnice=0.00        0   false      2022-05-07 20:25:44 +0000 UTC   579f60ab-6713-46f5-8545-94a89b2f0161  \n  WorkBox    check_disk   check-disk-usage       OK: C: 62.49% - Total: 41 GB, Used: 26 GB, Free: 16 GB                                                                                                                                   1   false      2022-05-07 20:24:14 +0000 UTC   9da8a763-724e-441c-ba87-d00a8b6aa9d2  \n  WorkBox    check_mem    check-memory-usage OK: 44.00% memory usage | mem_total=3220754432, mem_available=1771634688, mem_used=1449119744, mem_free=1771634688                                                                           0   false      2022-05-07 20:24:28 +0000 UTC   534657d3-4c83-4a8d-bf00-8f9a933f16ca  \n  WorkBox    keepalive    Keepalive last sent from WorkBox at 2022-05-07 20:26:31 +0000 UTC                                                                                                                                               0   false      2022-05-07 20:26:31 +0000 UTC   19f4a33b-e331-429f-af97-8a1053580286 \n<\/code><\/pre>\n\n\n\n<p>On the Web UI dashboard, looks like there is some incident!<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-agent-metric-status.png\" class=\"td-modal-image\"><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1903\" height=\"930\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-agent-metric-status.png\" alt=\"Monitor Windows System Metrics using Sensu\" class=\"wp-image-12641\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-agent-metric-status.png?v=1651955509 1903w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-agent-metric-status-768x375.png?v=1651955509 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-agent-metric-status-1536x751.png?v=1651955509 1536w\" sizes=\"(max-width: 1903px) 100vw, 1903px\" \/><\/figure><\/a><\/div>\n\n\n\n<p>To check on the entity details;<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-agent-windows-metrics.png\" class=\"td-modal-image\"><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1745\" height=\"739\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-agent-windows-metrics.png\" alt=\"Monitor Windows System Metrics using Sensu\" class=\"wp-image-12642\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-agent-windows-metrics.png?v=1651955539 1745w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-agent-windows-metrics-768x325.png?v=1651955539 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-agent-windows-metrics-1536x650.png?v=1651955539 1536w\" sizes=\"(max-width: 1745px) 100vw, 1745px\" \/><\/figure><\/a><\/div>\n\n\n\n<p>And there you go. That is how you can easily use Sensu to monitor Windows system Metrics.<\/p>\n\n\n\n<p>Other Tutorials;<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/monitoring-gitlab-metrics-with-prometheus-and-grafana\/\" target=\"_blank\" rel=\"noreferrer noopener\">Monitoring Gitlab Metrics with Prometheus and Grafana<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/monitor-linux-system-metrics-with-elk-stack\/\" target=\"_blank\" rel=\"noreferrer noopener\">Monitor Linux System Metrics with ELK Stack<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Follow through this guide to learn how you can easily monitor Windows system metrics using Sensu. Sensu&nbsp;is an opensource infrastructure and application monitoring tool. You<\/p>\n","protected":false},"author":1,"featured_media":12644,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[72,121],"tags":[5074,5075,5076,5078,5077],"class_list":["post-12636","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-monitoring","category-howtos","tag-monitor-windows-metrics-using-sensu","tag-monitor-windows-system-metrics-using-sensu","tag-sensu","tag-sensu-monitor-windows-metrics","tag-windows-systems","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/12636"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=12636"}],"version-history":[{"count":2,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/12636\/revisions"}],"predecessor-version":[{"id":20532,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/12636\/revisions\/20532"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/12644"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=12636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=12636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=12636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}