src/go/tools/topology-ip-intel-downloader/README.md
topology-ip-intel-downloader builds the Netdata IP intelligence databases used by
topology and netflow enrichment.
It always writes a fixed Netdata output set:
topology-ip-asn.mmdbtopology-ip-geo.mmdbtopology-ip-intel.jsonThe GEO MMDB is not country-only. It can contain:
country.iso_codecity.names.enregionsubdivisionslocation.latitudelocation.longitudeBoth MMDB outputs also include Netdata classification metadata under netdata.*
for CIDRs that must be tracked individually.
Netdata packages ship a stock payload under:
${NETDATA_STOCK_DATA_DIR}/topology-ip-intel/topology-ip-asn.mmdb${NETDATA_STOCK_DATA_DIR}/topology-ip-intel/topology-ip-geo.mmdb${NETDATA_STOCK_DATA_DIR}/topology-ip-intel/topology-ip-intel.jsonRefreshed databases generated by this downloader are written to:
${NETDATA_CACHE_DIR}/topology-ip-intelThe netflow plugin auto-detects the cache copy first and then falls back to the stock copy. This means:
Important:
If --config is not provided, the downloader loads the first existing file from:
/etc/netdata/topology-ip-intel.yaml/usr/lib/netdata/conf.d/topology-ip-intel.yamlThese paths are resolved from the compiled Netdata install layout, so prefixed installs use their own prefix automatically.
The CLI is optimized for the common case:
--asn provider:artifact[@format]--geo provider:artifact[@format]--no-asn--no-geoRules:
--asn affects only ASN sources--geo affects only GEO sources--no-asn or --no-geo removes that output file if it existsExamples:
Use the built-in defaults:
topology-ip-intel-downloader
Refresh both families explicitly from DB-IP:
topology-ip-intel-downloader \
--asn dbip:asn-lite \
--geo dbip:city-lite
Use public ASN and country providers:
topology-ip-intel-downloader \
--asn iptoasn:combined \
--geo ip2location:country-lite
Use MaxMind GeoLite2 sources when MAXMIND_LICENSE_KEY is available in the
environment:
MAXMIND_LICENSE_KEY="..." topology-ip-intel-downloader \
--asn maxmind:geolite2-asn \
--geo maxmind:geolite2-country
Use CAIDA RouteViews prefix2as for ASN-only attribution:
topology-ip-intel-downloader \
--asn caida:prefix2as \
--geo dbip:country-lite
Prefer a custom GEO source, then fall back to DB-IP:
topology-ip-intel-downloader \
--geo iptoasn:combined \
--geo dbip:city-lite
Disable GEO output entirely for one run:
topology-ip-intel-downloader --no-geo
The downloader prints the effective execution plan before downloading, including:
The config file uses ordered sources[] entries. Each entry is explicit about:
family: asn or geoproviderartifactformaturl or pathBuilt-in DB-IP sources can omit url and path. The downloader resolves the
current monthly download URL from the official DB-IP landing page.
Built-in MaxMind sources require MAXMIND_LICENSE_KEY in the environment.
The generated metadata redacts URL query strings so license keys are not written
to topology-ip-intel.json.
User-provided databases can point directly to:
pathurlExample:
sources:
- name: custom-asn
family: asn
provider: dbip
artifact: asn-lite
path: /srv/ip-intel/custom-asn.mmdb
- name: fallback-asn
family: asn
provider: dbip
artifact: asn-lite
format: mmdb
- name: custom-geo
family: geo
provider: dbip
artifact: city-lite
url: https://example.internal/geo.mmdb.gz
format: mmdb
output:
directory: /var/cache/netdata/topology-ip-intel
asn_file: topology-ip-asn.mmdb
geo_file: topology-ip-geo.mmdb
metadata_file: topology-ip-intel.json
Important:
ASN sources:
dbip:asn-lite (mmdb, csv)iptoasn:combined (tsv)caida:prefix2as (tsv)maxmind:geolite2-asn (mmdb, requires MAXMIND_LICENSE_KEY)GEO sources:
dbip:country-lite (mmdb, csv)dbip:city-lite (mmdb, csv)iptoasn:combined (tsv, country only)maxmind:geolite2-country (csv, requires MAXMIND_LICENSE_KEY, country only)ip2location:country-lite (csv, country only)ipdeny:country-zones (cidr, country only)ipip:country (txt, country only)Supported formats:
mmdbcsvtsv for iptoasn:combined and caida:prefix2ascidr for ipdeny:country-zonestxt for ipip:countryThe downloader accepts direct file/URL config for advanced cases, but the CLI source tokens are intentionally focused on built-in source families.
Every successful run stages all files privately and then publishes each final
output atomically with rename().
This gives two guarantees:
If a family is disabled:
From the repository root:
./src/go/tools/topology-ip-intel-downloader/refresh-stock.sh
This generates a local staging directory at:
./artifacts/topology-ip-intel-stock/README.md./artifacts/topology-ip-intel-stock/topology-ip-asn.mmdb./artifacts/topology-ip-intel-stock/topology-ip-geo.mmdb./artifacts/topology-ip-intel-stock/topology-ip-intel.jsonThis is useful for: