Situation
One Saturday morning the business software of John Smith Ltd (erp.johnsmith.test, on the server 192.168.10.41) hung. Nobody noticed until Monday, when the administration could not issue invoices. Shortly afterwards it turned out that the export of the business software’s database, which a scheduled script runs on the server every four hours, had been failing for a week without telling anybody.
Laura White (lwhite, IT) installs the Monitoring module. She wants to:
- know within a few minutes, by mail and on her phone, when the business software or the NAS do not answer;
- know in time when the certificate of the public name is about to expire;
- be alerted when the database export fails or does not start;
- send John Smith, on the first of the month, the previous month’s availability.
What you need
- A console administrator account (
lwhite). - The business software reachable from the appliance:
http://erp.johnsmith.test:8080. The server is behind the Argos site, which is linked to Atlas. - The NAS (192.168.10.20) registered in Network → IPAM with the description
NAS. - For the alerts on the phone: the Chat module installed, and Edon Client on Laura’s phone with Advanced communication turned on for her user (Active Directory → Users → lwhite, «Features» block).
- For the export: being able to edit the scheduled script on the business software’s server.
Steps
Install the module
- Open System → Modules, select the «Monitoring» card and press «Next».
- Read the summary (the engine runs on the appliance, it starts with a few monitors, the alerts go to the bell) and press «Deploy».
- After a few seconds the bell shows «Monitoring installed». In the menu, under Network, there is now Monitoring.
- Open Network → Monitoring: the suggested monitors are already there, «Internet (Cloudflare)», «Internet (Quad9)», «Web browsing», «Name resolution» and «Gateway». Within a minute they go from «Waiting» to «Up».
The business software
- Press «New monitor» (the «+» of the bar).
- «Name»:
ERP; «Category»:Server; «What it checks»: «Web page (HTTP/HTTPS)». - «Address (URL)»:
http://erp.johnsmith.test:8080/login; «Expected status»:200. - When it hangs, the business software still answers but shows
Service unavailable: write it in «Text expected in the page» and turn on «The text must be missing». - «Slowest answer (ms)»:
3000. A sign-in page that takes more than three seconds is already a problem for the people working. - In the «Thresholds and alerts» block leave «Every (seconds)» at
60and «Failures before down» at3: a hang is told after about three minutes, and a single error does not disturb. Turn on «Show on the dashboard». - The business software reboots every Sunday at 3: in the «Maintenance windows» block press «+» («Add maintenance window»), «Start (hh:mm)»
03:00, «Duration (minutes)»30, «Days» Sun, «OK». - Press «Create». The page goes back to the list, with «Monitor saved».
The NAS, from IPAM
- Open Network → IPAM, the network
192.168.10.0/24, and select the address192.168.10.20(descriptionNAS). - In the address’s bar press «Monitor this host». A new monitor of type «Ping» opens, with the name
NASand the host192.168.10.20. - «Category»:
Server. Press «Create». In the list the monitor’s origin is «From IPAM».
The public name’s certificate
- «New monitor»: «Name»
Certificate atlas.johnsmith.test, «Category»Sites, «What it checks» «Certificate expiry». - «Host»:
atlas.johnsmith.test; leave «Port» empty (443); «Warn this many days before»:20. Let’s Encrypt renews the certificate 30 days before: if at 20 days it has not yet done so, something is wrong. - «Create».
The database export (push)
-
«New monitor»: «Name»
ERP export, «Category»Server, «What it checks» «Job reporting (push)». -
The console prepares the «Address the job calls», of the form
https://atlas.johnsmith.test/api/uptime/push/<token>?status=up. Select it with a click and copy it. -
The export runs every four hours (at 1, 5, 9…) and takes about twenty minutes. In «Every (seconds)», which for a push is the maximum silence, write
18000(5 hours): if a run does not start at all, an hour later the monitor goes down. -
Turn on «Show on the dashboard» and press «Create».
-
On the business software’s server, at the end of the export script, add the call. On Windows (PowerShell):
$push = "https://atlas.johnsmith.test/api/uptime/push/<token>" if ($exportOk) { Invoke-RestMethod ($push + "?status=up") } else { Invoke-RestMethod ($push + "?status=down&msg=export%20failed") }On Linux, with
curl:curl -fsS "https://atlas.johnsmith.test/api/uptime/push/<token>?status=up&ping=$DURATION_MS" -
To test, run the script by hand: the monitor goes to «Up» and in the «Trend» block the successful check appears.
Warning The token in the address is the monitor’s secret: whoever knows it can say that the export went well. Keep it in the script, not in a shared document. If it has ended up where it should not have, press «New token», «Save» and update the script.
Who is alerted
- Open System → Settings → Monitoring.
- Mail panel: «Send mails» on; in «Recipients» add
lwhite@johnsmith.test. - Edon Client chat panel: turn on «Write in the chat». In «Accounts» press «Choose a user…», search
Lauraand pick Laura White: the list has only the users with Advanced communication on. - Monthly report panel: leave «Remind every (hours)» at
24; turn on «Send the monthly availability report», «Day of the month»1, and in «Report recipients» addjsmith@johnsmith.test. - Press «Save»: «Monitoring settings saved».
- Reopen the block and press «Send a test». The console says «Test sent: …» with the channels reached. Laura receives the mail «Monitoring test» and, on the phone, a message from the «Monitoring» account in Edon Client.
Tip Telegram is added in the same way, in the Telegram panel: the bot token that @BotFather gives and the id of the IT group chat (it starts with
-). The bot must be in the group.
Check
-
Network → Monitoring lists nine monitors, all «Up»; the NAS, the business software and the export have the category
Server. -
System → Status, «Monitoring» tile: «9 Up», «0 Down», «0 Warnings», and below it «ERP» and «ERP export» on two lines, with the time of the last check and the bar of the latest results.
-
A test outage, without stopping anything. Open
ERP, press «Duplicate monitor» and in the copy change the address tohttp://erp.johnsmith.test:8081/login(a port on which nobody answers); «Create». Within three or four minutes:- the copy is «Down» with the error «Connection refused» (or «No answer»);
- the outage appears in the bell, and in the Status tile the copy appears even though it is not on the dashboard;
- the mail «ERP (copy) is down» and the chat message «🔴 ERP (copy) is down» arrive.
Then delete the copy with «Delete monitor». If instead you put it back on the right port, after two successful checks «🟢 ERP (copy) is back up» arrives with the duration.
-
On the first of the month, from 7 o’clock, John receives «Availability of …» with the table of the monitors. The same table is on the status page (the list’s «Status page» button), under «Monthly availability».
If something goes wrong
-
The business software is «Down» with «The name does not resolve». The appliance does not resolve
erp.johnsmith.test: check the record in DNS, or use the addresshttp://192.168.10.41:8080/login. -
The NAS is «Down» but works. It does not answer ping. Change the type to «TCP port», port
445(the shares) or443(the panel). -
The export stays «Waiting» or goes down even though the script ran. The script does not reach the address:
- a certificate error: call the appliance with a name that has a valid certificate, the same one you use to open the console without browser warnings;
- a 404: the token is not the monitor’s, or it was changed with «New token»;
- «Access from the internet is not allowed»: the call comes from outside the local network.
Try the same call by hand from the server: if it works it answers
{"ok":true}. -
«Monitor saved, but the engine refused the configuration: …». The monitor is in the database, but the engine carries on with the previous configuration. Correct the field the message points to and save again.
-
«The test did not go: …». The message says which channel did not work: for mail check Mail → Logs; for Telegram the token and the chat id, and that the bot is in the chat; for the chat that the Chat module is active.
-
Nothing arrives in the chat, but the mail does. The monitor has «Tell the channels» off, or Laura no longer has Advanced communication: without it, she cannot use the chat.
-
Too many alerts at night for scheduled jobs. Add a maintenance window to the monitor, or in System → Settings → Monitoring a window that applies to all.
-
Nothing arrives any more and the Status tile still says everything is «Up». The engine may be stopped: the status page says so («The monitoring engine does not answer…»), and a mail «The monitoring does not answer» has gone out. Check the «Monitoring» service in the Services tile of System → Status and restart it from there.