Reporting to FlyingMonit¶
The control file's set mmonit names the collector – FlyingMonit's address with /collector and a user FlyingMonit
knows as a collector:
set mmonit https://<user>:<password>@<your FlyingMonit>/collector
Every set daemon seconds the agent sends a status report as Monit does: the host's name as check system gives it,
the system's figures – load over 1, 5 and 15 minutes, CPU (user, system, wait), memory and swap – and the agent's id,
version and uptime. Its start and its stop are sent as events.
The host's id¶
FlyingMonit knows a host by its id. The agent keeps it in /var/lib/flyingmonit-agent/.flyingmonit-agent.id, written at
its first start; an update keeps it.
Taking over from Monit¶
To replace Monit on a host and keep the host as FlyingMonit knows it – its history, its settings – give the agent Monit's id and collector before its first start, as root:
useradd --system --user-group --home-dir /var/lib/flyingmonit-agent --shell /usr/sbin/nologin flyingmonit-agent
install -d -o flyingmonit-agent -g flyingmonit-agent -m 0700 /var/lib/flyingmonit-agent
install -o flyingmonit-agent -g flyingmonit-agent -m 0600 /var/lib/monit/id \
/var/lib/flyingmonit-agent/.flyingmonit-agent.id
umask 077
{ echo "set daemon 60"; grep -E '^set mmonit ' /etc/monit/monitrc; echo 'check system $HOST'; } \
> /etc/flyingmonit-agentrc
chown flyingmonit-agent:flyingmonit-agent /etc/flyingmonit-agentrc
systemctl disable --now monit
Then the installer – without --collector: it keeps the control file. Check first that the agent
reads everything your Monit's control file has: a statement it does not support yet
stops it.