{"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
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
Before you can install Sensu agent on Windows system, ensure that you have a Sensu Go backend server running.<\/p>\n\n\n\n
The guide on the link below provide easy steps to setup Sensu Go backend server.<\/p>\n\n\n\n
Install Sensu Go on Ubuntu 22.04<\/a><\/p>\n\n\n\n Install Sensu Go on Debian 11<\/a><\/p>\n\n\n\n Next, then install Sensu agent on Windows system and start to collect and monitor system metrics.<\/p>\n\n\n\n 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…<\/p>\n\n\n\n We are using Windows 10 in this setup.<\/p>\n\n\n\n Thus, launch Powershell as administrator.<\/p>\n\n\n\n Run the command below to 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 Next, install Sensu agent on Windows system;<\/p>\n\n\n\n Next, confirm the agent installations;<\/p>\n\n\n\n Sample output;<\/p>\n\n\n\n Rename the sample Sensu configuration file, Next, open the file for editing and define the Senso Go backend URL;<\/p>\n\n\n\n Save the file once you have made the changes.<\/p>\n\n\n\n Next, navigate to Sensu binary directory and install it as a service;<\/p>\n\n\n\n The command will install and start Sensu agent service.<\/p>\n\n\n\n Confirm Sensu agent service installation;<\/p>\n\n\n\n You can tail the logs;<\/p>\n\n\n\n Sample output;<\/p>\n\n\n\n As you can see, the agent is successfully connected to the Sensu backend;<\/p>\n\n\n\n From the Sensu Go backend web ui, you can confirm agent connection as well.<\/p>\n\n\n\n Windows Sensu agent properties;<\/p>\n\n\n\nInvoke-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
msiexec.exe \/i $env:userprofile\\sensu-go-agent_6.7.1.6231_en-US.x64.msi \/qn<\/code><\/pre>\n\n\n\n
Get-Package -Name *sensu*<\/code><\/pre>\n\n\n\n
\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
Configure Sensu Agent on Windows<\/h3>\n\n\n\n
C:\\ProgramData\\sensu\\config\\agent.yml.example<\/strong><\/code>, to
C:\\ProgramData\\sensu\\config\\agent.yml<\/code><\/strong> by removing the .example extension.<\/p>\n\n\n\n
cp C:\\ProgramData\\sensu\\config\\agent.yml.example C:\\ProgramData\\sensu\\config\\agent.yml<\/code><\/pre>\n\n\n\n
notepad.exe C:\\ProgramData\\sensu\\config\\agent.yml<\/code><\/pre>\n\n\n\n
##\n# agent configuration\n##\nbackend-url:\n - \"ws:\/\/192.168.56.129:8081\"<\/code><\/pre>\n\n\n\n
Install Sensu Agent Service on Windows<\/h3>\n\n\n\n
cd 'C:\\Program Files\\sensu\\sensu-agent\\bin'<\/code><\/pre>\n\n\n\n
.\\sensu-agent.exe service install<\/code><\/pre>\n\n\n\n
Get-Service -Name *sensu*<\/code><\/pre>\n\n\n\n
\n\nStatus Name DisplayName\n------ ---- -----------\nRunning SensuAgent Sensu Agent\n<\/code><\/pre>\n\n\n\n
Get-Content C:\\ProgramData\\Sensu\\log\\sensu-agent.log -Tail 50<\/code><\/pre>\n\n\n\n
\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
{\"component\":\"agent\",\"level\":\"info\",\"msg\":\"successfully connected\",\"time\":\"2022-05-07T22:09:51+03:00\"}<\/code><\/pre>\n\n\n\n
Verify Sensu Agent Connection to Sensu Backend<\/h3>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n