Documentation: https://docs.infrasonar.com/collectors/agents/fsevents/
| Environment | Default | Description |
|---|---|---|
CONFIG_PATH |
/etc/infrasonar |
Path where configuration files are loaded and stored (note: for a user, the $HOME path will be used instead of /etc) |
TOKEN |
required | Token used for authentication (This MUST be a container token). |
ASSET_NAME |
none | Initial Asset Name. This will only be used at the announce. Once the asset is created, ASSET_NAME will be ignored. |
ASSET_ID |
none | Asset Id (If not given, the asset Id will be stored and loaded from file). |
API_URI |
https://api.infrasonar.com | InfraSonar API. |
SKIP_VERIFY |
none | Set to 1 or something else to skip certificate validation. |
CHECK_FS |
300 |
Interval in seconds for the fs check. |
WATCH_PATHS |
watch.cnf |
Configuration file with paths to watch for file system events. |
FN_STATE_JSON |
state.json |
File where the state is stored. |
CACHE_BPS_THRESHOLD |
800 |
Threshold in MB/s which defines when the file is from tape or cache. |
CGO_ENABLED=0 go build -trimpath -o fsevents-agent
Download the latest release:
wget https://github.com/infrasonar/fsevents-agent/releases/download/v1.0.4/fsevents-agentThe pre-build binary is build for the fsevents-amd64 platform. For other platforms build from source using the command:
CGO_ENABLED=0 go build -o fsevents-agent
Ensure the binary is executable:
chmod +x fsevents-agent
Copy the binary to /usr/sbin/infrasonar-fsevents-agent
sudo cp fsevents-agent /usr/sbin/infrasonar-fsevents-agent
sudo touch /etc/systemd/system/infrasonar-fsevents-agent.service
sudo chmod 664 /etc/systemd/system/infrasonar-fsevents-agent.service1. Using you favorite editor, add the content below to the file created:
[Unit]
Description=InfraSonar fsevents Agent
Wants=network.target
[Service]
EnvironmentFile=/etc/infrasonar/fsevents-agent.env
ExecStart=/usr/sbin/infrasonar-fsevents-agent
[Install]
WantedBy=multi-user.target
2. Create the directory /etc/infrasonar
sudo mkdir /etc/infrasonar3. Create the file /etc/infrasonar/fsevents-agent.env with at least:
TOKEN=<YOUR TOKEN HERE>
Optionaly, add environment variable to the fsevents-agent.env file for settings like ASSET_ID or CONFIG_PATH (see all environment variables in the table above).
4. Reload systemd:
sudo systemctl daemon-reload5. Install the service:
sudo systemctl enable infrasonar-fsevents-agentFinally, you may want to start/stop or view the status:
sudo systemctl start infrasonar-fsevents-agent
sudo systemctl stop infrasonar-fsevents-agent
sudo systemctl status infrasonar-fsevents-agentView logging:
journalctl -u infrasonar-fsevents-agent