ntopng Integration
nEdge Lite is designed to work seamlessly with ntopng, providing centralized monitoring, visualization, and policy management. This section explains how to set up and optimize the integration.
Overview
The nEdge Lite-ntopng integration provides:
- Real-Time Flow Monitoring: View all flows inspected by nEdge Lite in ntopng's web interface
- Protocol Analytics: See detailed statistics on detected protocols and applications
- Dynamic Policy Management: Configure and update policies through ntopng's GUI
- Historical Data: Store and query flow data over time
- Alerting: Set up alerts for policy violations or suspicious traffic
- Multi-Instance Support: Multiple nEdge Lite instances can report to a single ntopng
Integration Architecture
Communication Channels
nEdge Lite and ntopng communicate via two ZeroMQ channels:
- Flow Export Channel: nEdge Lite sends flow data to ntopng (ZMQ PUB/SUB)
- Policy Update Channel: ntopng sends policy updates to nEdge Lite (ZMQ PUB/SUB)
┌─────────┐ ┌─────────┐
│ nEdge Lite │──── Flows ────────>│ ntopng │
│ │<─── Policies ──────│ │
└─────────┘ └─────────┘ZeroMQ Endpoints
- ntopng as Collector: Endpoint URL must end with
c(e.g.,tcp://127.0.0.1:1234c) - nEdge Lite as Publisher: Endpoint URL without
c(e.g.,tcp://127.0.0.1:1234)
Basic Setup
Same-Host Deployment
When nEdge Lite and ntopng run on the same machine:
Start ntopng:
sudo ntopng -i tcp://127.0.0.1:1234cStart nEdge Lite:
sudo nedgelite -q 0 -z tcp://127.0.0.1:1234Access ntopng Web Interface:
Open http://localhost:3000 in your browser. You should see flows from nEdge Lite appearing in real-time.
Remote Deployment
When nEdge Lite and ntopng run on different machines:
On ntopng host (192.168.1.10):
sudo ntopng -i tcp://0.0.0.0:1234cOn nEdge Lite host:
sudo nedgelite -q 0 -z tcp://192.168.1.10:1234Firewall Configuration:
Ensure TCP port 1234 is accessible from the nEdge Lite host to ntopng host.
Dynamic Policy Management
To enable bidirectional communication (flow export + policy updates):
Setup with Policy Updates
On ntopng host:
sudo ntopng -i tcp://0.0.0.0:5556c --zmq-publish-events tcp://0.0.0.0:5557On nEdge Lite host:
sudo nedgelite -q 0 -z tcp://ntopng-host:5556 -p tcp://ntopng-host:5557Configure Policies in ntopng:
- Open ntopng web interface
- Navigate to Settings → Policies
- Create or modify policies
- Changes are automatically pushed to nEdge Lite
Managing Policies via ntopng
Creating a Pool:
- Go to Pools → Host Pools
- Click Add Pool
- Define IP ranges and/or MAC addresses
- Assign a policy to the pool
Creating a Policy:
- Go to Policies → Traffic Policies
- Click Add Policy
- Configure protocol/category filters
- Set default action (Pass/Drop)
- Click Save
Viewing Applied Policies:
- Go to Flows → All Flows
- Look for the Policy column
- Flows show which policy was applied
Multiple nEdge Lite Instances
Single ntopng, Multiple nEdge Lite Deployments
Deploy nEdge Lite on multiple hosts, all reporting to one ntopng:
On ntopng host:
sudo ntopng -i tcp://0.0.0.0:5556c --zmq-publish-events tcp://0.0.0.0:5557On nEdge Lite host 1:
sudo nedgelite -q 0 -z tcp://ntopng-host:5556 -p tcp://ntopng-host:5557On nEdge Lite host 2:
sudo nedgelite -q 0 -z tcp://ntopng-host:5556 -p tcp://ntopng-host:5557On nEdge Lite host 3:
sudo nedgelite -q 0 -z tcp://ntopng-host:5556 -p tcp://ntopng-host:5557All nEdge Lite instances will:
- Send flows to the same ntopng
- Receive policy updates from the same ntopng
- Appear as separate interfaces/collectors in ntopng
High Availability
For redundancy, send flows to multiple ntopng instances:
sudo nedgelite -q 0 \
-z tcp://ntopng1:5556 \
-z tcp://ntopng2:5556 \
-p tcp://ntopng1:5557Encrypted Communication
Secure flow export with ZeroMQ CURVE encryption.
Generate CURVE Keys
On ntopng host, generate a key pair:
# Generate keys using zmq tools
curve_keygenThis outputs:
public-key: Yne@$w-vo<fVvi]a<NY6T1ed:M$fCG*[IaLV{hID
secret-key: D:)Q[IlAW!ahhC2ac:9*A}h:p?([4%wOTJ%JR%csConfigure ntopng with Encryption
sudo ntopng -i tcp://0.0.0.0:5556c \
--zmq-encryption-key "Yne@$w-vo<fVvi]a<NY6T1ed:M$fCG*[IaLV{hID:D:)Q[IlAW!ahhC2ac:9*A}h:p?([4%wOTJ%JR%cs"Configure nEdge Lite with Encryption
sudo nedgelite -q 0 \
-z tcp://ntopng-host:5556 \
-y "Yne@$w-vo<fVvi]a<NY6T1ed:M$fCG*[IaLV{hID"Note: nEdge Lite only needs the public key, ntopng needs both.
Flow Export Formats
TLV Format (Default)
Type-Length-Value format is compact and efficient:
sudo nedgelite -q 0 -z tcp://127.0.0.1:1234Advantages:
- Compact binary format
- Lower bandwidth usage
- Faster serialization
JSON Format
Human-readable JSON format for debugging:
sudo nedgelite -q 0 -z tcp://127.0.0.1:1234 -jAdvantages:
- Human-readable
- Easy to debug
- Compatible with custom integrations
Disadvantages:
- Higher bandwidth usage
- Slower serialization
Optimizing Flow Export
Flow Update Interval
Adjust how often flows are updated:
# Update every 10 seconds (more real-time)
sudo nedgelite -q 0 -z tcp://127.0.0.1:1234 -u 10
# Update every 60 seconds (less overhead)
sudo nedgelite -q 0 -z tcp://127.0.0.1:1234 -u 60Recommendations:
- Real-time monitoring: 5-15 seconds
- Historical analysis: 30-60 seconds
- High-volume environments: 60-120 seconds
Immediate Flush
Disable batching for lowest latency:
sudo nedgelite -q 0 -z tcp://127.0.0.1:1234 -fUse Cases:
- Debugging and troubleshooting
- Low-traffic environments
- When latency is critical
Trade-offs:
- Higher CPU usage
- More ZMQ messages
- Increased bandwidth
Monitoring the Integration
Verify Flow Export
In ntopng:
- Go to Interfaces
- Look for the ZMQ collector interface
- Check packet/byte counters
Check ZMQ Connection:
# On ntopng host
sudo netstat -tnlp | grep 1234
# On nEdge Lite host
sudo netstat -tn | grep 1234View Flows in ntopng
- All Flows: Go to Flows → All Flows
- Top Protocols: Go to Dashboard → Top Protocols
- Top Applications: Go to Dashboard → Top Applications
- Alerts: Go to Alerts → Detected Alerts
Troubleshooting Integration
No Flows Appearing in ntopng
Verify ntopng is listening:
shellsudo netstat -tnlp | grep ntopngCheck nEdge Lite is running:
shellps aux | grep nedgeliteVerify ZMQ endpoint configuration:
- ntopng endpoint must end with
c - nEdge Lite endpoint must not have
c
- ntopng endpoint must end with
Check firewall rules:
shellsudo iptables -L -n -v | grep 1234Enable verbose logging:
shellsudo nedgelite -q 0 -z tcp://127.0.0.1:1234 -v
Policy Updates Not Working
Verify policy endpoint:
shellsudo nedgelite -q 0 -z tcp://127.0.0.1:5556 -p tcp://127.0.0.1:5557 -vCheck ntopng is publishing:
shellsudo netstat -tnlp | grep 5557Restart nEdge Lite after policy changes:
If using static files, send SIGHUP:
shellsudo kill -HUP $(pidof nedgelite)
High Latency or Packet Loss
Reduce flow update interval:
shellsudo nedgelite -q 0 -z tcp://127.0.0.1:1234 -u 60Use multiple queues:
shellsudo nedgelite -q 0:4 -z tcp://127.0.0.1:1234Check network bandwidth:
shelliftop -i eth0
Integration Best Practices
- Co-locate when possible: Run nEdge Lite and ntopng on the same host for lowest latency
- Use TLV format: More efficient than JSON for production
- Tune update interval: Balance real-time visibility with performance
- Enable encryption: For remote deployments or sensitive environments
- Monitor ZMQ queue: Watch for backlog indicating performance issues
- Use multiple collectors: For high-availability deployments
- Regular backups: Export ntopng configuration and historical data
Next Steps
- Explore Advanced Features features
- Review Troubleshooting for common issues
- Learn about Configuration options for optimization
