mtmon – installation and user manual
Monitoring of MikroTik CAPsMAN, HP MSM and Cambium cnPilot access points and network devices, with mail alerts, a web dashboard and reporting to a central server.
1What mtmon is
mtmon is a system service (systemd daemon) for Linux that checks the wireless network and network equipment at regular intervals and reports every change by mail:
- MikroTik CAPsMAN – reads the list of connected access points (remote CAPs) over SSH and reports which one is missing, with its name (identity), IP and MAC address.
- HP MSM720 / Colubris – the same for access points on an HP controller, over SNMP.
- Cambium cnPilot (e400 … e700, also under cnMaestro cloud) – asks every access point directly over SNMP, no controller needed.
- Switches and other devices – pings a list of addresses; reports a device that does not answer.
- Web dashboard (optional) – state of all devices, history, Wi-Fi clients per SSID, sign-in with users and roles.
- Reporting to a centre (optional) – after every check the status goes to mtmon-admin-center, which shows all sites together.
- Switches over SNMP (optional) – uplinks, errors, PoE, temperature, restarts; an inventory of models and versions.
- Maintenance windows, unstable devices, certificates and a weekly and monthly report by mail.
Every check (by default every 5 minutes) puts all changes into one mail: missing and returned access points, new access points, unreachable and recovered devices, and reminders for what still does not work. mtmon only reads from the devices; it changes nothing.
2How it works – diagrams
Three pictures that explain almost everything else: who sends what to whom, what happens in one check, and why you do not get twenty mails when a switch fails.
Connections
One check
interval seconds (default 300). A mail goes only after fail_threshold failures in a row; a return is reported at once.Dependencies
topology_hours. The topology page shows the same tree with the ports on both ends.3Requirements
| What | Requirement |
|---|---|
| System | Debian 13 (.deb package) or RHEL / Rocky / Alma 8, 9, 10 and Fedora (.rpm package you build yourself). RHEL 7 is too old. |
| Perl and modules | Installed by the package (perl, IO::Socket::SSL, HTTP::Tiny, IO::Compress …). |
| Tools | openssh-client, ping, openssl – installed by the package. For HP MSM also the net-snmp tools (Debian: snmp, RHEL: net-snmp-utils). |
| Network | SSH (TCP 22 by default) to every CAPsMAN, SNMP (UDP 161) to the HP controller, ICMP ping to the switches, SMTP to the mail server. For the centre only outgoing HTTPS. |
| MikroTik | RouterOS 7.x (v6 works with extra SSH settings), a user with policy=read,ssh. |
4Installation
Debian 13
cp mtmon_13.13.0_all.deb /tmp/
apt install /tmp/mtmon_13.13.0_all.debRed Hat, Rocky, Alma, Fedora
Build the RPM on a Red Hat system from the source (mtmon-13.13.0-src.tar.gz):
dnf install rpm-build
tar xzf mtmon-13.13.0-src.tar.gz && cd mtmon-13.13.0
./build-rpm.sh
dnf install ./mtmon-13.13.0-1.noarch.rpmperl(Authen::SASL) is only recommended (needed for SMTP authentication only); on RHEL it comes from CRB/EPEL.
What the package does
- creates the system user
mtmonand the folders/etc/mtmon/and/var/lib/mtmon/, - installs the SSH key
/etc/mtmon/id_ed25519– the same on every installation and after every upgrade, so it is imported on a MikroTik only once, - creates a self-signed certificate for the dashboard (
/etc/mtmon/web.crt, valid 30 years), - installs the service
mtmon.servicebut does not start it yet – edit the config first, - installs Tab completion (bash-completion) and the change history (
mtmon --changelog).
Upgrade
Same as installing (apt install /tmp/mtmon_…deb or dnf install ./mtmon-…rpm). Your mtmon.conf, SSH key, state and history are kept, a running service is restarted, and the changes since the previous version are printed at the end.
New settings go into your config by themselves (since 13.3.0): the upgrade adds to mtmon.conf each setting that is new in this version, with its explanation, at the end of the section it belongs to – commented out, so nothing changes until you set it. Nothing is removed and nothing is changed; only the version line is updated. The previous file stays as mtmon.conf.bak-OLDVERSION, the new template as mtmon.conf.dist (compare with diff). What the previous template already had and you deleted does not come back. Sections that are lists (users, keys, devices) only get named settings. Debian does not ask about the config any more (it is no longer a dpkg conffile).
mtmon --config-upgrade -n # only shows what it would add
mtmon --config-upgrade # adds them (the package does it by itself)
diff /etc/mtmon/mtmon.conf.bak-13.2.4 /etc/mtmon/mtmon.confRemoval
apt remove mtmon # stop and remove the program; config, key and state are kept
apt purge mtmon # also remove config, SSH key, certificate and state
dnf remove mtmon # RHEL: config (.rpmsave), key and /var/lib/mtmon are kept5Preparing the devices
MikroTik CAPsMAN (RouterOS 7)
On every CAPsMAN controller create a read-only user and import the mtmon public key (/etc/mtmon/id_ed25519.pub):
/user group add name=mtmon policy=read,ssh
/user add name=mtmon group=mtmon address=MTMON_SERVER_IP/32 password=LONG-RANDOM-PASSWORD
/tool fetch url="https://web.xen.si/pub-keys/bg/mon_id_ed25519.pub"
/user ssh-keys import public-key-file="mon_id_ed25519.pub" user=mtmon
/ip ssh set always-allow-password-login=no strong-crypto=yes- The password is never used; RouterOS only requires one.
- You can also copy the public key to the MikroTik by hand (Winbox → Files) and import it with the same
ssh-keys importcommand. - Restrict SSH further:
/ip service set ssh address=MTMON_SERVER_IP/32,ADMIN_NETWORK. - To see access point names in the Wi-Fi client list, use a
name-formatwith the CAP identity in the CAPsMAN provisioning rule (e.g.name-format=%I-%r).
Old RouterOS v6 with an RSA key: in the device section set key = /etc/mtmon/id_rsa and extra_options = PubkeyAcceptedAlgorithms=+ssh-rsa, HostKeyAlgorithms=+ssh-rsa.
HP MSM720 (SNMP)
Enable SNMP on the controller (v1/v2c with a community or v3 with a user) for the mtmon server's IP. No MIB files are needed. Test from the command line:
snmpbulkwalk -v2c -c public -Cc 10.0.0.10 1.3.6.1.4.1.8744.5.23.1.2.1.1A plain snmpwalk often returns only "No Such Object" on these controllers; use snmpbulkwalk -Cc.
Cambium cnPilot (SNMP)
In cnMaestro: AP Groups › group › Configuration › Management › SNMP – tick Enable, type an RO community and Save (confirm the push to the APs). The fields show "public" / "private" only as placeholders that are not stored – if only "Enable" is saved, the APs have SNMP on without a community and do not answer. Leave the RW community empty. Test (prints the AP name):
snmpget -v2c -c COMMUNITY 10.32.0.34 1.3.6.1.4.1.17713.22.1.1.1.2.0Switches and other devices
They only need to answer ping (ICMP echo) from the mtmon server. mtmon --discover lists the devices the MikroTiks see over MNDP/LLDP/CDP.
6Configuration – mtmon.conf
All settings are in /etc/mtmon/mtmon.conf. The file has sections in square brackets and key = value lines.
- Comments only on their own line (starting with
#or;) – not after a value on the same line. - Permissions:
chown root:mtmon /etc/mtmon/mtmon.conf && chmod 640 /etc/mtmon/mtmon.conf(the file holds passwords). - After a change:
systemctl reload mtmon– the config is read at once, monitoring is not interrupted. - The second line (
# Template from mtmon …) tells which version the template is from – keep it. $LOCATIONin any value is replaced by[general] location.- Yes/no values accept
yes/no,1/0,on/off,true/false.
[general]
| Key | Default | Meaning |
|---|---|---|
location | – | Site or company name; in mail subjects ("MT-Mon report Hotel Delfin") and as $LOCATION. Empty = host name. |
interval | 300 | Seconds between checks. |
state_file | /var/lib/mtmon/state.json | State file; history, events and the centre queue are next to it. |
fail_threshold | 2 | Consecutive failures (ping, CAPsMAN connection) before an alert is sent. |
cap_miss_threshold | 2 | How many checks in a row an access point must be missing before it is reported (against short flaps). |
remind_hours | 24 | Reminder for still missing/unreachable devices every N hours; 0 = off. |
forget_after_days | 2 | After N days a missing access point is forgotten and an unreachable device gets no more reminders (its return is still reported). 0 = never. |
notify_new_caps | 1 | Report new access points. |
notify_recovery | 1 | Report returned access points and devices. |
ping_count / ping_timeout / ping_parallel | 3 / 1 / 32 | Packets per device, wait per packet (s), number of parallel pings. |
flap_count / flap_window | 4 / 60 | Unstable device: this many drops within this many minutes give one "unstable" mail. 0 = off. See Unstable devices. |
flap_log | yes | For MikroTik also count "disconnected" lines of the CAPsMAN log. |
inventory_hours | 24 | How often the controllers and switches are asked for model, serial number and version. 0 = never. |
ap_ports_minutes | 15 | How often the ports and VLANs of the access points are read, in minutes (0 = never). An access point that cannot be read is tried again every 6 hours after 3 tries. |
topology_hours | 6 | How often mtmon finds what is behind what by itself (0 = off): neighbours over LLDP/CDP (SNMP of the switches) and /ip neighbor of MikroTik, the MAC tables of the switches, the routers on the way. When a device goes down, the devices behind it are not reported one by one - its mail lists them, no push goes for them. mtmon --topology shows what it found (13.6.0). |
disk_warn | 10 | Free space of the disk with /var/lib/mtmon in percent: below it one mail "disk almost full" (and a push to the phone), one more when there is enough space again. 0 = off. |
[mail]
| Key | Default | Meaning |
|---|---|---|
method | smtp | smtp (recommended) or sendmail. With the systemd service use smtp – the service hardening blocks the postfix queue. |
smtp_host / smtp_port | 127.0.0.1 / 25 | Mail server. For a local postfix: 127.0.0.1, 25, no login. |
starttls | 0 | 1 = STARTTLS (usually port 587). |
ssl | 0 | 1 = implicit TLS (port 465). |
ssl_verify | 0 | 1 = verify the certificate; smtp_host must be the name in the certificate. 0 = no verification (self-signed). |
ssl_verify_name | – | Name in the certificate when you connect by IP or an internal name. |
smtp_user / smtp_password | – | SMTP login (needs Authen::SASL). |
from | – | Sender, e.g. MT-Mon <mt-mon@example.com>. |
to | – | Recipients, comma separated. |
subject_prefix | [MT-Mon] | Start of the mail subjects; may contain $LOCATION. |
format | html | html = formatted mail with a plain-text part (renders correctly in Outlook too), text = plain text only. |
[ssh]
Default SSH settings for all MikroTiks; each can be overridden in a [capsman …] section.
| Key | Default | Meaning |
|---|---|---|
user | mtmon | User on the MikroTik. |
key | /etc/mtmon/id_ed25519 | Private key. |
port | 22 | SSH port. |
host_key_check | accept-new | accept-new = the device key is recorded on the first connection and checked strictly afterwards; yes = only keys added by hand. |
known_hosts | /var/lib/mtmon/known_hosts | File with the device keys. |
timeout | 15 | Seconds for the connection. |
user_suffix | +ct | RouterOS without colours and terminal detection (recommended). |
extra_options | – | Extra ssh -o options, comma separated (e.g. for RouterOS v6). |
[capsman NAME]
One or more sections, one per controller or group of controllers with the same settings. NAME is your own name (e.g. [capsman hotel]).
| Key | Default | Meaning |
|---|---|---|
host | – | IP or name; several devices comma separated. Each can have its own port: 10.1.0.1:2222, 10.2.0.1. Shown as NAME/IP in reports. |
enabled | yes | no = the section stays in the config but is not checked. |
title | – | Section heading in mails (empty = "CAPsMAN NAME"); may use $LOCATION. |
port, user, key, … | [ssh] | Any [ssh] setting for this section only. |
path | auto | Path to the CAP list; detected automatically by default (v7 wifi, wifiwave2, v6 caps-man). |
clients | yes | no = do not read the Wi-Fi clients of this controller. |
ap_ports | yes | Read the ports and VLANs of this controller's access points (since 13.4.0); no = do not. |
ap_user, ap_key, ap_port | as the controller | Another user, key or SSH port on the access points than on the controller. |
ap_community | from [switches] | SNMP community of the access points, when SSH does not work. |
method | ssh | api = RouterOS API instead of SSH (less recommended), with user, password, ssl, ssl_verify. |
[capsman hotel]
host = 10.0.0.1
title = Wi-Fi $LOCATION
[capsman branches]
host = 10.1.0.1:2222, 10.2.0.1, 10.3.0.1
enabled = yes[msm NAME]
| Key | Default | Meaning |
|---|---|---|
enabled / host / title | – | As for [capsman]. |
snmp_version | 2c | 1, 2c or 3. |
community | public | SNMP community for v1/v2c. |
user, auth_proto, auth_pass, priv_proto, priv_pass | SHA / AES | SNMPv3: authPriv with priv_pass, authNoPriv without. |
timeout / retries | 5 / 2 | Per SNMP request. |
retry_delay / max_wait | 3 / 90 | Incomplete tables are read again with growing pauses, at most max_wait seconds; then the check counts as failed (no false "missing"). |
clients_max_wait | 30 | Seconds for the Wi-Fi client table. |
[cnpilot NAME]
[cnpilot koper]
host = 10.32.0.33, 10.32.0.34, 10.32.0.44-46
community = YOUR-RO-COMMUNITY| Key | Default | Meaning |
|---|---|---|
enabled / title | – | As for [capsman]. |
host | – | All access points of the group: IPs separated by commas, a range in the last octet (10.32.0.30-40). An AP that does not answer at the first check is not monitored until it answers. |
snmp_version / community | 2c / public | As for [msm]; SNMPv3 with the same keys. |
timeout / retries | 2 / 1 | Per access point. |
parallel | 16 | How many APs at a time. |
The section works like a CAPsMAN: an AP that stops answering is missing; when none answers the section is unreachable and the AP state stays as it was. The same answers give the Wi-Fi clients per SSID and per AP and the inventory (model, serial, firmware).
[web]
| Key | Default | Meaning |
|---|---|---|
enabled | no | Turns the web dashboard on. |
listen / port | 0.0.0.0 / 8686 | Address and port. |
allow | – | Networks that may open the page, comma separated (empty = everyone who reaches the port; localhost is always allowed). |
tls | yes | HTTPS; http:// on the same port is redirected to https://. no = plain HTTP. |
cert_file / key_file | /etc/mtmon/web.crt / .key | Own certificate (PEM, chain after the certificate, readable by user mtmon). |
session_hours | 12 | How long a sign-in is valid. |
clients | yes | Read Wi-Fi clients per SSID (dashboard only). |
client_details | yes | no = only numbers per SSID, no list with names, MAC and IP. |
refresh | 30 | Seconds between page updates. |
history_days | 30 | History of every check (and events). |
history_hourly_days | 400 | Hourly history (average + peak); daily is kept forever. |
max_per_ip | 24 | Most open connections at the same time from one address (64 in total). Offices behind one NAT address share it - raise it if many people there use the page. |
[web users]
Dashboard users, one line each. Without users the page is open to everyone in allow.
[web users]
boris = {PBKDF2}50000$...$...
servis = {PBKDF2}50000$...$... role=summary- The password is plain text or (better) a hash from
mtmon --hash-password. role=full(default) sees everything;role=summarysees numbers and charts, but not the Wi-Fi client list (names, MAC, IP).- Names are not case-sensitive. Changing or removing a line + reload signs out only that user.
- After 5 wrong attempts for one user name from one address, that name is locked from that address for 5 minutes; others behind the same address (an office behind NAT) can still sign in. Wrong passwords given to the API count the same.
[api keys]
Keys for apps and scripts (read-only, Authorization: Bearer KEY). Created by mtmon --new-api-key NAME, which shows the key only once.
[api keys]
phone = {SHA256}... role=full allow=10.0.0.0/8[central]
Reporting to mtmon-admin-center. The centre prints these lines with mtmon-admin-center --add-site ID.
| Key | Default | Meaning |
|---|---|---|
enabled | no | Turns reporting on. |
url | – | Address of the centre, e.g. https://center.example.com/. |
key | – | Site key id.secret – every mtmon has its own. |
fingerprint | – | Pins the centre's self-signed certificate (sha256$…). With a purchased certificate leave this line out. |
tls_verify | yes | Certificate verification when there is no fingerprint. |
send_client_details | yes | no = send only the numbers per SSID. |
timeout | 20 | Seconds for one request. |
[switches]
Devices to ping, one per line: address = description.
[switches]
enabled = yes
title = Network devices $LOCATION
10.0.0.11 = SW-core (Aruba 1830-48G)
10.0.0.12 = SW-ground-floorenabled = no switches all of them off at once; the lines stay.
The SNMP settings of this section (snmp, community, snmp_version, snmp_user …, error_rate, poe_warn, temp_warn) and the per-device options after a | are described in Switches over SNMP.
[report]
| Key | Default | Meaning |
|---|---|---|
weekly / monthly | yes / yes | Weekly report on Monday (for the week before), monthly on the 1st (for the month before). |
time | 07:00 | Time of sending. |
to | – | Other recipients than [mail] to. |
enabled | yes | no switches both off. |
[certificates]
One line per certificate: name = target. See Certificates.
| Key | Default | Meaning |
|---|---|---|
warn_days | 30,14,7,3,1 | Days before expiry when a mail is sent. |
web | yes | Also watch the dashboard's certificate. |
check_hours / timeout | 24 / 10 | How often to check (hours) and the wait for a server (s). |
7First start
- Edit
/etc/mtmon/mtmon.conf(at least[mail],[capsman …]and[switches]). - Check the connections to all devices:
mtmon --check. The first run records the devices' SSH keys. - Test the mail:
mtmon --test-mail. - One check without sending, mail on screen:
mtmon --once --dry-run -d. - Start the service:
systemctl enable --now mtmon. - The first check sends a baseline mail with all access points and devices. Watch the log:
journalctl -u mtmon -f.
8Command line
Without options mtmon runs as a daemon (that is how systemd starts it). All options:
| Command | What it does |
|---|---|
-c, --config FILE | Another config (default /etc/mtmon/mtmon.conf). |
--check | Connects to all devices, lists access points and ping results. Does not change the state. |
--once | One check and exit (for cron or testing). |
-n, --dry-run | Prints the mail on screen and does not save the state. |
-d, --debug | Verbose output. |
--test-mail | Sends a test mail in the configured format. |
--report | Checks everything now and mails the full status (all access points and devices). Changes nothing. |
--show | Prints the recorded state of access points and devices. |
--clients | Reads the Wi-Fi clients of all controllers now and prints them per SSID. |
--discover | Lists devices from the MikroTik neighbour tables as lines for [switches]. |
--forget X | Forgets an access point (MAC, identity or IP), e.g. one removed for good. |
--reset | Deletes the state; the next check sends a new baseline mail. |
--hash-password | Asks for a password and prints its hash for [web users]. |
--new-api-key NAME | Creates an API key and prints the line for [api keys]. |
--push-list | Phones that get push notifications (MT-Mon app). |
--push-remove NAME|all | Stops push notifications to a phone (name from --push-list) or to all. |
--rename-ssid OLD NEW [CTRL] | Renames an SSID in the Wi-Fi client history (charts). |
--test-central | Sends the status to the centre now and prints the answer (each part). |
--central-resend | Sends the whole local history (every level, all events) to the centre again – a new centre or one without its data; the centre keeps each record once (13.13.0, centre 7.21.0+). More. |
--mute TARGET DURATION [REASON] | Maintenance window: no mails about the target (all, controller, access point, switch; * wildcard) for the duration (2h, 90m, 1d, 18:00, 22:00-02:00). |
--mutes | Lists the maintenance windows. |
--unmute ID|TARGET|all | Ends a window early. |
--period-report week|month|7d | Sends the weekly / monthly report (or for the last N days) now; with -n only prints it. |
--ap-ports [AP] | Reads the ports and VLANs of the access points now (or of one: IP, name or MAC) and prints them - also why one cannot be read. |
--topology | Finds what is behind what now (LLDP/CDP, MAC tables, paths) and prints the tree of devices with where it found it. |
--server | What mtmon uses on the server (memory, CPU, processes), free disk space and the size of its data in groups. |
--config-upgrade [--template FILE] [-n] | Adds the settings that are new in this version to the config (commented out, with their explanation); --template takes another template (default /usr/share/mtmon/mtmon.conf.template); -n only lists them. The package does it by itself on upgrade. |
--certs | Checks the certificates of [certificates] now and prints them. |
--inventory [--csv] | Asks the devices now and prints the inventory (models, serial numbers, versions); with --csv as CSV. |
--web | Runs only the web server in the foreground (for testing). |
--changelog [V] | Change history; with a version only the changes after it. |
-V, --version / -h, --help | Version / help. |
Service
systemctl status mtmon # running?, last log lines
systemctl reload mtmon # read the config again (SIGHUP)
systemctl restart mtmon # restart
systemctl enable --now mtmon # start now and at every bootTab completion
mtmon -- and Tab lists the options (--ch + Tab → --check --changelog). Needs the bash-completion package and a new shell after installing.
9Web dashboard
Turn it on in [web] (enabled = yes), run systemctl reload mtmon and open https://SERVER:8686/. The web part runs as a child process of the same service; if it stops the daemon restarts it, and monitoring and mails keep running.
- Top: Wi-Fi clients (all and per controller); a click on a chart jumps to the details.
- Status board: every access point and device as a light, a ring per group.
- Problems (longest first), events, availability with date navigation (24 h – all), device tables with search.
- Wi-Fi: charts per SSID and controller, peaks (today, yesterday, week, month, year, all), client list with EAP names, IP, MAC, signal.
The menu on the left lists the sections of the page (Overview, Wi-Fi clients, Availability, Devices, Problems with the number open, Maintenance, Events, Certificates, Inventory) – a click scrolls to the section, the section in view is marked. Below them are the Wi-Fi report, the Device report and the Manual, at the bottom the state of the site. Sections that are not used are not listed. On a phone the menu opens with ☰.
Wi-Fi report for owners (Report button, opens in a new tab, address /report): a document to print or save as PDF (one A4 page; access points on the next). Download PDF (since 13.10) makes a real PDF that looks the same as the report on the screen (page by page as a picture, the text cannot be selected); Print stays for the printer, Slovenian or English. Period: a month (1st to last day, any month back), a year or from – to; the period is in the address, so a report can be bookmarked or sent as a link. Content: most devices at one time (when), devices on average, connection hours, busiest day / month – each compared with the period before; three summary sentences; usage by day (by month for a year), the month as a calendar or the year at a glance, the daily rhythm as a 24-hour clock, the weekly pattern (day × hour), networks (SSID) and controllers as donuts. Access points (bars and a table) are in the report only when ticked. Averages are whole numbers (below a half: "<1").
mtmon computes the report from the hourly history (kept 400 days; older periods from the daily one). Finished months are kept in report-cache/, a year is put together from its months, so it opens at once the second time. Faster with libjson-xs-perl. Access points are the devices the controller knows (remote CAPs, HP / cnPilot APs), not radios or SSID interfaces; mtmon --clients lists the CAPsMAN interfaces that could not be assigned to a CAP.
Device report (the switch Wi-Fi | Devices on the same page, address /report?r=dev): availability of the pinged devices, access points and controllers (with the change from the period before), number of outages and total downtime, the longest outage, availability by day (a bar is green, only the part on top is red – the time some device did not answer), an outage timeline, availability per device (worst first), restarts, unstable devices, firmware changes and maintenance windows. For switches with snmp = yes also ports in use, PoE against the budget, temperature and uplink traffic (average and most, % of the link speed). Outages during a maintenance window are not counted. Same periods, languages and one-page A4 print as the Wi-Fi report.
Manual: the MT-Mon manual button opens this manual (/manual; ?lang=sl or ?lang=en, otherwise the browser language). It is also installed in /usr/share/doc/mtmon/.
The Themes button chooses the theme. The futuristic themes have an animated background behind glass panels: Orbit (globe with orbits and a network in cyan), Arctic (bright ice, grid and light pillars), Neon (violet network with beacons), Ember (amber layers of the network), Matrix (falling code, green terminal) and Breeze (light blue glass). Classic: Automatic (follows the system), Clear, Dark, Light blue, Dark blue, Gray, Graphite, Light green, Green, Orange, Rose, Purple.
Every theme can have its own accent colour (12 colours or any colour). The background animation is turned off in the same menu; it is also off when the system asks for reduced motion, stops while the tab is not shown and is not printed. Status colours (green, amber, red) are the same in every theme. The choice is kept in this browser; the tab icon takes the accent colour.
Certificate
Self-signed by default (the browser warns once). Own certificate, e.g. a wildcard:
[web]
cert_file = /etc/mtmon/wildcard.crt
key_file = /etc/mtmon/wildcard.keyNew self-signed certificate (e.g. after renaming the server or a new IP):
rm /etc/mtmon/web.crt /etc/mtmon/web.key
/usr/lib/mtmon/mkcert /etc/mtmon/web.crt /etc/mtmon/web.key mtmon && systemctl reload mtmonIf the server firewall is on, open the port: firewall-cmd --add-port=8686/tcp --permanent && firewall-cmd --reload (or ufw).
Push notifications on the phone
The MT-Mon app for Android (1.3.0 or newer) shows a notification when an access point, a device or a controller goes down and when it is back (not during maintenance). In the app, signed in to this mtmon: page menu → Notifications on this phone. The phone waits on a connection to mtmon, so a notification arrives within seconds; no Google services are needed. If the site reports to a centre that sends notifications already, turn them on only there – otherwise each one comes twice.
API
Same access rules as the page; sign in with -u user:password or an API key.
| Path | Content |
|---|---|
/api/status | Current state of all devices. |
/api/events?limit=N | Recent events. |
/api/history?from=EPOCH&to=EPOCH | Availability history. |
/api/clients | Wi-Fi clients now. |
/api/clients/history?from=..&to=.. | Client history per SSID. |
/report?p=m:2026-10&lang=sl | The Wi-Fi report page (p = m:YYYY-MM, y:YYYY or c:from:to; aps=1; ctl=controller). |
/api/clients/report?from=..&to=..[&ctl=][&aps=1] | Data of the Wi-Fi report. |
/api/devices/report?from=..&to=.. | Data of the device report (since 12.0.0). |
/manual | This manual. |
/api/clients/aphistory?from=..&to=.. | Client history per access point (since 11.2.0). |
/api/clients/peaks | Client peaks. |
/healthz | Whether the web part runs (no sign-in). |
/api/inventory, /api/inventory.csv | Inventory (model, serial, version) as JSON or CSV with ;. |
/api/certificates | State of the watched certificates (days to expiry). |
GET /api/maintenance | Active maintenance windows and whether the user may change them (can_edit). |
POST /api/maintenance | A new window, JSON {"target": "10.0.0.11", "duration": "2h", "reason": "…"} (target as for --mute; role full only). |
POST /api/maintenance/end | Ends a window: {"id": "…"}. |
POST /api/push/register | A phone signs up for push (device name); returns a device key mtp_…. |
GET /api/push/events?since=..&wait=.. | Events for the phone (device key); waits up to wait seconds for new ones. |
POST /api/push/unregister | The phone signs off. |
/topology, /report | The topology and report pages (see above). |
Sign-in: the dashboard cookie or Authorization: Bearer mtk_… (a key from [api keys], role full or summary, allow). Answers are JSON in UTF-8, times are seconds since 1970 (Unix time).
curl -k -H 'Authorization: Bearer mtk_...' https://SERVER:8686/api/status10Topology
mtmon finds what is behind what by itself (every topology_hours, or now with mtmon --topology): neighbours over LLDP and CDP (SNMP of the switches) and /ip neighbor of MikroTik, the MAC tables of the switches (a device without LLDP hangs on the port with the fewest MACs), the routers on the way. The Topology panel draws it as a tree: each device in the colour of its state (red down, grey behind a device that is down, blue maintenance), on each link the ports on both sides; solid line = neighbour (LLDP/CDP/MikroTik), dashed = MAC table, dotted = route. A click on a device opens it in Devices, + / − folds a branch. The Open the topology button (or /topology) opens it on its own page in a new tab: full screen, zoom with the wheel / fingers / + −, move by dragging, Fit (F) shows everything. Each device lists the ports something hangs on (with their speed), the line goes to the port of the device behind it, whose name is at the end of the line; left is towards mtmon (uplink), right the downlinks, 10 G links are thicker. Choosing a VLAN colours the links that carry it on both ends, a red dotted line shows where it stops (on one end only), amber where it is tagged on one end and untagged on the other. Not monitored shows neighbours mtmon does not monitor (a server, a modem …). A click on a device opens a panel with its uplink, downlinks and all its ports (state, speed, VLANs, what is on them). Find by name or address. When a device goes down, the devices behind it are not reported one by one - its mail lists them, no push goes for them. The ports of a device show what is connected (a click on a port opens the list).
The topology page
The Open the topology button in the Topology panel (or /topology; on the centre /site/ID/topology) opens the topology on its own page in a new tab.
| What | How |
|---|---|
| Move | Drag with the mouse or a finger; the arrow keys. |
| Zoom | Mouse wheel, two fingers on the touchpad (swipe or pinch), pinch on a phone / tablet, the + and − buttons, the + and − keys, double-click (Shift+double-click zooms out). |
| Everything on the screen | The Fit button or the F key. |
| Full screen | The Full screen button or F11; the page follows the size of the window. |
| Look | Look: as the dashboard (its theme / the system), light, dark, blueprint or high contrast – when something is hard to see in a theme. The choice is remembered in this browser. |
| Port to port | Every device lists the ports something hangs on (speed, down/disabled); the line goes to the port of the device behind it, whose name is at the end of the line. Left is towards mtmon (uplink). |
| Lines | Solid: a neighbour over LLDP/CDP/MNDP · dashed: found in a MAC table · dotted: a route (port not known) · thicker: 10 G · red: to a device that is down · grey: behind it. |
| VLAN | Choose a VLAN – see Is a VLAN carried along the whole path? |
| Devices | A click opens a panel: uplink, downlinks, all ports with state, speed, VLANs and what is on them. Access points hides or shows the APs, Not monitored the neighbours mtmon does not monitor, Expand all opens folded branches, the search box finds a device by name or IP. |
Is a VLAN carried along the whole path?
On the topology page (mtmon: the Open the topology button or /topology; centre: Topology on the site card or /site/ID/topology, works also without the web of that mtmon) choose a VLAN at the top. The links are coloured:
- solid blue – the VLAN is on both ends of the link (carried)
- red dotted – the VLAN is on one end only: it stops here
- amber – tagged on one end, untagged on the other
- dashed blue – on one end, the other end is not known (that device does not report VLANs)
- faded – the VLAN is not on this link
When a VLAN is chosen, the legend at the bottom has one more row with all five colours and lines and the t / u marks, so there is no need to look it up.
At the top right a list of the links where the VLAN stops or the tag does not match; devices without that VLAN are faded; next to a port how it carries it (e.g. 20t, 20u). A click on a device opens a panel with all its ports and their VLANs, the ports with the chosen VLAN marked. The VLANs of single ports are also in the device details on the dashboard, but without the view of the whole path.
Needed: mtmon 13.8.0+ (centre 7.12.0+) and devices that report their VLANs – switches over SNMP (snmp = yes, Q-BRIDGE-MIB), MikroTiks over SNMP or the RouterOS API, access points through CAPsMAN's port data. Where a device does not report VLANs its ends are unknown and the page does not claim that the VLAN stops there.
11Maintenance windows
During planned work (replacing a switch, a firmware upgrade, painting rooms …) mtmon sends no mails about the chosen target. Whatever is still down when the window ends is mailed right after it ("still missing after maintenance"). Events are still recorded, marked maintenance.
mtmon --mute 10.0.0.12 2h replacing the switch # one device, 2 hours
mtmon --mute 'AP-2NAD*' 18:00 upgrade # wildcard, until 18:00
mtmon --mute all 22:00-02:00 # whole site, tonight
mtmon --mutes # list
mtmon --unmute 1c3e39c3 # end early| Target | What it mutes |
|---|---|
all | The whole site: controllers, access points, devices, certificates. |
main | A [capsman main], [msm …] or [cnpilot …] name: the controller with all its access points. |
AP-Recepcija, B8:69:F4:…, 192.168.10.21 | An access point by identity, MAC or IP. |
10.0.0.12, SW-core | A device from [switches] by IP or description. |
AP-2NAD*, 10.0.1.* | Everything matching the wildcard * or ?. |
On the dashboard, users with role full have a Maintenance… button at every device, every controller and for the whole site, and a Maintenance panel with End. A window set in the centre (mtmon-admin-center 5.0) arrives with the answer to the next report.
12Weekly and monthly report
On Monday at 7:00 a report for the week before arrives, on the 1st for the month before ([report]). It contains:
- availability of access points, devices and controllers (in %),
- the least available devices (outages, total time, %) and the longest outages,
- Wi-Fi peak (with time) and average, peak per SSID,
- unstable devices, switch restarts, firmware changes,
- certificates expiring within 30 days, version mismatches, maintenance windows.
Outages during a maintenance window do not count against availability (only the time until the window ended). Now: mtmon --period-report week (or month, 7d); -n only prints it.
13Certificates
Once a day mtmon checks with openssl when the certificates of web and mail servers expire and mails at each of warn_days (30, 14, 7, 3, 1 day) and when a certificate is renewed. It also watches its own dashboard certificate.
[certificates]
Web shop = https://shop.example.com
Mail server = smtp://mail.example.com:587
IMAP = imaps://mail.example.com
VPN = file:/etc/ssl/certs/vpn.pem| Target | Meaning |
|---|---|
https://host[:port] | Web server (443). |
smtp://host[:port], submission://host | Mail with STARTTLS (25 / 587). |
smtps://, imaps://, pop3s://, ldaps:// | Direct TLS (465, 993, 995, 636). |
imap://, pop3://, ftp:// | STARTTLS. |
host:port | Any TLS port. |
file:/pot/cert.pem | A file on this server. |
Test: mtmon --certs. The state is on the dashboard in the Certificates panel.
14Unstable devices
An access point or device that drops and comes back again and again sends one "unstable" mail when it has flap_count drops within flap_window minutes (default 4 in 60). A drop is one missed check – also the short ones that cap_miss_threshold and fail_threshold hide – or, for MikroTik, a "disconnected" line about that access point in the CAPsMAN log (flap_log). After an hour without drops it is stable again (an event, no mail).
15Switches over SNMP
With snmp = yes in [switches] (and the snmp / net-snmp-utils package) mtmon also asks every device that answers the ping over SNMP. Alarms are only for the uplinks you list: the port is down, slower than before (or than the given speed), or has more errors than error_rate per minute. Besides: PoE budget (poe_warn %), temperature (temp_warn °C), restart (uptime) and SNMP not answering. All other ports are only in the dashboard statistics (status, speed, errors) – click the switch name.
[switches]
snmp = yes
community = public
10.0.0.11 = SW-core | uplinks=49,50
10.0.0.12 = SW-floor | uplinks=sfp-sfpplus1:10G community=other
10.0.0.20 = Printer | snmp=no| Key | Default | Meaning |
|---|---|---|
uplinks | – | Port numbers (matched to names like Gi1/0/49, 1/1/49, ether49), port names or ifIndex. :10G adds the expected speed; without it the highest seen so far counts. |
snmp | no | On for all; uplinks= turns it on for that device, snmp=no off. |
community / snmp_version | public / 2c | For SNMPv3: snmp_user, snmp_auth_proto, snmp_auth_pass, snmp_priv_proto, snmp_priv_pass. |
error_rate / poe_warn / temp_warn | 10 / 90 / 70 | Alarm limits; 0 = no alarm. |
snmp_timeout / snmp_retries | 2 / 1 | Wait and retries per request. |
VLANs: every port on the dashboard shows its VLANs in a short form, e.g. 1u,20-24t (u = untagged, t = tagged; consecutive VLANs are joined). The tooltip adds the PVID. mtmon reads them from Q-BRIDGE-MIB once an hour; a switch without that table shows none.
Statistics for the device report are recorded with every check: ports in use, PoE power and budget, temperature and the traffic on the uplinks (from the 64-bit interface counters, Mbit/s in and out).
mtmon --check prints what SNMP sees and which port each uplink maps to. All options except uplinks can also be given per device after the |.
16Inventory
Model, serial number, version and firmware of every controller (RouterOS /system resource and routerboard, HP MSM sysDescr; once per inventory_hours), access point and switch (SNMP ENTITY-MIB). The dashboard has a table with Download CSV (separator ;, opens in Excel), the console mtmon --inventory or --inventory --csv. Devices with another version than most of the same model are marked; version changes are events.
17Ports and VLANs of the access points
Since 13.4.0 mtmon asks every access point on its own address every ap_ports_minutes (15) minutes which ports it has and which VLANs they carry. On the dashboard a summary is under the name of the AP (ethernet port with its speed, VLANs); a click on the name shows all ports as tiles - as for switches. The centre and the wall show the same.
| Device | How | VLANs |
|---|---|---|
| MikroTik (CAPsMAN) | SSH with the user and key of the section (or ap_user / ap_key / ap_port); method = api: the API with its user and password. When that does not work: SNMP (ap_community). | bridge VLAN filtering (tagged / untagged, PVID), VLAN interfaces, the VLAN of each wireless / wifi interface (vlan-id, datapath.vlan-id) - over SSH and the API. Over SNMP only the ports. |
| Cambium cnPilot | SNMP with the settings of the section. | where the AP gives them in Q-BRIDGE-MIB |
The user on the APs only needs read rights (group read). An AP that cannot be read has "ports not readable" under its name (the reason in the tooltip); after 3 failures it is only tried every 6 hours. Try it: mtmon --ap-ports or mtmon --ap-ports cAP-Recepcija. When CAPsMAN sends the traffic to the controller (no local forwarding), the VLANs are on the controller, not on the AP - then the AP does not show them.
18Server and disk
The Server section of the dashboard (only for users with role full) and mtmon --server in the console show what mtmon uses: memory (without the file cache, which is shown on its own), CPU (percent of one core over the last check, with the load of the server), processes and the time it has been running. The numbers come from the cgroup of mtmon.service (in a container without it from /proc), so they cover the daemon, the web part and all their child processes together. Below is the disk with the data: how much the data of mtmon takes, how much everything else and how much is free, and the size of the data in groups (history, Wi-Fi clients, switch statistics, events …), counted every 10 minutes.
When less than disk_warn percent (default 10) is free, mtmon sends one mail and a push to the phone, and one more when there is enough space again; until then the warning is also under Problems now. The history takes the most space – make it smaller with [web] history_days and history_hourly_days. The centre (7.4.0 or newer) shows these numbers for every site.
mtmon --server
systemctl status mtmon # Memory, CPU, Tasks from systemd
systemd-cgtop -m # all services, live
du -sh /var/lib/mtmon19Connecting to the centre
- On the centre:
mtmon-admin-center --add-site NAME. It prints a[central]block; the key is shown only once. - On the mtmon: put the block into
/etc/mtmon/mtmon.conf(replace the existing[central]), seturlto the address as this site sees it. With a purchased centre certificate leave outfingerprint. systemctl reload mtmon && mtmon --test-central– it must end withOK.
mtmon only connects out (HTTPS after every check); no ports are opened at the site. What cannot be sent is kept in a queue and sent later. On the first contact it also sends its whole history (from 13.13.0 with centre 7.21.0 every level and the events – see below; to an older centre the checks of the last history_days). Larger backlogs go compressed (gzip) in parts of 300 records, up to 40 parts per check.
The whole history to the centre (--central-resend)
mtmon keeps its history in three levels: each check (history_days, default 30 days), per hour (history_hourly_days, 400 days) and per day (forever), for the devices, the Wi-Fi clients (per SSID and per access point) and the switch statistics, plus all events. From mtmon 13.13.0 with centre 7.21.0 all of it goes to the centre:
- By itself on the first contact with a centre (a new site on the centre): after the first report it sends every level and the events in the background, at most 60 s at a time, and goes on where it stopped at the next checks. In the log:
Central: first contact - the local history goes to the centre after this reportand at the endCentral: the local history is at the centre (N record(s) …). - By hand:
mtmon --central-resend– when the centre is new or lost its data (e.g. you moved only the centre's config, not its data). It prints each file and how many records went. - The centre gathers the parts and merges them with what it has: its records stay, each record is there once, the hours and days of mtmon replace its own (the centre may have only part of an hour or day). Running it again is therefore safe – nothing is doubled. The events sent this way cause no mail or push.
- It is sent compressed (gzip) in parts of about 1.5 MB; a typical site (some 10 000 records, a few MB) is done in seconds to a minute.
- An older centre (before 7.21.0) does not take it; on the first contact it gets, as before, only the checks of the last
history_days, and--central-resendsays it needs 7.21.0.
mtmon --central-resend
# Sending the whole local history to https://center.example.com: 12 file(s), 27747 record(s), 7.8 MB
# history-1d.jsonl 82 of 82 record(s)
# ...
# Done: 27747 record(s) in 15 request(s), 13 s. The centre merged them with what it had.Agent: mtmon without a disk (MikroTik container)
For a router without a USB stick or disk: the mtmon-agent container runs only in RAM (mtmon --agent) and writes nothing to the flash. It needs a centre 7.13.0+ that the router can reach.
- The configuration is on the centre (
mtmon-admin-center --add-site NAME --agentcreates it from a template; edit it on the centre's page – Sites → the agent link next to the version). The same settings as mtmon.conf;[central],state_fileand the mail server are not needed. A change reaches the agent with its next report; a faulty one is refused, the agent keeps the previous one and the error (with the line) shows on the centre. - The container gets only the variables
MTMON_CENTRAL(the centre's address),MTMON_KEY(the site's key) and, with a self-signed certificate,MTMON_FINGERPRINT;MTMON_DATA(default/tmp/mtmon) is the data folder. - The centre sends the mails: to
[mail] toof the agent configuration, elsemail=of the site, else the centre's[mail] to. The weekly and monthly reports come from the centre. - The state survives a restart: the centre keeps the agent's state (known access points and devices, maintenance windows, topology, inventory) – every 15 minutes and after every change. An agent with an empty RAM disk takes it back and carries on; a missing access point stays missing.
- Local history only two days (the history and the charts are on the centre).
- The RouterOS instructions (RAM disk, the image file, a script that creates the container at every boot) are in the README of the mtmon-docker repository.
Which versions go together
A new mtmon and a new centre are released together (mtmon 12.0.0 with mtmon-admin-center 6.0.0). Any mix works – each side skips what it does not know – but some things need both to be new enough:
| Feature | mtmon | centre |
|---|---|---|
| status, problems, site dashboard, mail when a site stops reporting | 9.0.0 | 1.0.0 |
| reports in parts, compressed | 10.1.0 | 4.1.0 |
| maintenance windows set on the centre | 11.0.0 | 5.0.0 |
| Wi-Fi clients per access point | 11.2.1 | 5.1.0 |
| switch statistics in the device report, VLANs on ports | 12.0.0 | 6.0.0 |
the whole history to the centre (every level and the events): on the first contact and mtmon --central-resend | 13.13.0 | 7.21.0 |
mtmon --version prints which centre it needs; mtmon --test-central shows the version of the centre and what it does not take.
20Logs
mtmon writes to the systemd journal (with a level: info, warn, error). Useful commands:
journalctl -u mtmon -f # live
journalctl -u mtmon --since today # today
journalctl -u mtmon --since "2 hours ago"
journalctl -u mtmon -p warning --since "7 days ago" # warnings and errors only
journalctl -u mtmon --since "7 days ago" | grep -i sign # dashboard sign-ins
journalctl -u mtmon --since today | grep -i central # reporting to the centre
journalctl -u mtmon -o short-iso --no-pager > mtmon-log.txt # export to a fileDetailed (debug) log
To look for a problem without changing the service, run one check by hand: mtmon --once --dry-run -d. For a lasting detailed log in the service:
mkdir -p /etc/systemd/system/mtmon.service.d
cat > /etc/systemd/system/mtmon.service.d/debug.conf <<'EOF'
[Service]
ExecStart=
ExecStart=/usr/bin/mtmon --config /etc/mtmon/mtmon.conf -d
EOF
systemctl daemon-reload && systemctl restart mtmon
# off:
rm /etc/systemd/system/mtmon.service.d/debug.conf && systemctl daemon-reload && systemctl restart mtmonCommon messages
| Message | Meaning |
|---|---|
mtmon X started for '…'; interval 300 s | The service started. |
Configuration reloaded. | Config read after a reload. |
Configuration reload failed, keeping the previous one: … | Error in the config – the old one stays; the reason is in the message. |
Report sent: … | Mail sent; the message holds the summary. |
Sending mail failed, state not saved | Mail failed; mtmon tries again at the next check. |
CAPsMAN 'x' (IP): SSH … failed (consecutive failures: N) | Controller unreachable; a mail goes after fail_threshold. |
… forgetting access point … | Access point forgotten after forget_after_days. |
reading Wi-Fi clients failed | Only a gap in the chart; monitoring is not affected. |
Web dashboard on https://… | Dashboard is running. |
Web dashboard: 'ime' signed in from IP | Dashboard sign-in. |
Web dashboard: failed sign-in as 'ime' from IP (N) | Wrong password; N = attempt in a row. |
Web dashboard stopped (…), restarting in N s | The web part stopped and is restarted. |
Central: first contact - the local history goes to the centre after this report | First contact with the centre; the whole history follows in the background (13.13.0). |
Central: the local history is at the centre (N record(s) in P request(s), S s) | The whole history is on the centre. |
Central: the centre is older than 7.21.0 - it gets only the checks of the last N days | An older centre: as before only the checks of the last history_days. |
Central: sending the history (FILE) failed: … | Tries again at the next check, goes on where it stopped. |
Central: N history record(s) of the last N days to send | An older centre or an agent: the checks go through the queue. |
Central …: sending failed (…), N record(s) kept for later | Centre unreachable or refused; the records wait. |
Central …: reachable again, sent N queued record(s) | Backlog sent. |
21Files and folders
| Path | Content |
|---|---|
/etc/mtmon/mtmon.conf | Configuration. |
/etc/mtmon/mtmon.conf.dist, .bak-VERZIJA | Template of the last upgrade and the config before it (since 13.3.0). |
/var/lib/mtmon/server.json | Last sample of the server (CPU, folder sizes, disk alert). |
/etc/mtmon/id_ed25519(.pub) | SSH key for the MikroTiks. |
/etc/mtmon/web.crt, web.key | Dashboard certificate. |
/var/lib/mtmon/state.json | State of access points and devices. |
/var/lib/mtmon/known_hosts | SSH keys of the devices. |
/var/lib/mtmon/events.jsonl | Events. |
/var/lib/mtmon/history*.jsonl, clients*.jsonl, clientsap*.jsonl, devstats*.jsonl | History (every check, hourly, daily); clientsap = clients per access point; devstats = switch statistics (since 12.0.0). |
/var/lib/mtmon/report-cache/ | Computed reports of finished months. |
/var/lib/mtmon/clients.json | Last reading of the Wi-Fi clients. |
/var/lib/mtmon/central.json, central-queue.jsonl | Centre reporting state and queue. |
/var/lib/mtmon/maintenance.json | Maintenance windows. |
/var/lib/mtmon/certs.json, inventory.json, report.json | Certificate state, inventory, last report sent. |
/usr/share/mtmon/ | Dashboard, report page, CHANGELOG.md, config template mtmon.conf.template. |
/usr/share/doc/mtmon/ | README, CHANGELOG, this manual (HTML, Slovenian and English). |
/usr/lib/mtmon/mkcert | Script for a new certificate. |
Backup: /etc/mtmon/ and /var/lib/mtmon/. The history is in plain text files (JSON Lines), so copying them while running is fine.
22Maintenance
Access point removed for good
mtmon --forget B8:69:F4:00:00:02 # or identity or IPNew baseline
mtmon --reset deletes the state; the next check sends a mail with all access points and devices. Chart history stays.
Changed device SSH key
After a MikroTik is replaced or reset, mtmon reports it as unreachable. Once you have verified the device, remove the old key:
sudo -u mtmon ssh-keygen -f /var/lib/mtmon/known_hosts -R 10.0.0.1Renamed SSID
mtmon --rename-ssid "Old name" "New name" # all controllers
mtmon --rename-ssid "Old name" "New name" hotel # only [capsman hotel]Moving to a new server
mtmon keeps everything in two folders: /etc/mtmon/ (config, SSH key for the MikroTiks, dashboard certificate) and /var/lib/mtmon/ (state, all history – hourly and daily for the reports too –, Wi-Fi clients, known_hosts, the queue for the centre). If a path in the config (key, certificate) points outside /etc/mtmon/, take that file along too. On the old server:
systemctl stop mtmon
tar czf /root/mtmon-backup.tgz -C / etc/mtmon var/lib/mtmon
systemctl start mtmonOn the new server install mtmon, then:
systemctl stop mtmon
tar xzf mtmon-backup.tgz -C /
chown -R mtmon:mtmon /var/lib/mtmon
chown root:mtmon /etc/mtmon/mtmon.conf && chmod 640 /etc/mtmon/mtmon.conf
chown mtmon:mtmon /etc/mtmon/id_ed25519* /etc/mtmon/web.crt /etc/mtmon/web.key && chmod 600 /etc/mtmon/id_ed25519 /etc/mtmon/web.key
systemctl start mtmon- New server IP: if the MikroTiks or switches limit SSH, API or SNMP to the server's address, add the new IP to their rules.
- Centre: the site key is in the config; the centre recognises the site and carries on where it left off.
- Dashboard certificate: if the server name changes, issue it again.
The same archive is also a good backup.
Changes by version
mtmon --changelog | less # everything
mtmon --changelog 10.0.0 # only after 10.0.023Step by step
A new switch with SNMP
- On the switch enable SNMP v2c (read only) or v3 and allow the address of the mtmon server.
- Check from the server:
snmpwalk -v2c -c public 10.0.0.11 1.3.6.1.2.1.1must return its name and description. - Add a line to
[switches], e.g.10.0.0.11 = SW-core | uplinks=49,50(uplinks: alarms only for these ports), andsnmp = yeswithcommunity. mtmon --check– shows whether the switch answers and what is read.systemctl reload mtmon. Ports, VLANs and neighbours are on the dashboard after the next check, in the topology after the next search (or now:mtmon --topology).
MikroTik CAPsMAN over the API
- On the MikroTik:
/user group add name=mtmon policy=read,apiand/user add name=mtmon group=mtmon password=…. /ip service: allowapi(8728) orapi-ssl(8729) from mtmon's address.- In mtmon.conf a section
[capsman NAME]withhost,method = api,user,password. mtmon --check, thensystemctl reload mtmon.
Work on a device without false alarms
- Before the work: Maintenance at the device on the dashboard (or
mtmon --mute 10.0.0.11 2h "replacement"). - During the window no mails about that device; on the centre it shows as "maintenance".
- When the window ends, whatever is still wrong is reported at once ("after maintenance"). End it sooner with the button or
mtmon --unmute.
Upgrade
- Read the CHANGELOG of the new version (in the package and in
/usr/share/doc/mtmon). apt install ./mtmon_X_all.debordnf install ./mtmon-X.noarch.rpm. The package adds new settings to the config (commented out) and restarts the service.mtmon --versionandjournalctl -u mtmon -n 30– no errors. State, history and maintenance windows stay.- If the site reports to a centre: the centre accepts older versions too; the sites table shows which are older than the latest.
Push to the phone
- Install the MT-Mon app (APK) and add a server – the centre (recommended) or mtmon – with its address and sign-in.
- Turn on notifications for that server in the app;
--push-liston the server shows the phone. - On Xiaomi/MIUI and similar: battery saver for MT-Mon no restrictions, autostart on, lock the app in the recent apps.
- The phone must reach the server all the time (VPN or the internal network). What comes is chosen in the app (categories per user).
24Troubleshooting
- CAPsMAN unreachable
mtmon --checkshows the SSH error. Check: user and key on the MikroTik (/user ssh-keys print),/ip servicessh port andaddress, firewall, port in the config (host = IP:PORT). Manual test:sudo -u mtmon ssh -i /etc/mtmon/id_ed25519 -p 22 mtmon+ct@10.0.0.1 /system identity print.- "Host key verification failed"
- The device key changed – see Changed device SSH key.
- No mail arrives
mtmon --test-mailprints the reason. For TLS errors:smtp_hostmust be the name in the certificate, or setssl_verify_name; for a self-signed onessl_verify = 0. Test:openssl s_client -starttls smtp -connect HOST:587 -servername HOST.- HP MSM: "No Such Object" or false missing
- mtmon reads incomplete tables again up to
max_wait; increasemax_waitortimeout.mtmon --checkshows the number of retries. - cnPilot: "no answer (timeout)"
- No community is stored on the APs (see Cambium cnPilot) or the community in the config differs. Test with
snmpgetfrom the same server. - Dashboard does not open
journalctl -u mtmon | grep -i web; checkallow, the server firewall andcurl -vk https://localhost:8686/healthz.- Gap in the Wi-Fi chart
- Reading the clients failed at that time or mtmon was not running; look for
Wi-Fi clientsin the log. - Reporting to the centre fails
- See Connecting to the centre.
- The mail comes, the push does not
- On the server (mtmon or centre)
--push-list: if "Last seen" is older than an hour or two, the phone no longer asks – the system stopped the app (MIUI etc., see Push to the phone) or it has no connection (VPN). Restarting the phone or turning notifications off and on in the app starts it again. Events marked maintenance, "behind" or summarised (more than 5 outages) are not pushed on purpose. - The topology is empty or wrong
- mtmon first looks for it a few minutes after it starts, then every
topology_hours;mtmon --topologylooks now and prints the tree with how each link was found. For ports on both ends it needs LLDP/CDP on the switches (SNMP) or/ip neighborof the MikroTiks; without them it guesses from MAC tables (dashed lines). - Devices behind a failed switch are not "behind"
- The topology does not know they hang behind it – look where they are on the topology page. Most often LLDP/SNMP is missing on a switch in between, or the network changed after the last search (
mtmon --topology). - A VLAN link is dashed / "not known"
- The device on one end does not report VLANs (SNMP Q-BRIDGE-MIB, RouterOS API). So the page does not claim that the VLAN stops there.
- "Download PDF" makes no PDF
- Safari and some older browsers do not let the page draw the report into a picture. Use Chrome, Edge or Firefox, or Print → Save as PDF.
- Agent: "waiting for the configuration"
- The centre has no configuration for that site (
mtmon-admin-center --agent-config ID), the key is wrong (HTTP 401) or the agent cannot reach the centre (address, VPN, certificate –MTMON_FINGERPRINT). See Agent.