mkdir weeve-agent
where all the weeve Agent related contents would go, follow the steps with that in mind.chmod u+x
<name-of-the-binary>
.nano nodeconfig.json
with the following content:
{
"AWSRootCert": "",
"Certificate": "",
"PrivateKey": "",
"NodeId": "",
"NodeName": ""
}
and update the name of the certificates and node ( make sure the name of the node is unique for easy identification in weeve Manager), while the id of the node can be left empty.sudo nano /lib/systemd/system/weeve-agent.argconf
with the following content:
ARG_VERBOSE=-v
ARG_BROKER=--broker tls://asnhp33z3nubs-ats.iot.us-east-1.amazonaws.com:8883
ARG_SUB_CLIENT=--subClientId nodes/awsdev
ARG_PUB_CLIENT=--pubClientId manager/awsdev
ARG_PUBLISH=--publish status
ARG_HEARTBEAT=--heartbeat 150
these are the default arguments for the weeve Agent.sudo nano /lib/systemd/system/weeve-agent.service
with the following content:
[Unit]
Description=Weeve Agent
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
Restart=always
RestartSec=60s
EnvironmentFile=/lib/systemd/system/weeve-agent.argconf
WorkingDirectory=<path-to-newly-created-directory-for-the-weeve-agent>
ExecStart=<path-to-the-binary-of-the-weeve-agent> $ARG_VERBOSE $ARG_BROKER $ARG_SUB_CLIENT $ARG_PUB_CLIENT $ARG_PUBLISH $ARG_HEARTBEATsudo systemctl enable weeve-agent.service
.sudo systemctl start weeve-agent.service
.systemctl enable docker
sudo ausearch -c '(ux_amd64)' --raw | audit2allow -M my-uxamd64
sudo semodule -X 300 -i my-uxamd64.pp
/sbin/restorecon -v /usr/local/bin/<name-of-the-binary>