Skip to content

Deactivate, delete, restore

Agent and collector follow what you do with their host, collector or tenant in Vesana. You don't have to do anything on the device, with one exception: after an uninstall, the software has to be installed again if you want it back.

At a glance

You do in Vesana … Agent / collector on the device
Deactivate a host or tenant pauses: no checks, no logs, no discovery
Activate the host or tenant again resumes on its own within 20 seconds
Delete with “Keep installed” (default) rests and only checks in briefly every 5 minutes
Restore from the trash resumes on its own within 5 minutes
Delete with “Uninstall” removes itself completely from the device on its next contact
Empty the trash (or automatically after 30 days) stops for good, the files stay on the device. If “Uninstall” was chosen, it removes itself.
Remove the agent (host → agent chip) stops; on request it uninstalls itself

Deactivate = pause

A deactivated host (or tenant) is not deregistered. The agent keeps running but gets no checks and no log sources. It only checks in briefly every 20 seconds. When you reactivate the host, it fetches its checks on the next contact and measures everything right away.

A collector pauses when its tenant is deactivated. It then checks nothing and runs no discovery. The Active Collector on the Vesana server never pauses, because it serves all tenants.

Delete: “Keep installed” or “Uninstall”

When you delete a host with an agent, a collector or a tenant, the dialog asks what should happen on the device.

Keep installed (default)

The agent rests: no checks, no logs, no discovery. Every 5 minutes it briefly asks Vesana whether it is needed again. If you restore the host from the trash, it resumes on its own within 5 minutes.

While resting, the agent (or collector) needs next to nothing — it is simply always ready to wake up again.

If you empty the trash, there is nothing left for the agent to come back to. It then stops for good and uses nothing. Program and files stay on the device (see Uninstall).

Uninstall

On its next contact, the agent removes itself completely from the device: service, program, configuration, state and logs. If the device is off, this happens once it is running again. The agent only removes itself. Which files those are is fixed inside the agent; the Vesana server sends neither paths nor commands.

  • Linux: through a separate systemd run (vesana-agent-uninstall-<pid>). It stops the service and removes /usr/local/bin/vesana-agent, /etc/vesana-agent, /var/lib/vesana-agent, /var/log/vesana-agent and the unit file.
  • Windows: through a one-time scheduled task (SYSTEM). It stops and removes the service, deletes the program folder and %ProgramData%\Vesana\Agent, and removes the entry under “Installed apps”. The log is at C:\Windows\Temp\vesana-agent-uninstall.log.
  • Collector: the collector deliberately runs without root and therefore cannot remove itself. The installer sets up a small root helper for this (vesana-collector-uninstall.path). The collector only creates a request file; the helper removes service, program, configuration and the service user. Collectors set up with an older installer don't have the helper. They then only stop, and the delete dialog says so beforehand. Run the installer once more and it works.

After a restore, uninstalled software has to be installed again. The restore dialog tells you so per device.

Local Approval comes first

If Local Approval is enabled on the device, the agent or collector refuses the uninstall and rests instead. Whatever Vesana can trigger, a compromised Vesana must not be able to use against the host. The delete dialog says so beforehand, and the refusal is reported to Vesana. It can then only be removed on the device itself.

What the restore dialog says

Message Meaning
Comes back on its own The agent is resting and resumes within 5 minutes after the restore.
Uninstall will be cancelled “Uninstall” was chosen, but the agent has not picked it up yet (device off). After the restore it simply keeps working.
Needs to be installed again “Uninstall” was chosen and the device carried it out. Set it up again: open the host → Set up agent, or the collector installer.
Not heard from since deletion The device is off. Once it is running again, the agent comes back on its own.

Older agents and collectors

Before this version, an agent or collector stopped itself for good on every deactivation or deletion by creating a tombstone file .deregistered. If a host was deactivated back then and is reactivated now, the agent does not come back on its own. This is how you restart it:

sudo rm -f /var/lib/vesana-agent/.deregistered
sudo systemctl reset-failed vesana-agent; sudo systemctl restart vesana-agent
Remove-Item "$env:ProgramData\Vesana\Agent\.deregistered" -ErrorAction SilentlyContinue
Start-Service VesanaAgent
sudo rm -f /var/lib/vesana-collector/.deregistered
sudo systemctl reset-failed vesana-collector; sudo systemctl restart vesana-collector

Running the install one-liner again works just as well: it removes the file itself. An agent with the new version (auto-update) only creates this file when it is supposed to go for good.