{"id":12623,"date":"2022-05-07T22:33:33","date_gmt":"2022-05-07T19:33:33","guid":{"rendered":"https:\/\/kifarunix.com\/?p=12623"},"modified":"2024-03-09T14:14:26","modified_gmt":"2024-03-09T11:14:26","slug":"install-sensu-agent-on-windows-systems","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-sensu-agent-on-windows-systems\/","title":{"rendered":"Install Sensu Agent on Windows systems"},"content":{"rendered":"\n<p>This guide is about how to install Sensu agent on Windows systems. To be able to start collecting remote Windows system metrics for monitoring using Sensu Go server, you need to install Sensu agents on the hosts being monitored.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install Sensu Agent on Windows systems<\/h2>\n\n\n\n<p>Before you can install Sensu agent on Windows system, ensure that you have a Sensu Go backend server running.<\/p>\n\n\n\n<p>The guide on the link below provide easy steps to setup Sensu Go backend server.<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-sensu-go-on-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install Sensu Go on Ubuntu 22.04<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-sensu-go-on-debian-11\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install Sensu Go on Debian 11<\/a><\/p>\n\n\n\n<p>Next, then install Sensu agent on Windows system and start to collect and monitor system metrics.<\/p>\n\n\n\n<p>We will simplify the agent installations via the Powershell. If you want, you can download the agent and install it the traditional way of double click to install and go through the installation next, next&#8230;<\/p>\n\n\n\n<p>We are using Windows 10 in this setup.<\/p>\n\n\n\n<p>Thus, launch Powershell as administrator.<\/p>\n\n\n\n<p>Run the command below to <a href=\"https:\/\/sensu.io\/downloads\" target=\"_blank\" rel=\"noreferrer noopener\">download the current release version<\/a> of Sensu agent Windows installer. You can subtitute the link and the name of the agent as per the current release version number.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Invoke-WebRequest https:\/\/s3-us-west-2.amazonaws.com\/sensu.io\/sensu-go\/6.7.1\/sensu-go-agent_6.7.1.6231_en-US.x64.msi  -OutFile \"$env:userprofile\\sensu-go-agent_6.7.1.6231_en-US.x64.msi\"<\/code><\/pre>\n\n\n\n<p>Next, install Sensu agent on Windows system;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>msiexec.exe \/i $env:userprofile\\sensu-go-agent_6.7.1.6231_en-US.x64.msi \/qn<\/code><\/pre>\n\n\n\n<p>Next, confirm the agent installations;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-Package -Name *sensu*<\/code><\/pre>\n\n\n\n<p>Sample output;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\n\nName                           Version          Source                           ProviderName\n----                           -------          ------                           ------------\nSensu Agent                    6.7.1.6231       C:\\Program Files\\Sensu\\sensu-... msi\n\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Configure Sensu Agent on Windows<\/h3>\n\n\n\n<p>Rename the sample Sensu configuration file, <code><strong>C:\\ProgramData\\sensu\\config\\agent.yml.example<\/strong><\/code>, to <strong><code>C:\\ProgramData\\sensu\\config\\agent.yml<\/code><\/strong> by removing the .example extension.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp C:\\ProgramData\\sensu\\config\\agent.yml.example C:\\ProgramData\\sensu\\config\\agent.yml<\/code><\/pre>\n\n\n\n<p>Next, open the file for editing and define the Senso Go backend URL;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>notepad.exe C:\\ProgramData\\sensu\\config\\agent.yml<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>##\n# agent configuration\n##\nbackend-url:\n  - \"ws:\/\/192.168.56.129:8081\"<\/code><\/pre>\n\n\n\n<p>Save the file once you have made the changes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install Sensu Agent Service on Windows<\/h3>\n\n\n\n<p>Next, navigate to Sensu binary directory and install it as a service;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd 'C:\\Program Files\\sensu\\sensu-agent\\bin'<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>.\\sensu-agent.exe service install<\/code><\/pre>\n\n\n\n<p>The command will install and start Sensu agent service.<\/p>\n\n\n\n<p>Confirm Sensu agent service installation;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-Service -Name *sensu*<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\n\nStatus   Name               DisplayName\n------   ----               -----------\nRunning  SensuAgent         Sensu Agent\n<\/code><\/pre>\n\n\n\n<p>You can tail the logs;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-Content C:\\ProgramData\\Sensu\\log\\sensu-agent.log -Tail 50<\/code><\/pre>\n\n\n\n<p>Sample output;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\n{\"component\":\"cmd\",\"level\":\"info\",\"logger-config\":{\"Path\":\"C:\\\\ProgramData\\\\sensu\\\\log\\\\sensu-agent.log\",\"MaxSizeBytes\":134217728,\"RetentionDuration\":604800000000000,\"RetentionFiles\":10},\"msg\":\"logging to file\",\"time\":\"2022-05-07T22:09:48+03:00\"}\n{\"component\":\"cmd\",\"level\":\"info\",\"msg\":\"sensu-agent service starting\",\"time\":\"2022-05-07T22:09:49+03:00\"}\n{\"component\":\"agent\",\"level\":\"info\",\"msg\":\"compacting api queue\",\"time\":\"2022-05-07T22:09:49+03:00\"}\n{\"component\":\"agent\",\"level\":\"info\",\"msg\":\"finished api queue compaction\",\"time\":\"2022-05-07T22:09:50+03:00\"}\n{\"component\":\"agent\",\"level\":\"info\",\"msg\":\"using password auth\",\"time\":\"2022-05-07T22:09:50+03:00\"}\n{\"component\":\"agent\",\"level\":\"info\",\"msg\":\"configuration successfully validated\",\"time\":\"2022-05-07T22:09:50+03:00\"}\n{\"component\":\"agent\",\"level\":\"info\",\"msg\":\"starting statsd server on address: 127.0.0.1:8125\",\"time\":\"2022-05-07T22:09:50+03:00\"}\n{\"component\":\"agent\",\"event\":{\"Title\":\"Gostatsd started\",\"Text\":\"Gostatsd started\",\"DateHappened\":1651950590,\"Hostname\":\"WorkBox\",\"AggregationKey\":\"\",\"SourceTypeName\":\"\",\"Tags\":null,\"SourceIP\":\"\",\"Priority\":1,\"AlertType\":0},\"level\":\"info\",\"msg\":\"statsd received an eve\n,\"time\":\"2022-05-07T22:09:50+03:00\"}\n{\"component\":\"agent\",\"level\":\"info\",\"msg\":\"starting UDP listener on address: 127.0.0.1:3030\",\"time\":\"2022-05-07T22:09:50+03:00\"}\n{\"component\":\"agent\",\"level\":\"info\",\"msg\":\"starting api on address: 127.0.0.1:3031\",\"time\":\"2022-05-07T22:09:50+03:00\"}\n{\"component\":\"agent\",\"level\":\"info\",\"msg\":\"starting TCP listener on address: 127.0.0.1:3030\",\"time\":\"2022-05-07T22:09:50+03:00\"}\n{\"component\":\"agent\",\"level\":\"info\",\"msg\":\"connecting to backend URL \\\"ws:\/\/192.168.56.129:8081\\\"\",\"time\":\"2022-05-07T22:09:50+03:00\"}\n{\"component\":\"agent\",\"level\":\"info\",\"msg\":\"successfully connected\",\"time\":\"2022-05-07T22:09:51+03:00\"}\n{\"component\":\"agent\",\"content_type\":\"application\/octet-stream\",\"level\":\"info\",\"msg\":\"message received\",\"payload_size\":31,\"time\":\"2022-05-07T22:09:51+03:00\",\"type\":\"entity_config\"}\n{\"check\":\"keepalive\",\"component\":\"agent\",\"entity\":\"WorkBox\",\"event_uuid\":\"0544a7f7-dc0b-4df9-b572-60fe39aa239f\",\"level\":\"info\",\"msg\":\"sending event to backend\",\"time\":\"2022-05-07T22:09:51+03:00\"}\n{\"component\":\"agent\",\"content_type\":\"application\/octet-stream\",\"level\":\"info\",\"msg\":\"message received\",\"payload_size\":141,\"time\":\"2022-05-07T22:09:51+03:00\",\"type\":\"entity_config\"}\n{\"check\":\"keepalive\",\"component\":\"agent\",\"entity\":\"WorkBox\",\"event_uuid\":\"be872027-4fab-4001-a794-b275fbd0dffb\",\"level\":\"info\",\"msg\":\"sending event to backend\",\"time\":\"2022-05-07T22:10:11+03:00\"}\n{\"check\":\"keepalive\",\"component\":\"agent\",\"entity\":\"WorkBox\",\"event_uuid\":\"c3f55aff-7f3b-4996-b70a-7fabf08bbc27\",\"level\":\"info\",\"msg\":\"sending event to backend\",\"time\":\"2022-05-07T22:10:31+03:00\"}\n{\"check\":\"keepalive\",\"component\":\"agent\",\"entity\":\"WorkBox\",\"event_uuid\":\"2e09a1d9-7f5f-4472-a13f-32857c841d51\",\"level\":\"info\",\"msg\":\"sending event to backend\",\"time\":\"2022-05-07T22:10:51+03:00\"}\n{\"check\":\"keepalive\",\"component\":\"agent\",\"entity\":\"WorkBox\",\"event_uuid\":\"e669cc74-be83-4d46-b138-e34c1eddfcff\",\"level\":\"info\",\"msg\":\"sending event to backend\",\"time\":\"2022-05-07T22:11:11+03:00\"}\n{\"check\":\"keepalive\",\"component\":\"agent\",\"entity\":\"WorkBox\",\"event_uuid\":\"3cecdb41-bd61-4cae-8445-1aed1ed8ddc4\",\"level\":\"info\",\"msg\":\"sending event to backend\",\"time\":\"2022-05-07T22:11:31+03:00\"}\n{\"check\":\"keepalive\",\"component\":\"agent\",\"entity\":\"WorkBox\",\"event_uuid\":\"bed71544-5acd-446b-a70f-709154538fc5\",\"level\":\"info\",\"msg\":\"sending event to backend\",\"time\":\"2022-05-07T22:11:51+03:00\"}\n{\"check\":\"keepalive\",\"component\":\"agent\",\"entity\":\"WorkBox\",\"event_uuid\":\"842a1726-b52c-4f1a-bed7-4609f236e760\",\"level\":\"info\",\"msg\":\"sending event to backend\",\"time\":\"2022-05-07T22:12:11+03:00\"}\n{\"check\":\"keepalive\",\"component\":\"agent\",\"entity\":\"WorkBox\",\"event_uuid\":\"7765f85d-e03c-4cbe-b107-5c7e814096fd\",\"level\":\"info\",\"msg\":\"sending event to backend\",\"time\":\"2022-05-07T22:12:31+03:00\"}\n{\"check\":\"keepalive\",\"component\":\"agent\",\"entity\":\"WorkBox\",\"event_uuid\":\"f031344d-fe8c-4119-aeba-48d4a5b542bc\",\"level\":\"info\",\"msg\":\"sending event to backend\",\"time\":\"2022-05-07T22:12:51+03:00\"}\n<\/code><\/pre>\n\n\n\n<p>As you can see, the agent is successfully connected to the Sensu backend;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\"component\":\"agent\",\"level\":\"info\",\"msg\":\"successfully connected\",\"time\":\"2022-05-07T22:09:51+03:00\"}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Verify Sensu Agent Connection to Sensu Backend<\/h3>\n\n\n\n<p>From the Sensu Go backend web ui, you can confirm agent connection as well.<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-windows-agent.png\" class=\"td-modal-image\"><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1724\" height=\"487\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-windows-agent.png\" alt=\"Install Sensu Agent on Windows systems\" class=\"wp-image-12630\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-windows-agent.png?v=1651951195 1724w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-windows-agent-768x217.png?v=1651951195 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-windows-agent-1536x434.png?v=1651951195 1536w\" sizes=\"(max-width: 1724px) 100vw, 1724px\" \/><\/figure><\/a><\/div>\n\n\n\n<p>Windows Sensu agent properties;<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-windows-agent-properties.png\" class=\"td-modal-image\"><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1866\" height=\"894\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-windows-agent-properties.png\" alt=\"Install Sensu Agent on Windows systems\" class=\"wp-image-12631\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-windows-agent-properties.png?v=1651951238 1866w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-windows-agent-properties-768x368.png?v=1651951238 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/05\/sensu-windows-agent-properties-1536x736.png?v=1651951238 1536w\" sizes=\"(max-width: 1866px) 100vw, 1866px\" \/><\/figure><\/a><\/div>\n\n\n\n<p>And that is how Sensu agent can be installed on Windows systems.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Reference;<\/h3>\n\n\n\n<p><a href=\"https:\/\/docs.sensu.io\/sensu-go\/latest\/operations\/deploy-sensu\/\" target=\"_blank\" rel=\"noreferrer noopener\">Sensu Documentation<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Other Tutorials<\/h3>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-sensu-agent-on-rocky-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install Sensu Agent on Rocky Linux<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-sensu-agent-on-ubuntu-debian\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install Sensu Agent on Ubuntu\/Debian<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide is about how to install Sensu agent on Windows systems. To be able to start collecting remote Windows system metrics for monitoring using<\/p>\n","protected":false},"author":1,"featured_media":12632,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[72,121],"tags":[5069,5072,5070,5071,5073],"class_list":["post-12623","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-monitoring","category-howtos","tag-install-sensu-agent-on-windows-systems","tag-sensu-agent","tag-sensu-agent-on-windows","tag-windows","tag-windows-sensu-agent-install","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\/12623"}],"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=12623"}],"version-history":[{"count":6,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/12623\/revisions"}],"predecessor-version":[{"id":20533,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/12623\/revisions\/20533"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/12632"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=12623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=12623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=12623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}