awesome-sre
A curated list of Site Reliability and Production Engineering resources.
- 14k
- CC0-1.0
- 15 mo ago
On-prem/LAN Layer 2 & 4 availability monitoring with realtime guarantees & decaying alert pacing. Multithreaded high speed availability checking for SNMP, PING, TCP/UDP, QUIC & HTTP/S resources incl. SSL/TLS cert. pinning & port MAC address pinning. Integrates w/Site24x7 heartbeat monitoring for failover alerts + MRTG + Slack & Pushover webhooks.
Repo CompSciFutures/APMonitor, read from GitHub 15 h ago. CompSciFutures has not joined Take My Repo.
CompSciFutures/APMonitor is a public repo on GitHub by CompSciFutures. On-prem/LAN Layer 2 & 4 availability monitoring with realtime guarantees & decaying alert pacing. Multithreaded high speed availability checking for SNMP, PING, TCP/UDP, QUIC & HTTP/S resources incl. SSL/TLS cert. pinning & port MAC address pinning. Integrates w/Site24x7 heartbeat monitoring for failover alerts + MRTG + Slack & Pushover webhooks. It declares no license on GitHub. Public does not mean open source: without a license, nobody is granted the right to reuse it. It is written mainly in Python, has 134 stars and last changed on 2026-11-18. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-22.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
APMonitor.py - A Hands-Off Layer 2 & 4 On-Premises Monitoring Tool with Alert Delivery GuaranteesBuilt for NOCs and OT/ICS Sensor Networks: This is an on-prem monitoring tool written completely in very clear Python-only code (so you can modify it) and is designed to work on a LAN for on-prem availability monitoring of resources that aren't necessarily connected to The Internet, and/or where the on-prem monitoring itself is also required to have availability guarantees.
It is particularly suited to availability monitoring of embedded devices +/- 10 secs. It's designed primarily for firewalls, switches, routers, hubs, environmental sensors & #OT / #ICS systems, but works with normal servers & services as well.
It supports multi-threading of the availability checking of monitored resources for high speed near-realtime performance, if that is what you need (see the -t command line option). The default operation mode is single-threaded for log clarity that runs on small systems like a Raspberry Pi.
It also supports pacing of monitoring alarms using a decaying curve that delivers alert notifications quickly at the start, then slows down notifications over time.
APMonitor.py (APMonitor) is primarily designed to work in tandem with Site24x7 and integrates very well with their "Heartbeat Monitoring".
To achieve guaranteed always-on monitoring service levels, simply setup local availability monitors in your config, sign-up for a Pro Plan at Site24x7 then use heartbeat_url and heartbeat_every_n_secs configuration options to APMonitor.py to ping a Heartbeat Monitoring URL endpoint at Site24x7 when the monitored resource is up. This then ensures that when a heartbeat doesn't arrive from APMonitor, monitoring alerts fall back to Site24x7, and when both are working you have second-opinion availability monitoring reporting.
The service level guarantee works as follows: If the resource is down, APMonitor.py won't hit the Heartbeat Monitoring endpoint URL, and Site24x7 will then send an alert about the missed heartbeat without the need for any additional dependencies on-prem/on-site. So the entire machine APMonitor.py is running on can fall over, and you still get availability monitoring alerts sent, with all the benefits of having on-prem monitoring on your local network behind your firewall.
You can quickly signup for a Site24x7.com Lite or Pro Plan for $10-$50 USD per month, then setup a bunch of Heartbeat Monitoring URL endpoints that works with APMonitor.py rather easily.
Note: Heartbeat Monitoring is not available on their Website Monitoring plans. You need an 'Infrastructure Monitoring' or 'All-In-One' plan for it to work correctly.
APMonitor also integrates well with Slack and Pushover via webhook URL endpoints, and supports email notifications via SMTP.
APMonitor is a neat way to guarantee your on-prem availability monitoring will always let you know about an outage and to avoid putting resources onto the net that don't need to be.
This is the way SNMP was meant to be used. For embedded devices. Like the way they are.
If you have any changes or find APMonitor.py useful in your NOCs, for monitoring your IOT/ICS devices,
or would like email / telephone support, please do let me know and consider
a regular donation via Buy me a coffee,
so I can keep improving it.
Andrew (AP) Prendergast
https://linktr.ee/CompSciFutures
Master of Science
Ex-ServerMasters
Ex-Googler
Ex-Xerox PARC/PARK
Ex-Intel Foundry
Ex Chief Scientist @ Clemenger BBDO / Omnicom
As seen in:
Please use Discussions here for technical support. See: https://github.com/CompSciFutures/APMonitor/discussions
For more hot tips on Cyber Security and Physical Security in these dystopian times, take a look at my Physical Security tips on APMonitor.PY here:
And the BeerIsGood Security & Privacy links collection is also rather decent:
https://github.com/beerisgood/Security-link-collection
If I get enough support, my plan is to add RMON/RMON2 support and "Humanizing Data" automated information retrieval to it in a few months time.
Information about common use cases you hunt for and detect that need automation would be helpful in this regard.
Feel free to contact me for a chat...
Telephone Support: +61497222775
Support email: hello@enertium.org
[!WARNING] BREAKING CHANGE — monitor types have been renamed (1.4.x stream). Your existing YAML/JSON configs MUST be updated before upgrading.
Old type:New type:switchrouterportsswitch
port,host,ping,http,quic,tcpandudpare unchanged.Rename in this order:
switch→routerFIRST, thenports→switch. If you do it the other way around, or skip the first step, every oldtype: switchmonitor will silently be treated as the newtype: switch, which does not collect RMON packet size / error type distributions or IP-stack counters, and does not generate the stacked per-port charts. There is no validation error to warn you about this, becauseswitchis still a valid type.A config that still contains
type: portsis rejected at startup with: "type 'ports' is not valid. Did you mean type: switch?"To update a YAML config in place (a backup is written to
apmonitor-config.yaml.bak):sed -i.bak \ -e 's/\btype: switch\b/type: router/' \ -e 's/\btype: ports\b/type: switch/' \ /usr/local/etc/apmonitor-config.yaml ./APMonitor.py --test-config /usr/local/etc/apmonitor-config.yamlThe
sedcommand does not catch quoted values (type: "ports") or JSON configs ("type": "ports") — edit those by hand, and always run--test-configafterwards.What else to expect after upgrading:
- RRD files are unaffected. The RRD schema and filenames (
<monitor>-snmp.rrd) have not changed, so no RRDs need to be deleted for this rename.- Statefiles are unaffected, but because the
typefield is part of each monitor's configuration checksum, every renamed monitor is checked immediately on the first run.- Detail pages are renamed. Detail pages are written as
<type>-<monitor>-detail.html, soports-*-detail.htmlbecomesswitch-*-detail.htmland the oldswitch-*-detail.htmlbecomesrouter-*-detail.html. Stale old-named pages are not removed automatically; delete them from/var/www/html/mrtg/<site-name>/if you wish.- MRTG index headings and log lines change (
ports: name→switch: name,switch: name→router: name,PORTS ...→SWITCH ...). Update any log scrapers or alert filters that match on these strings.- APMonitor sends a one-shot "Config file changed" notification (with a diff) the first time it sees your edited config file.
To get started with "Physical Cyber Defence" jump to the tips section "Recommended configurations for addressing the first pillar: Physical Security"
To run APMonitor with a configuration file and auto-derived statefile under /var/tmp/APMonitor/:
./APMonitor.py test-apmonitor-config.yaml --generate-rrds
./APMonitor.py site1.yaml site2.yaml --generate-mrtg-config
To properly setup APMonitor.py:
Spin up Debian Linux on a VM or PC on a Card/PC on a Chip (e.g., rPI) - optional but recommended
This is required because control of /var/www/html is taken over when installing the MRTG web interface.
Install APMonitor (to spin up APMonitor.py in systemctl as apmonitor.service)
sudo make install
Install MRTG web interface (to spin up an NGINX webserver for MRTG charts in systemctl as apmonitor-nginx.service)
sudo make installmrtg
Edit /usr/local/etc/apmonitor-config.yaml
See Configuration Options for site file configuration details.
Test the config (using ./APMonitor.py --test-config /usr/local/etc/apmonitor-config.yaml):
sudo make test-config
Start monitoring:
sudo make enable
Note: Statefiles are stored under /var/tmp/APMonitor/ by default, e.g. /var/tmp/APMonitor/apmonitor-config.statefile.json for a default install. The -s flag overrides this for single-config invocations only.
That's it!
[!WARNING] If you are upgrading to the 1.3.x stream (and again for the 1.4.x stream): This is a schema change release stream that contains RRD & config YAML schema changes that require existing RRD files to be deleted and recreated before upgrading. APMonitor will auto-heal existing RRDs on first run when
--generate-rrdsor--generate-mrtg-configis specified.To do a full upgrade change your YAML to replace
type: snmpwithtype: switch(and see the monitor type rename warning above if you have existingtype: portsortype: switchmonitors) then execute something similar to this command:cp tellusion-apmonitor-config.yaml /usr/local/etc/apmonitor-config.yaml; \ make install; make installmrtg; \ rm /var/tmp/apmonitor-statefile.rrd/*
[!WARNING] 'switch' has changed to 'router' and 'ports' to 'switch'
Installing MRTG with make install; make installmrtg will spin up via rc.d a small lightweight NGINX web server with FastCGI on http://localhost:888/, as follows:

This layout is specifically designed for now commonly available 4K Ultra HD (3840x2160 16:9 2160p) screens. It's not uncommon to see modern NOCs with an array of these on the wall at eye height when someone is sitting down. Instead of just having CCTV, you can now add some proper network telemetry and instrumentation, say with one YAML site file per screen, on the top row of screens.
Clicking on the heading associated with a set of ports will provide more L2/L3 information (depending on what's available via SNMP):
Note the NGINX/FastCGI combination means we don't need to keep a machine chewing on itself generating charts anymore - they are now generated on demand in near-realtime and extremely efficiently. The only I/O is the RRD files, which under the hood operate very much like the older MRTG text file format.
I chose RRD because it's a rather good frequency domain format for data warehousing of frequency domain sample data that's still compatible with Tier 1 NOCs.
If you want to work with this data directly, consider looking at LibROSA from NYU's Fourier Lab team. It is designed for working with Frequency Domain/Time Domain data and has a rather nifty spectrogram visualisation which might be relevant to you, amongst other things. See the launch lecture given at SciPy for more information.
You might also want to look at nixtla.io or R's seasonal decomposition function called stl. Nixtla is more advanced and I've posted on 𝕏 about it here.
Once upon a time, I was well known in data center circles along Highway 101 in Silicon Valley for carrying in my back pocket a super lightweight pure C/libc cross-platform availability monitoring tool with no dependencies whatsoever called APMonitor.c. I'd graciously provide the source code to anyone who asked.
This is a rebuild of that project with enhanced features, starting with a Python prototype.
The design philosophy centers on simplicity and elegance: a single, unified source file containing the main execution flow for a 100% on-premises/LAN availability monitoring tool with guaranteed alerts and intelligent pacing.
Key Features:
If lightweight or realtime guarantees aren't important to you, and you want something more feature packed, consider these on-prem alternatives:
APMonitor is simple, minimalist, elegant and lightweight and comes from a reliable line of heritage so you can spin
it up fast as a 2nd opinion monitoring tool with little more than a make install. If you want something more
sophisticated that's less focused on realtime programming or elegant simplicity, take a look at those very capable
alternatives.
NB: This tool is useful for implementing the second & third pillars (Availability & System Integrity) from the 12 Pillars of Information Security (see ResearchGate mini-paper DOI: 10.13140/RG.2.2.12609.84321), for Necessary, Sufficient & Complete Security:
Also be mindful of the Attack Surface Kill-Switch Riddle:

To address this riddle, you should try to configure your machines & devices so that even if they are shutdown or halted in some way, the Ethernet MAC address can still be read at Layer 2 so you can still receive alerts like this:
NB. Be careful that your definition of "Kill Switched" is well defined and tested before the need to make use of it comes time. E.g., downing a port never works long term, it's merely advisory and something one does as they walk across the floor to unplug the cable from a switch. Or is it, if you have this? YMMV.
See DOI 10.13140/RG.2.2.12609.84321 and associated LinkedIn post for more information on the Pillars of Information Security. It borrows from a piece of work I did back when #PARC needed me to work on #BookMasters in the digital era.
There is also some guidance on addressing the first pillar: Physical Security in the recommended configurations below.
To put APMonitor into near-realtime mode so that it checks resources multiple times per second, use these global settings:
-t 15 on the command line or max_threads: 15 in the site config,max_retries to 1 andmax_try_secs to 10 or 15 secondsfor real-time environments.
NB: If you are running APMonitor.py out of systemd with a default install, not specifying max_threads will default to 20.
[!WARNING] You need to make sure your configs have enough threads to finish in << 10 seconds to get near-realtime performance. Make sure
max_threads&max_try_secsare configured appropriately. Also note that separate site configs are executed in parallel as subprocesses, so any down monitors in one site do not slow down monitors in other sites, regardless of settings.Note that the thing that usually slows down a site configuration are monitors that are down — you need enough threads to cover the maximum number of down monitors at any one time, on average. We say 'on average' because not all monitors are polled simultaneously after a decent period of a site config having been operational.
IOT is not supposed to be a thing - to compensate if you have an NVR, you need L2 monitoring of MAC address changes for each OT/ICS device such as cameras, NVRs & Security Computer on your IOT network.
Use Layer 2 Port MAC Change Monitoring, Layer 4 HTTPS Self-Signed Certificate Pinning and Layer 2 MAC Address Pinning so your network can't be tampered with.
To avoid vendor backdoors, disable IPV6 and stop your IOT devices from communicating directly with The Internets excepting whitelisted addresses for purposes you specify (don't whitelist any cloud admin reverse shells).
You do need to configure Site24x7's Heartbeat Monitoring to achieve high-availability second opinion availability monitoring.
As an exemplar, for the following monitored resource:
monitors:
- type: http
name: home-nas
address: https://192.168.1.12/api/bump
expect: "(C) COPYRIGHT 2005, Super NAS Storage Inc."
ssl_fingerprint: a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890
heartbeat_url: https://plus.site24x7.com/hb/your-unique-heartbeat-id/homenas
heartbeat_every_n_secs: 300
Setup Site24x7 as follows:

This will send a heartbeat to Site24x7 every 5 minutes, and Site24x7 will drop an alarm whenever a heartbeat doesn't arrive or arrives out of sequence +/- 1 minute (i.e., if the heartbeat doesn't arrive or is > 60 seconds out). This ensures availability monitoring will always function, even when one of APMonitor or Site24x7 is down.
This also means you don't need to expose internal LAN network resources to The Internets.
APMonitor's near-realtime capabilities will deliver heartbeats +/- 10 secs, so if you want high-precision alerts drop an alarm if a heartbeat does not arrive bang on 5 minutes apart +/- 10 secs.
To see the accuracy, configure Site24x7 as follows:

Site24x7 will record the error in their dashboard for anything that is more than +/- 1000 ms out, so you can keep a record of how accurate the near-realtime heartbeat timing is.
See Site24x7 docs for more info:
NB: "+/- 10 secs" means your errors should be measurable in 10ths of a minute. Once Mercator Queues are added, this will drop down to "+/- 1 sec" or possibly "+/- 100 ms", depending on how well Python performs with high-speed realtime programming. A workaround in the meantime is to make sure your number of threads is equal to the number of monitored resources - something that is not necessarily practical or required in most settings.
If you want to avoid the need to connect to the monitoring server to hush alarms as they happen and ensure you receive UP notifications as soon as things return to normal, you might also want to consider alarm notification pacing, so that recently down resources generate more frequent messages, whilst long outages are notified less frequently. To enable:
notify_every_n_secs to 3600 seconds (i.e., 1 hour), andafter_every_n_notifications to 8,which will slow alarms down to one per hour after 8 notifications.
An alternate config for monitored resources that have long outages is as follows:
notify_every_n_secs to 43200 (i.e., 12 hours), andafter_every_n_notifications to 6,which will slow alarms down to one every 12 hours after 6 notifications, which means after a few days you will only get at most one alarm whilst asleep.
To see how the alarm pacing will accelerate then subsequently delay notifications, use the example calculations spreadsheet in 20151122 Reminder Timing with Quadratic Bezier Curve.xlsx to experiment with various configuration scenarios:

Note that alarm pacing can be set at a global level in the site: config, and is overridden when set at a per monitored resource level in the monitors: section of the config.
APMonitor supports monitoring multiple sites from a single service instance by passing multiple configuration files on the command line. Each config file is processed as an independent site with its own statefile, RRD database, and MRTG index page under /var/www/html/mrtg/<site-name>/.
This is useful for running multiple single panes of glass out of one monitoring box.
If you are running multiple single panes of glass out of one computer, consider buying a USB Air Mouse or three till you find one that works well for you, like this one:
When multiple config files are specified, APMonitor spawns one subprocess per config file and runs them concurrently, joining all subprocesses before exiting. Each subprocess:
/var/tmp/APMonitor/ (e.g. apmonitor-config.yaml → /var/tmp/APMonitor/apmonitor-config.statefile.json)/var/www/html/mrtg/<site-name>/ where <site-name> is derived from site.name in the configEdit /etc/systemd/system/apmonitor.service to list all config files on the ExecStart line:
[Unit]
Description=APMonitor Network Resource Monitor
After=network.target
[Service]
Type=simple
ExecStart=/bin/bash -c 'while true; do /usr/local/bin/APMonitor.py -t 20 -vv /usr/local/etc/apmonitor-config.yaml /usr/local/etc/site2-config.yaml /usr/local/etc/site3-config.yaml --generate-mrtg-config; sleep 5; done'
Restart=always
RestartSec=5
User=monitoring
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
It is useful to keep a commented-out single-site ExecStart line for quick debugging:
#ExecStart=/bin/bash -c 'while true; do /usr/local/bin/APMonitor.py -vv /usr/local/etc/apmonitor-config.yaml --generate-mrtg-config; sleep 5; done'
After editing the service file, reload systemd and restart the service:
sudo systemctl daemon-reload
sudo systemctl restart apmonitor.service
Note that make install will preserve a customized ExecStart line on subsequent installs — it only writes the default if no service file exists yet.
Each config file produces its own set of derived files. Statefiles are stored under /var/tmp/APMonitor/ (mode 755, no www-data access) and MRTG output is written into a per-site subdirectory of the MRTG working directory:
| Config file | Statefile | MRTG index |
|---|---|---|
apmonitor-config.yaml |
/var/tmp/APMonitor/apmonitor-config.statefile.json |
http://<host>:888/mrtg/HomeLab/ |
site2-config.yaml |
/var/tmp/APMonitor/site2-config.statefile.json |
http://<host>:888/mrtg/TellusionLab/ |
site3-config.yaml |
/var/tmp/APMonitor/site3-config.statefile.json |
http://<host>:888/mrtg/OfficeLab/ |
The MRTG subdirectory name comes from site.name in each config file (sanitised to a filesystem-safe string), not from the config filename. The statefile name is always derived from the config filename stem.
On Unix-like systems, APMonitor stores all statefiles under /var/tmp/APMonitor/:
755 (no group write — www-data is explicitly excluded)/tmp).json, .json.new, .json.old, .mrtg.cfg, .rrd/) live in this directoryThe -s/--statefile flag overrides this for single-config invocations. It is not valid when multiple config files are specified.
If upgrading from a version that stored statefiles in /var/tmp/ directly, run:
sudo make migrate
This performs a two-phase migration:
apmonitor-statefile.* → apmonitor-config.statefile.* in /var/tmp/ (legacy name fix)apmonitor-*.statefile.* files and .rrd directories from /var/tmp/ into /var/tmp/APMonitor/The service is stopped before migration and restarted afterwards. If a destination file already exists it is skipped with a warning rather than overwritten.
The -t flag sets the number of monitor-checking threads per site, not globally. With three sites and -t 20, up to 60 threads may be active concurrently across all subprocesses. Size -t based on the largest single site's monitor count rather than the total across all sites.
-s/--statefile is not valid when multiple config files are specified — each site always derives its own statefile automatically from the config filename.make install writes a default single-site ExecStart. Edit it manually after installation to add additional config files — subsequent make install runs will preserve your customized ExecStart.make test-config only tests the default config at $(CONFIG_DIR)/apmonitor-config.yaml. Test additional configs directly: APMonitor.py --test-config /usr/local/etc/site2-config.yaml.To enable SNMP monitoring on a Debian host so that APMonitor can poll it, install and configure snmpd with a read-only community string restricted to your APMonitor machine.
sudo apt install snmpd snmp
/etc/snmp/snmpd.confReplace the default config with the following minimal read-only configuration:
# Listen on all interfaces (lock to a specific IP if preferred)
agentAddress udp:161
# Read-only community, restricted to your APMonitor host only
# Replace 192.168.1.50 with the IP of your APMonitor machine
rocommunity YourCommunityString 192.168.1.50
# Optional: identify the device
sysLocation "Server Room Rack 3"
sysContact "admin@example.com"
sysName "my-debian-host"
sudo systemctl restart snmpd
sudo systemctl enable snmpd
If the host runs a firewall, allow UDP port 161 from your APMonitor machine only:
# ufw
sudo ufw allow from 192.168.1.50 to any port 161 proto udp
# iptables
sudo iptables -A INPUT -s 192.168.1.50 -p udp --dport 161 -j ACCEPT
snmpwalk -v 2c -c YourCommunityString 192.168.1.x
rocommunity is the read-only directive — the absence of any rwcommunity line is what keeps access strictly read-only.default or 0.0.0.0/0 unless there is no alternative.YourCommunityString to something non-obvious — public is the first string any scanner tries.Once snmpd is running, add a switch monitor pointing at the host:
- type: switch
name: my-debian-ports
address: "snmp://192.168.1.x"
community: "YourCommunityString"
check_every_n_secs: 300
For host performance monitoring (CPU, memory, disk I/O), use type: host instead:
- type: host
name: my-debian-host
address: "snmp://192.168.1.x"
community: "YourCommunityString"
check_every_n_secs: 300
Using APMonitor.py to address Availability & System Integrity can help with maintaining Physical Security. Here are some tips from the trenches on keeping server equipment secure. I like to call this "Physical Cyber Defence".
Inner Range has become a dominating force in access control and alarm systems in IDCs, offices and high-end homes around the western world in recent times. What installers don't tell you is that they are full of vendor backdoors. The best way to address this is to remove it's access to your monitoring station via 3G/4G via The Internets entirely and put it into your LAN so it goes through normal governance, risk and compliance as per all other devices.
NB: Know this: in addition to vendor backdoors, every remote monitored alarm is a reverse shell. That's just how it is.
Steps to securing your T4000 and Inner Range devices from Vendor Backdoors:
Block all communications with Inner Range directly fromm your IOT network:
You do not want your T4000, Inception or Integriti devices communicating with the default IPs associated with Inner Range which are published here. These servers act as a reverse shell and are the primary source of Vendor Backdoor access to your security computer.
This list is not always available so the last known list of SkyTunnel servers are:
A backup of the page is available via WayBack Machine
Remove the SIMs from your T4000 so all traffic routes through your availability monitored network:
A boxed T4000 unit:
A T4000 unit with it's SIMs removed:
This will stop it talking to home base with reverse shells and vendor backdoors.
Plugin the GigE adapter from your IOT network to the T4000 (grey cable in picture above).
NB: Removing the SIMs breaks the circuit that allows the device to communicate wirelesley.
NNB: This is a valid enterprise grade T4000 configuration.
All locks can be picked, and all high security registered key systems can have additional keys cut by the police or anyone persuasive enough (read: vendor backdoors & gun/$$$ respectively) to get a locksmith to make spare key. I've seen it happen to server rooms several times over the years.
To get around the problem, we combine normal physical locks with Chinese made electronic pin locks from eBay, but they all suffer the same issue of being circumventable using a credit card or knife, as this video demonstrates how easy it is:

To address the problem, we get a metal fab to manufacture a protective plate to cover the lock so it can't be so easily circumvented:
Here is the same video for a lock with a plate installed - can't open it now:

And here are the basic plans to get a metal fab to create a Protective Striker Cover Plate for you:
For maximum security, try to customize the lip that covers the front of the door to be as wide as possible without bumping into the actual lock (marked as 35.0 and 19.3 in the CAD diagram).
You want to prevent the possibility of someone getting anything under the plate itself by butressing the plate up against the lock as much as is practically possible. My first few attempts at this were unsuccsesful before working out this is the trick that really does make this solution work.
If I encounter a failure again, I'm going to do a round cutout in the plate for the doorknob itself. Do let me know how you go with this solution.
Sometimes we just want to know what a device or an IOT network is communicating with on The Internets. Here is how it's done. First you need to slurp up some packets using tcpdump + spans, then analyse it using tshark and sed/awk/grep, as follows.
Steps to monitor TCP/IP connectivity by a device:
Setup your IOT switch so that all traffic over the uplink port is spanned onto a secondary port (all managed switches do this - look at the manual on how to setup a span).
NB: APMonitor.py may take this input as a live feed in future, so get used to working with spans and taps.
Label your SPAN port correctly as "PROMISC" so you don't use it as a normal port then leave it setup, eg:


Plug a linux box into the span port and dump the traffic on the port using tcpdump into daily .pcap files:
apt install tcpdump wireshark tshark
tcpdump -i eno1 \
-nn -e -v -t --print --immediate-mode -l \
-G 86400 -Z ap -w %Y%m%d-%H%M%S-eno1.pcap -W 90 -C 10240
Run this script over the .pcap files:
ls *.pcap | \
xargs -I {} tshark -r {} -d tcp.port==40844,http -d tcp.port==40844,tls -Y '(eth.addr==00:11:b9:06:93:fe or eth.addr==00:11:b9:09:04:ff) and (ip or ipv6)' -T fields -e eth.src -e eth.dst -e ip.version -e ip.proto -e ip.src -e ip.dst -e tcp.srcport -e tcp.dstport -e udp.srcport -e udp.dstport -e http.host -e tls.handshake.extensions_server_name > /tmp/tshark_output.txt
awk -F'\t' '
# Pass 1: Build lookup table
NR==FNR {
ip = ($1 == "00:11:b9:06:93:fe" || $1 == "00:11:b9:09:04:ff") ? $6 : $5;
http_host = $11;
tls_sni = $12;
if ((http_host || tls_sni) && !app_hosts[ip]) {
app_hosts[ip] = http_host ? http_host : tls_sni;
print "added: " ip " = " app_hosts[ip] > "/dev/stderr";
}
next;
}
# Pass 2: Use lookup table
{
mac = ($1 == "00:11:b9:06:93:fe" || $1 == "00:11:b9:09:04:ff") ? $1 : $2;
ip = ($1 == "00:11:b9:06:93:fe" || $1 == "00:11:b9:09:04:ff") ? $6 : $5;
proto = ($4 == "6") ? "tcp" : ($4 == "17") ? "udp" : $4;
src_port = $7 ? $7 : $9;
dst_port = $8 ? $8 : $10;
remote_port = ($1 == "00:11:b9:06:93:fe" || $1 == "00:11:b9:09:04:ff") ? dst_port : src_port;
app_host = (app_hosts[ip] ? app_hosts[ip] : "-");
if (remote_port) print mac "\t" ip "\t" remote_port "/" proto "\t" app_host;
}
' /tmp/tshark_output.txt /tmp/tshark_output.txt | \
sort | uniq -c | \
awk '{print $1 "\t" $2 "\t" $3 "\t" $4 "\t" $5}' | \
while IFS=$'\t' read count mac ip port_proto app_host; do
hostname=$(host $ip 2>/dev/null | awk '{print $NF}' | sed 's/\.$//')
port=$(echo $port_proto | cut -d/ -f1)
proto=$(echo $port_proto | cut -d/ -f2)
service=$(getent services "$port/$proto" 2>/dev/null | awk '{print $1}')
echo "$count $mac $ip $port_proto ${service:-unknown} $app_host $hostname"
done && rm /tmp/tshark_output.txt
Which for a T4000 should generate output such as the following:
added: 142.251.2.109 = smtp.gmail.com
added: 74.125.137.108 = smtp.gmail.com
added: 74.125.137.109 = smtp.gmail.com
added: 142.251.2.108 = smtp.gmail.com
added: 142.250.101.108 = smtp.gmail.com
added: 142.250.141.108 = smtp.gmail.com
added: 142.250.141.109 = smtp.gmail.com
added: 142.250.101.109 = smtp.gmail.com
added: 212.227.81.55 = ipv4.connman.net
added: 172.67.221.214 = irmsg.vizdynamics.com
added: 104.21.67.116 = irmsg.vizdynamics.com
201 00:11:b9:06:93:fe 137.116.114.112 40844/tcp unknown - 3(NXDOMAIN)
16 00:11:b9:06:93:fe 192.168.68.1 67/udp bootps - 3(NXDOMAIN)
5382 00:11:b9:06:93:fe 23.101.229.107 40844/tcp unknown - 3(NXDOMAIN)
11 00:11:b9:06:93:fe 255.255.255.255 67/udp bootps - 3(NXDOMAIN)
2 00:11:b9:06:93:fe 9.9.9.9 53/udp domain - dns9.quad9.net
12 00:11:b9:09:04:ff 104.21.67.116 443/tcp https irmsg.vizdynamics.com 3(NXDOMAIN)
16 00:11:b9:09:04:ff 115.70.68.136 123/udp ntp - 115-70-68-136.ip4.exetel.com.au
12 00:11:b9:09:04:ff 119.18.6.37 123/udp ntp - smtp.juneks.com.au
31 00:11:b9:09:04:ff 129.250.35.251 123/udp ntp - y.ns.gin.ntt.net
3 00:11:b9:09:04:ff 129.250.35.251,192.168.68.204 40756/1,17 unknown - 3(NXDOMAIN)
18 00:11:b9:09:04:ff 13.55.50.68 123/udp ntp - ec2-13-55-50-68.ap-southeast-2.compute.amazonaws.com
46700 00:11:b9:09:04:ff 137.116.114.112 40844/tcp unknown - 3(NXDOMAIN)
34 00:11:b9:09:04:ff 139.180.160.82 123/udp ntp - syd.clearnet.pw
6 00:11:b9:09:04:ff 139.99.135.247 123/udp ntp - vps-b7eaeed7.vps.ovh.ca
76 00:11:b9:09:04:ff 142.250.101.108 587/tcp submission smtp.gmail.com dz-in-f108.1e100.net
230 00:11:b9:09:04:ff 142.250.101.109 587/tcp submission smtp.gmail.com dz-in-f109.1e100.net
2065 00:11:b9:09:04:ff 142.250.141.108 587/tcp submission smtp.gmail.com dd-in-f108.1e100.net
1500 00:11:b9:09:04:ff 142.250.141.109 587/tcp submission smtp.gmail.com dd-in-f109.1e100.net
380 00:11:b9:09:04:ff 142.251.2.108 587/tcp submission smtp.gmail.com dl-in-f108.1e100.net
1600 00:11:b9:09:04:ff 142.251.2.109 587/tcp submission smtp.gmail.com dl-in-f109.1e100.net
15719 00:11:b9:09:04:ff 149.112.112.112 53/udp domain - dns.quad9.net
54 00:11:b9:09:04:ff 150.107.75.115 123/udp ntp - time.pickworth.net
16 00:11:b9:09:04:ff 159.196.178.7 123/udp ntp - 3(NXDOMAIN)
37 00:11:b9:09:04:ff 159.196.3.239 123/udp ntp - 159-196-3-239.9fc403.mel.nbn.aussiebb.net
16 00:11:b9:09:04:ff 159.196.45.149 123/udp ntp - record
20 00:11:b9:09:04:ff 162.159.200.1 123/udp ntp - time.cloudflare.com
24 00:11:b9:09:04:ff 162.159.200.123 123/udp ntp - time.cloudflare.com
32 00:11:b9:09:04:ff 167.179.162.50 123/udp ntp - 167-179-162-50.a7b3a2.bne.nbn.aussiebb.net
16 00:11:b9:09:04:ff 172.105.179.71 123/udp ntp - 172-105-179-71.ip.linodeusercontent.com
100218 00:11:b9:09:04:ff 172.67.221.214 443/tcp https irmsg.vizdynamics.com 3(NXDOMAIN)
20826 00:11:b9:09:04:ff 172.67.221.214 80/tcp http irmsg.vizdynamics.com 3(NXDOMAIN)
6 00:11:b9:09:04:ff 180.150.8.191 123/udp ntp - bitburger.simonrumble.com
11 00:11:b9:09:04:ff 192.168.68.1 123/udp ntp - 3(NXDOMAIN)
1 00:11:b9:09:04:ff 192.168.68.1,192.168.68.203 34051/1,17 unknown - 3(NXDOMAIN)
1 00:11:b9:09:04:ff 192.168.68.1,192.168.68.203 35951/1,17 unknown - 3(NXDOMAIN)
1 00:11:b9:09:04:ff 192.168.68.1,192.168.68.203 36204/1,17 unknown - 3(NXDOMAIN)
1 00:11:b9:09:04:ff 192.168.68.1,192.168.68.203 38036/1,17 unknown - 3(NXDOMAIN)
1 00:11:b9:09:04:ff 192.168.68.1,192.168.68.203 40942/1,17 unknown - 3(NXDOMAIN)
1 00:11:b9:09:04:ff 192.168.68.1,192.168.68.203 44065/1,17 unknown - 3(NXDOMAIN)
1 00:11:b9:09:04:ff 192.168.68.1,192.168.68.203 48603/1,17 unknown - 3(NXDOMAIN)
1 00:11:b9:09:04:ff 192.168.68.1,192.168.68.203 55896/1,17 unknown - 3(NXDOMAIN)
1 00:11:b9:09:04:ff 192.168.68.1,192.168.68.204 42573/1,17 unknown - 3(NXDOMAIN)
1 00:11:b9:09:04:ff 192.168.68.1,192.168.68.204 52984/1,17 unknown - 3(NXDOMAIN)
1 00:11:b9:09:04:ff 192.168.68.1,192.168.68.204 57294/1,17 unknown - 3(NXDOMAIN)
31 00:11:b9:09:04:ff 192.168.68.1 67/udp bootps - 3(NXDOMAIN)
6 00:11:b9:09:04:ff 194.195.249.28 123/udp ntp - ap-southeast-2.clearnet.pw
50 00:11:b9:09:04:ff 203.12.5.225 123/udp ntp - my.blockbluemedia.com
24 00:11:b9:09:04:ff 203.14.0.250 123/udp ntp - tic.ntp.telstra.net
50 00:11:b9:09:04:ff 212.227.81.55 80/tcp http ipv4.connman.net ipv4.connman.net
48 00:11:b9:09:04:ff 220.158.215.20 123/udp ntp - 220-158-215-20.broadband.telesmart.co.nz
99 00:11:b9:09:04:ff 224.0.0.251 5353/udp mdns - mdns.mcast.net
6187 00:11:b9:09:04:ff 23.101.229.107 40844/tcp unknown - 3(NXDOMAIN)
1 00:11:b9:09:04:ff 239.255.255.250 1902/udp unknown - 3(NXDOMAIN)
38 00:11:b9:09:04:ff 255.255.255.255 67/udp bootps - 3(NXDOMAIN)
48 00:11:b9:09:04:ff 27.124.125.250 123/udp ntp - ntp1.ds.network
6 00:11:b9:09:04:ff 45.124.53.221 123/udp ntp - ns1.adelaidewebsites.com.au
8 00:11:b9:09:04:ff 67.219.100.202 123/udp ntp - mel.clearnet.pw
494 00:11:b9:09:04:ff 74.125.137.108 587/tcp submission smtp.gmail.com dy-in-f108.1e100.net
643 00:11:b9:09:04:ff 74.125.137.109 587/tcp submission smtp.gmail.com dy-in-f109.1e100.net
70 00:11:b9:09:04:ff 82.165.8.211 80/tcp http - 3(NXDOMAIN)
15739 00:11:b9:09:04:ff 9.9.9.9 53/udp domain - dns9.quad9.net
Inspect the list and go through each host/protocol and build a whitelist of what you want to allow.
We use these - the "Fluke Networks Pro3000(TM) Tone Generator and Probe Kit", aka a 'Krone Fluke' not to be confused with a Telco DC 'Butt Phone':
You will probably also want to pickup an inline GigE-to-GigE Female-to-Female inline Cat5/Cat6 coupler, for example the IN-CAT6A-COUPLER-S1 from StarTech. BlackBox should have something similar.
You do need a Network Engineer to train you how to use one of these, but basically:
BEEPING TONE: You are close
WHIRRING SOUND: That's 50/60hz AC or DC/microwave energy/electricity
CLICKING: That's data
Here is a demo of it in action - see if you can spot the CLICKING from the WHIRRING. Make a map of your environment early, like an Electricial Engineer would do wiring architecture diagrams submittable to council for building approval, then compare your environment to the architecture diagrams often (but not frequently).
NB. USB-C/Firewire does not belong in data centers, because it hasn't been treated for Tempest, and HDMI does not belong in Tier-1 data centers, because of HDMI-ARC/CEC.
There are only two PIR sensors on the market that have anywhere near the level of controls and quality that could be used in a computer science based environment when we have things like Physical Security requirements that need to be compliant with the needs of Regulated Industry and Tier-1 environents that have significant problems being constantly targeted by State Actors.
You have two options:
Keeping these on the market are a constant source of problems. You may have to order 100 or 1000 units to get the ones you want and know they are authentic. Talk directly to the manufacturer if you have problems.
All the other sensors aren't suitably equipped with tamper detection/resistance, and are easily crept past by any Security Alarm Installer worth more than 2c. It's quite extrordinary getting a demo from a Security Installer that can dance and shuffle through an array of normal PIR sensors and not let one off - they do it on site quite regularly when setting up systems as it's easier than pressing buttons on a control pad that might be several rooms away.
When getting sensors installed for computer science / electrical engineering based environments:
Understand that all security equipment that is electronic falls under IEEE, in which we are significantly more senior at a global level than any technician or state based police laws prohibiting our access to their end user documentation or installation thereof. We build the fabs and train the engineers that design and manufacture their equipment.
Always take posession of the instruction manuals for all the equipment from the installers that come with the equipment.
Always leave the PIR lights ON. That way we can constantly check they are working ourselves when we are passing through the environments that we are responsible for or manage.
Learn to do regular Walk Tests using both visual inspection of the PIR lights, and with a laptop in hand. This is not always easy, as we like to keep Security Computer off all networks if possible. Just use the lights most times. If police or governments get the chance, they will de-tune a sensor we've setup - always. I've seen it before, lots.
Our industry associations are IEEE and ACM: make sure your local state police and the security installer's industry association is registered a member of both as an "individual organisation". As a collective unit they represent collectively no more than a single member, so we have somewhere to complain to when things are being made difficult or shenanigans are afoot with backdoors and system tampering/interference.
Come to terms with this: our networks, computers, their code and our surveillance are a target by these state actors to put in backdoors anywhere and all over the world. Make sure they are always suitably supervised when installers or police are onsite around any of our computers, data centers or networking equipment.
We are global and permanent in scale - they are hyperlocal and usually temporary. The systems we build may last many decades; they will probably be out of a job next week or when the next election happens. Do not put too much trust or faith that local government or police will do the right thing or maintain a consistent performance level that is in accordance with our Industry Association rules and code of conduct.
CS: ACM's are available here.
EE: IEEE are a bit bigger, but start here if you want the detail.
These people are not considered a "User" of our systems, so do not let them interact directly with them or you may invalidate their engineering.
Be wary of security advice given to us by governments and police - assume some possibility they are usually corrupt criminals working with intelligence agencies.
The bigger and more global your relevance, the more of a problem the abovementioned is relevant and important to you.
Know that "On the floor is always on the floor, you dickhead [sic]" is actually a thing in IDCs, and we expect to see 3 layers of physical security to get on the floor. (PS: And "a cage is ALWAYS just a flex" + "Telephony next to compute is not a valid configuration in any known universe" + if you see an unmanned data center, is that a problem for them or a problem statement they are saying to you?).
Also note: To get these setup properly, you might find a situation where CS & EE people are going to need to talk to each other. CS people (that do Discrete Mathematics and deal in systems where EVERYTHING is 'abstract') and a real EE (whom do Real Mathematics and deal in systems where EVERYTHING is actually real physics and hard sciences) are not supposed to talk too much as our mathematical tutelage is a little incompatible in places. Just stay on topic and try to combine forces without talking to each other too much about "why", just "what & how".
Those are the people that are supposed to be quite measured about what they can and can't say to each other about their respective fields, NOT governments/police vs. us.
Read the installers manual from start to finish. Have a CS EE around that has done some basic AI/ML tuition such that they may have some sense of adversarial optimisation, sensor fusion, distance metrics and/or false positives & negatives at least at a theoretical level.
This sensor uses Electronic Engineering to fuse two input data sources (infared + microwave) to get a more accurate and less sneakable/sneak-past environment. Do some robotics at Stanford to really understand why, or think of it like this: two is always better than one. The vendor calls this "seetrue". Do not overlap beams with these sensors or you may get false negatives caused by destructive cancellation/interference or false positives cause by constructive cancellation/interference.
These are the DIP switch settings to use (I think - I haven't checked lately YMMY). This enables proper sensor fusion and tamper detection. Read the manual and understand why:
1: ON (LED = ON)
2: OFF (EDGE DETECT=DUAL SENSOR)
3: OFF (PET MODE=OFF/NO PETS + SEETRUE=ON)
4: ON (SEETRUE=SOFT? YMMV)
Your installer is not going to be able to install this out of the box as the wiring is nonstandard for them, strict for us and requires an EE to interpret the manuals. If they have problems, hand them this picture:
(NB: I think this is the correct photo - it has been a while. Please confirm if you set one of these up)
Once they have a basic install done and you can walk past and see the PIR light go on, take control of the sensor and tell the Installer to leave, then carefully adjust the DIP switches and sensor fusion rotary trimpots to get both microwave + infrared working (tip: with the controls you have, try to configure the range on each separately, then turn on fusion - this is not immediately possible at first glance after reading the manual, but it is if you think about it). You may need to get the installer to show you the basics of "how do I tune the infrared distance using the trimpot and the sensor light?" first before solving the rest of the problem.
Also try to document your settings because these things do get changed on these sensors - governments/police hate them. I do wish there was a one-way tab we could break off once we knew we had the sensor setup correctly so the controls then couldn't be changed - tamper tape/tamper seals are useful in this regard, and have backup stock locked away should you wish to install a new one because something has been tampered with.
In terms of distances and tolerances - leave at least one footwidth length between the end of the sensor beam and the wall, or you may get false positives from water moving through pipes or people in the next room, and expect to take a few attempts before you get the sensitivity right.
NB: There are also some plastic twiddly bits on the internal lens cover plate to tweak the freznal lens. You might/will need to tweak them to the room dynamics. DO NOT LEAVE FINGERPRINTS ON OR TOUCH THE SENSORS. Someone that can handle chips without breaking off one solder ball or bending one pin is able to do this without touching the sensors.
These are a zero-config sensor, there is nothing else to do other than to get them into the correct spot and not have other SKU/class of sensors overlapping the beam width area by some margin (these DG467s we do overlap as an array, however). Their special power comes from setting up an array of these so that their 360' PIR beams overlap (by some margin) so they can't be sneak past.
Read the manual, find the beam radius and make sure the beam areas DO overlap, but don't mix with other SKU/classes of sensors or things get confusing re: false positives. Some margin means 0.25-0.5M in my world, s.t. you should be able to stand in a spot that lights up multiple sensors - they are quite sensitive.
This is what the box looks like:
And this is one installed in a ceiling with the sensor light on:
E.G: For a ceiling height of 2680mm, a sensor distance of 4400mm in a grid pattern is sensible and will mean multiple sensors will glow red when standing in one position, making sneak-past quite difficult.
In some environments there may be some utility in providing an extra mild steel metal plate above these to prevent tampering coming from the roof cavity above. Get something made up by your local metal fab if this is a concern for you.
If you want to check the revision is correct, ask a full university qualified EE (not a half-baked CS EE such as myself) that can handle themselves in an Intel-spec chip-fab (they do exist - globally) to contact the manufacturer and ask for "Timing Diagrams, Wiring Diagrams, Chip Wafer Die Picture Diagrams and OEM Manuals preferably on A0 in Intel Colour". They won't send them to you. You need to be a proper EE to get these things.
NB: I'm not sure "A0 with Intel Colour" even exists anymore, but it was a thing once upon a time. Also note that CS is not allowed to look at printed output that is from a plotter in colour (EE loves it). Ask for monochrome only if you see multi-colour plotter output. It hurts my head anyways. Also EE students aren't allowed to see Intel Colour until they are in Industry or it stuffs up their education. If in doubt, talk to your local EE professor, but please make a donation to their endowment first before wasting their time: it resolves industry/academia/government quid-pro-quo problems, and they really do need the money usually. We do like good EE tutelage, and in the fullness of time, we now know interacting with CS is always dramatic for EE.
The spread of #Ericsson #AXE #SS7 telephony switches in #TelephonyDataCenters (not to be confused with #InternetDataCenters or #IDCs) has caused us a little problem: The security of #SS7 switching is so bad that anyone from any nation state can use VOIP to access the signalling channel to throw code at any #SS7 switch from anywhere in the world to surveil your calls.
If you data is encapsulated in #SS7 #Data and there is compute nearby, then your data can be wiretapped and edited as well. (NB: We do say "compute does not belong next to telephony in any known universe", and "telephony does not belong in IDCs". This is a problem with the recent proliferation of VOIP providers in Internet Data Centers)
#NSA & #CIA have since layered on top of this #CyberTorture #FusionCenters, and if you are an #EE, #CS or involved in #IDC ops, you will already be on a target list and the #FusionCenters will most likely be tapping your calls.
As a minimum risk treatment for #SS7 #Voice #Wiretapping, #SiliconValley has made availabile Signal Messenger - the no riff raff encrypted calls & messaging app - so we can try to communicate securely.
Do not communicate with #ComputerScience over insecure channels.
A joint note was signed by 5-Eyes (excluding the UK) on 4-Dec-2024, recommending the use of Signal Messenger (https://signal.org/). The important bits are as follows:
For more information refer to my post on X.
Consider this:
I really do worry sometimes how Regulated Industry expects us to maintain the controls and integrity they need so they can maintain their systems. Where have all the 64-bit computers gone to? The ones we should be using? That were made this millenium, for this millenium by people like those from Xerox PARC from last millenium that really did know what they were doing, more so than today.
Get over it, that's reality. So Police, Office365, Azure, Windows 11 & Google Workspace (unless you can get on staff) is out, otherwise forget about security anything. Welcome to the 2020s.
NB: Through a weird twist of fate, Xerox PARC & The Commonwealth actually owns the #SaltLakeCity land #NSA, #Adobe and #Mormons are on - don't ask, DYODD. FR.
Anyways - don't get too bogged down in this: At least you now know the risk profile and have a few good risk treatments. We can only use what we have available to us. But I do worry for the future.
We (CS & EE) are classified as #civilian / #commerce, however secrectly, we actually have a classification label so secret no government is allowed to know about it: #Proprietary. Commerce can't function without #Proprietary.
If you are in heavy duty #SiliconValley innovation or hardcore #ComputerScience like I am, then we carry an even more secret label: #FutureProprietary.
Signals Intelligence/#SIGINT is actually #Military #Defence, but only in peacetime - not when #Military goes full #WAR. We work with/as Defence Industrial Contractors all the time. They are cool.
#Intelligence is not allowed anywhere near #Military, #Defence, #Commerce or #Civillians. They are freeking bat-shit-crazy lunatics. If you ever need to communicate with intelligence, there are #DMZs you can communicate in but best to hand it to someone oboarded to 5-eyes like myself to handle.
If you really have to speak to #Intelligence, there is always a "front door" in every country that is supposed to have sane peopple manning the phones/letterbox. Write your note on a piece of paper drop it in the box then RUN. RUN FOR YOUR LIVES! FR. This is a problem because "some things you do not write down" (actually lots of things in #ComputerScience). They understand that concept, just say those words. Or hand it to a #CS/#EE that has been onboarded to 5-eyes and they will fly to a DMZ (every 5-eyes approved site has a #DMZ nearby where we can talk as #Professional #Civillians - or is supposed to. I do miss the old days).
And again: #Intelligence is not allowed near #Commerce, #Civillian, #Industry, #Academia and definitely not #proprietary.
#Government is definitely not allowed to mess with #proprietary either, which dates back at least 1000 years via the #BritishEmpire/#RomanEmpire/#ChineseEmpire because: #SilkRoad, #Commerce, #Logistics & #TradeWinds was an amazing thing 1,000 years ago.
#Intelligence (such as CIA) is not allowed near #ComputerScience or #SiliconValley (so what is #McKinsey & #InQTel? - it's a hole in the network)
What is 5 eyes? It's a system of treaties designed to prevent #Intelligence from putting holes in our network.
My personal label is: #InternetCommerce. I represent the future and current #proprietary of #InternetCommerce, and I'm definitely listed in global databases as #ComputerScience and #SiliconValley, so I'm a DEFINITELY DO NOT COME NEAR ME.
#Police these days we classify as #Intelligence, because they've been speaking to and use too much technology from #CIA & #NSA.
Once upon a time #NSA (when they were No Such Agency) were respected and we could talk to them, but these days, they are just #CIA #Intelligence.
If a nation state wants computers, it must have #ComputerScience. To have Computer Science, they must have #Modernity, which is only possible if they have #RulesBasedOrder. We are very committed to #RulesBasedOrder - it's a necessary requirement before learning properly good #ComputerScience.
The particular rule from #RulesBasedOrder that #CompSci requires to exist is at an absolute minimum: "Respecting the #Privacy of #Proprietary"
The second rule from #RulesBasedOrder that #Government must adhere to is: "#Intelligence is not allowed to move one single chess piece, ever"
And #CIA is premised on this #RulesBasedOrder rule: "#CIA cannot exist without #Compartmentalisation". #Compartmentalisation died ages ago due to globalization, and #CIA have been off the chain ever since.
NB: In USA, there is the no-write-down rule associated with the Bell-LaPadula model. This may be relevant to you - I ignore it because #proprietary is so much more secret than any label any government anything has, their top top top top secret ends well before our "Public Corpus of Knowledge" begins.
The only solution I see to this moving forward is: #ComputerScienceWithGuns. I have seen it before during peak #ServerMasters era, it's not really my style, but it does work. Soon #CS schools will include #BasicWeaponsTraining from #Military or #SIGINT, or have it as a prerequisite.
Violate this framework and you will all be unwinding #Modernity and #Civilization and going back to #HunterGatherers where 100% of your time is about food, for everyone on the planet.
HTH.
I've also made a rather nifty tool to keep track of your Microsoft "cl0wd" files, before they get nuked out of existence and then your whole digital life and boom your company is gone:
Announcing "Cloud Forensics"....
Run this regularly to keep track of lost/missing/damaged files on #OneDrive, #O365 + E3/E5 #SharePoint. Use this to keep track of your files. It's diff-able. Enterprise & Personal. All of $MSFT #MSFT #Microsoft #MicrosoftCorporation cl0wd. #CloudForensics.
See: https://github.com/Enertium/MSFT-Cloud-Forensics
Good Luck!
For more hot tips on privacy & security, take a look at the BeerIsGood Security-link-collection.
Q.E.D
APMonitor integrates with MRTG (Multi Router Traffic Grapher) and RRDtool to provide historical performance graphs of resource availability and response times. This integration enables trend analysis, capacity planning, and visual monitoring dashboards.
Install MRTG and related dependencies:
sudo make installmrtg
This installs nginx on port 888, fcgiwrap for CGI support, and sets up the MRTG web interface.
Enable RRD data collection by running APMonitor with --generate-mrtg-config:
./APMonitor.py -vv -s /var/tmp/apmonitor-statefile.json config.yaml --generate-mrtg-config
Access graphs at http://localhost:888/mrtg/<site-name>/ or http://<your-ip>:888/mrtg/<site-name>/.
When --generate-mrtg-config is specified:
.mrtg.cfg file derived from the statefile path/var/www/html/mrtg/<site-name>/ where <site-name> is sanitised from site.name in the configmrtg-rrd.cgi.pl with the new config path and generates index.htmlOutput file locations:
/var/tmp/APMonitor/<config-stem>.statefile.json/var/tmp/APMonitor/<config-stem>.statefile.mrtg.cfg/var/tmp/APMonitor/<config-stem>.statefile.rrd/<monitor>-availability.rrd/var/tmp/APMonitor/<config-stem>.statefile.rrd/<monitor>-snmp.rrd/var/www/html/mrtg/<site-name>/index.html/var/www/html/mrtg/<site-name>/<type>-<monitor>-detail.htmlhttp://localhost:888/mrtg/<site-name>/Generate MRTG config with default base working directory (/var/www/html/mrtg):
./APMonitor.py apmonitor-config.yaml --generate-mrtg-config
Specify a custom base working directory (site subdirectory is always appended):
./APMonitor.py apmonitor-config.yaml --generate-mrtg-config /var/www/html/graphs
Each availability monitor's RRD file tracks two metrics:
response_time (GAUGE, milliseconds): Time taken for check to complete
U (unknown) when check failsis_up (GAUGE, boolean): Service availability
100 = service up0 = service downAll SNMP-family monitors (port, switch, router, host) use a single unified RRD schema per device. The schema is divided into three sections: per-interface DS pairs (used by switch/router/port only), fixed aggregate network DS (used by switch/router/port; stored as U for host), and fixed host performance DS (used by host; stored as U for switch/router/port).
Filename: /var/tmp/APMonitor/<config-stem>.statefile.rrd/<monitor-name>-snmp.rrd
Per-Interface Data Sources (one pair per discovered interface, COUNTER — switch/router/port only):
if{index}_in: Inbound bytes for interface at ifIndex {index} (IF-MIB::ifInOctets)if{index}_out: Outbound bytes for interface at ifIndex {index} (IF-MIB::ifOutOctets)DS names use the raw ifIndex integer (e.g., if1_in, if2_out), not the interface description string. DS order is stable — interfaces are sorted numerically by ifIndex at both create and update time.
Fixed Aggregate Network Data Sources (COUNTER — switch/router/port populated, host stores U):
tcp_retrans: Global TCP retransmit segment counter (TCP-MIB::tcpRetransSegs) — switch/router onlytotal_bits_in: Sum of inbound octets × 8 across all interfacestotal_bits_out: Sum of outbound octets × 8 across all interfacestotal_pkts_in: Sum of all inbound packets (unicast + multicast + broadcast) across all interfacestotal_pkts_out: Sum of all outbound packets across all interfacestotal_errors_in: Sum of inbound interface errors across all interfaces (IF-MIB::ifInErrors)total_errors_out: Sum of outbound interface errors across all interfaces (IF-MIB::ifOutErrors)total_pkts_ucast: Total unicast packets in+out combined across all interfacestotal_pkts_bmcast: Total broadcast+multicast packets in+out combined across all interfacesSystem Resource Data Sources (GAUGE — all types):
cpu_load: CPU utilization percentage, range 0–100. Sourced from vendor-specific OIDs (Cisco/HP/Juniper/Ubiquiti) with HOST-RESOURCES-MIB::hrProcessorLoad as fallback. Stored as U if unavailable.memory_pct: Memory utilization percentage, range 0–100. Sourced from vendor-specific OIDs with HOST-RESOURCES-MIB::hrStorage as fallback. Stored as U if unavailable.Fixed Host Performance Data Sources (COUNTER/GAUGE — host populated, switch/router/port store U):
context_switches (COUNTER): Raw context switch counter (UCD-SNMP-MIB::ssRawContexts)swap_io (COUNTER): Raw swap pages in + out combined (UCD-SNMP-MIB::ssRawSwapIn + ssRawSwapOut)disk_read (COUNTER): Disk read bytes summed across all block devices (UCD-DISKIO-MIB::diskIOReadX)disk_write (COUNTER): Disk write bytes summed across all block devices (UCD-DISKIO-MIB::diskIOWriteX)disk_space_pct (GAUGE): Root filesystem utilization percentage 0–100 (HOST-RESOURCES-MIB::hrStorage / entry). Also persisted to statefile for display in MRTG index and detail page headers.swap_used (GAUGE): Swap space used in bytes (HOST-RESOURCES-MIB::hrStorage virtual memory entry, with UCD-SNMP-MIB::memTotalSwap − memAvailSwap as fallback)interrupts (COUNTER): Raw hardware interrupt counter (UCD-SNMP-MIB::ssRawInterrupts)Fixed Tamper/Network Capacity Data Sources (GAUGE — switch/router only, port/host store U):
ports_up_count: Count of interfaces with oper=upnvram_flash_bytes: Sum of used bytes across NVRAM/flash hrStorage entriesmac_count: Count of learned FDB entries via Q-BRIDGE-MIBarp_count: Count of ARP entries via ipNetToPhysicalTable / ipNetToMediaTableTotal fixed DS count: 22 (11 network/system + 7 host performance + 4 tamper/network). Expected DS count for auto-heal check = (2 × interface_count) + 22.
MRTG Targets generated per monitor type:
| Target suffix | DS pair | Monitor types | Description |
|---|---|---|---|
-bandwidth |
total_bits_in / total_bits_out |
switch, port |
Total bandwidth in/out (bits) |
-packets |
total_pkts_in / total_pkts_out |
switch, port |
Total packets in/out |
-packets-type |
total_pkts_ucast / total_pkts_bmcast |
switch, port |
Unicast vs broadcast+multicast |
-errors |
total_errors_in / total_errors_out |
switch, port |
Interface errors in/out |
-retransmits |
tcp_retrans / tcp_retrans |
switch only |
TCP retransmits (single line) |
-system |
cpu_load / memory_pct |
switch only |
CPU & memory utilization |
-tamper |
ports_up_count / nvram_flash_bytes |
switch only |
Active ports & NVRAM/flash bytes |
-network |
mac_count / arp_count |
switch only |
Learned MACs & ARP entries |
-bandwidth |
per-interface if{N}_in / if{N}_out |
router |
Stacked bandwidth per port |
-packets |
per-interface if{N}_in / if{N}_out |
router |
Stacked total packets per port |
-packets-bmcast |
per-interface if{N}_bmcast |
router |
Stacked broadcast+multicast packets per port |
-errors |
per-interface if{N}_errors |
router |
Stacked errors per port |
-pkt-size |
pkts_64 … pkts_jumbo |
router |
Packet size distribution (RMON) |
-err-type |
total_errors_in/out, rmon_* |
router |
Error type distribution (RMON + IF-MIB) |
-ip-family |
ip4_bits_* / ip6_bits_* |
router |
IPv4 vs IPv6 bits/s, in above axis, out below |
-proto |
proto_* |
router |
TCP/UDP/ICMP/other pps, in above axis, out below |
-system1 |
cpu_load / context_switches |
host |
CPU & Load |
-system2 |
memory_pct / swap_io |
host |
Memory & Paging |
-system3 |
disk_read / disk_write |
host |
Disk I/O (Disk Use % in PageTop) |
-system4 |
swap_used / interrupts |
host |
System Thrashing |
Notes:
disk_space_pct is stored in the RRD as a GAUGE DS and also persisted to the statefile so that generate_mrtg_config() and generate_mrtg_index() can embed the live value (e.g., Disk Use: 73.4%) in MRTG PageTop headers and index cell headings without a live SNMP poll at generation time. Displays as Disk Use: N/A until the first successful poll.net-snmp specific. On network devices (Cisco, HP, Juniper, Ubiquiti), these DS will store U.| Time Range | Resolution | MRTG Standard Rows | APMonitor Default |
|---|---|---|---|
| High-resolution recent | Native step | 1 day native | 31 days native |
| Short-term | 5-minute | 600 (~2 days) | 18600 (~64 days) |
| Medium-term | 30-minute | 600 (~12.5 days) | 18600 (~387 days) |
| Long-term | 1-hour | — | 43830 (~5 years) |
| Historical | 1-day | 732 (~2 years) | 22692 (~62 years) |
[!WARNING] Be careful if upgrading to the 1.3.x stream (and again for the 1.4.x stream). These releases contains RRD schema changes that require existing RRD files to be deleted and recreated before upgrading. APMonitor will auto-heal existing RRDs on first run when
--generate-rrdsor--generate-mrtg-configis specified.
To use custom retention, modify the row constants in create_rrd_rras():
rows_1day_native = 86400 // step_secs * 31 # 31 days at native resolution
rows_2days_5min = 18600 # ~64 days at 5-min
rows_12days_30min = 18600 # ~387 days at 30-min
rows_5years_1hour = 43830 # ~5 years at 1-hour
rows_2years_daily = 22692 # ~62 years at 1-day
# Query availability RRD database info
rrdtool info /var/tmp/APMonitor/apmonitor-config.statefile.rrd/monitor-name-availability.rrd
# Query SNMP RRD database info
rrdtool info /var/tmp/APMonitor/apmonitor-config.statefile.rrd/switch-snmp.rrd
# Run APMonitor with MRTG & RRD enabled
./APMonitor.py -vv apmonitor-config.yaml --generate-mrtg-config
# Check when the RRD was created
ls -la /var/tmp/APMonitor/apmonitor-config.statefile.rrd/tellusion-gw-availability.rrd
# Dump RRD info to see its structure
rrdtool info /var/tmp/APMonitor/apmonitor-config.statefile.rrd/tellusion-gw-availability.rrd | head -50
# Check the last update timestamp
rrdtool lastupdate /var/tmp/APMonitor/apmonitor-config.statefile.rrd/tellusion-gw-availability.rrd
# Fetch the last 300 seconds
rrdtool fetch /var/tmp/APMonitor/apmonitor-config.statefile.rrd/tellusion-gw-availability.rrd AVERAGE -s end-300 -e now
# Fetch SNMP interface data
rrdtool fetch /var/tmp/APMonitor/apmonitor-config.statefile.rrd/switch-snmp.rrd AVERAGE -s end-3600 -e now
References:
type: hostNote: RRD data collection is disabled by default. Run with --generate-mrtg-config once to enable, then continue normal monitoring to collect historical data.
APMonitor.py YAML/JSON Site Configuration OptionsAPMonitor uses a YAML or JSON configuration file to define the site being monitored and the resources to check. The configuration consists of two main sections: site-level settings that apply globally, and per-monitor settings that define individual resources to check.
Here's a complete example showing all available configuration options:
site:
name: "HomeLab"
email_server:
smtp_host: "smtp.gmail.com"
smtp_port: 587
smtp_username: "alerts@example.com"
smtp_password: "app_password_here"
from_address: "
CompSciFutures/APMonitor is a public repo on GitHub by CompSciFutures. On-prem/LAN Layer 2 & 4 availability monitoring with realtime guarantees & decaying alert pacing. Multithreaded high speed availability checking for SNMP, PING, TCP/UDP, QUIC & HTTP/S resources incl. SSL/TLS cert. pinning & port MAC address pinning. Integrates w/Site24x7 heartbeat monitoring for failover alerts + MRTG + Slack & Pushover webhooks.
It declares no license on GitHub. Public does not mean open source: without a license, nobody is granted the right to reuse it.
Its maker tagged it for Windows and Linux. That is declared by the maker; Take My Repo has not tested it.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
A curated list of Site Reliability and Production Engineering resources.
Its last change on GitHub was on 2026-11-18. GitHub counts 10 open issues and pull requests. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.

Complete API layer for private AI applications on local models: RAG, skills, tools, MCP, text-to-sql, and more. Works with any OpenAI-compatible inference server.
π RuView turns commodity WiFi signals into real-time spatial intelligence, vital sign monitoring, and presence detection — all without a single pixel of video.
C++ implementation of Raft core logic as a replication library

An azd template using Bicep that implements three different ways to track availability in Application Insights: a standard test (webtest), an Azure Function and a Logic App workflow.
Tools for building and running MDX & XMLA queries FLOWERS ARE IN. #Flowersets. #Powersets. 𝒫𝒫𝒫𝒫𝒫
JSON/XML logfile deserializer - converts unstructured CSV data to tabular. FLOWERS ARE IN. #Flowersets. #Powersets. 𝒫𝒫𝒫𝒫𝒫
This page is also available as structured data, with the same sources and dates.
/api/v1/resources/gh/CompSciFutures/APMonitorTake My Repo has not tested this on your machine. Requirements come from the project's own documentation.
