NOTE: These instructions are provided as a temporary workaround due to current lack of an official Windows package for Sensu Go. Should you follow these instructions, you may need to take manual steps prior to installing the planned official Windows package.
- Follow Windows installation instructions to obtain the binary-only distribution
- Create directories
%PROGRAMDATA%\sensu\configand%PROGRAMFILES%\sensu - Download the example
agent.yml, edit as needed, and place in%PROGRAMDATA%\sensu\config - Unpack binary-only distribution (e.g. using 7zip) and copy executables into
C:\Program Files\sensu\ - Download appropriate WinSW release, this will be
WinSW.NET4.exefor most recent Windows versions. - Place WinSW executable in
%PROGRAMFILES%\sensu\and rename tosensu-agent-service.exe - Create
%PROGRAMFILES%\sensu\sensu-agent-service.xmlwith the following content:
<!--
Windows service definition for Sensu Go Agent
-->
<service>
<id>sensu-agent</id>
<name>Sensu Go Agent</name>
<description>This service runs a Sensu agent</description>
<executable>%PROGRAMFILES%\sensu\sensu-agent.exe</executable>
<argument>start</argument>
<argument>-c</argument>
<argument>%PROGRAMDATA%/sensu/config/agent.yml</argument>
<logpath>%PROGRAMDATA%\sensu\logs\</logpath>
<log mode="roll-by-size">
<sizeThreshold>102400</sizeThreshold>
<keepFiles>10</keepFiles>
</log>
</service>
- Install a Windows service definition to run
sensu-agent-service.exe:
sc create sensu-go-agent start= delayed-auto binPath= "%PROGRAMFILES%\sensu\sensu-agent-service.exe" DisplayName= "Sensu Go Agent"
- Use
services.mscsnap-in to start theSensu Go Agentservice. - Observe logs in
%PROGRAMDATA%\sensu\logsfor any errors.
Great write-up! I ran into one typo related issue in step 7. where forward slashes are present but need to be back slashes in the following line:
%PROGRAMDATA%/sensu/config/agent.yml
Once I updated the slash, no errors in log and service is running! Cheers!