Enterprise Network Observability & Infrastructure Visibility
Designed and deployed an integrated network monitoring stack to transform a "dark network" into a fully observed infrastructure. Prior to this project, the environment lacked port-level mapping and real-time visibility -relying solely on configuration backup files and physical cable tracing to determine connectivity.
- No real-time network visibility
- Manual cable tracing for port identification
- Static configuration backups only
- Unknown device inventory
- Reactive troubleshooting
- Complete L2/L3 topology mapping
- Instant MAC-to-port queries
- Real-time performance metrics
- Automated device discovery
- Proactive alerting
Three complementary tools deployed on Ubuntu 22.04 VMs provide full-spectrum network observability:
Automated device discovery, MAC address tracking, port mapping, and network topology visualization
SNMP polling, bandwidth graphs, uptime tracking, and threshold-based alerts
Human-readable port status pages, VLAN assignments, and connected device inventory
01 Netdisco Configuration
Device Discovery
sudo -iu netdisco ~/bin/netdisco-do discover -d <DEVICE_IP> # Bulk discovery loop for subnet for ip in <IP_RANGE>; do ~/bin/netdisco-do add -d "$ip" -c <COMMUNITY> done Automated Polling (Crontab)
# Hourly full network refresh 0 * * * * ~/bin/netdisco-do discoverall --force --quiet 10 * * * * ~/bin/netdisco-do macwalk --force --quiet 20 * * * * ~/bin/netdisco-do arpwalk --force --quiet # Daily web frontend restart for stability 0 3 * * * ~/bin/netdisco-web restart >> ~/netdisco_restart.log 2>&1 Schema Migration (v90 → v93)
# Stop services before upgrade ~/bin/netdisco-backend stop ~/bin/netdisco-web stop # Deploy schema updates ~/bin/netdisco-db-deploy # Restart services ~/bin/netdisco-backend start ~/bin/netdisco-web start 02 LibreNMS Integration
Adding Devices via CLI
ssh user@monitoring-server sudo su - librenms ./lnms device:add --v2c -c <COMMUNITY> <DEVICE_IP> Maintenance Procedures
# Fix daily.sh failures sudo -u librenms -H bash cd /opt/librenms tail -n 200 logs/daily.log ./daily.sh # Clean dirty git tree git reset --hard && git clean -fd ./scripts/github-remove -d git pull --rebase --autostash composer install --no-dev -o 03 Switchmap Deployment
Installation
# Download and extract to web root cd /var/www/html wget https://sourceforge.net/projects/switchmap/files/latest tar zxvf switchmap-*.tar.gz mv switchmap-* switchmap Perl Dependencies
# Debian/Ubuntu packages sudo apt install libnet-snmp-perl sudo apt install liblog-log4perl-perl sudo apt install liblog-dispatch-perl # Or via CPAN perl -MCPAN -e 'install Net::SNMP' perl -MCPAN -e 'install Log::Log4perl' perl -MCPAN -e 'install Log::Dispatch::Screen' Configuration (ThisSite.pm)
# Set SNMP community string $Community = '<COMMUNITY_STRING>'; # Or use per-switch community file $CmstrFile = '/path/to/communities.txt'; # Define switches to poll @Ession = ('switch1.domain.local', 'switch2.domain.local'); Cron Jobs (Scheduled Polling)
# Hourly ARP table collection from L3 devices 44 * * * * perl /var/www/html/switchmap/GetArp.pl # Hourly switch scan (MAC tables, port status) 49 * * * * perl /var/www/html/switchmap/ScanSwitch.pl # Daily HTML generation 05 6 * * * perl /var/www/html/switchmap/SwitchMap.pl
Switchmap runs three scripts in sequence: GetArp.pl retrieves ARP tables from routers/L3 switches,
ScanSwitch.pl polls MAC address tables and port status via SNMP, and SwitchMap.pl
generates static HTML pages served by Apache/Nginx.
04 SNMP Agent Deployment
Standard Configuration (/etc/snmp/snmpd.conf)
# Location and contact metadata sysLocation <DATACENTER_LOCATION> sysContact <ADMIN_NAME> <ADMIN_EMAIL> # Read-only community (no write access) rocommunity <COMMUNITY_STRING> # Listen on management interface agentAddress udp:161 Service Activation
sudo apt update && sudo apt install snmpd snmp libsnmp-dev sudo systemctl enable snmpd sudo systemctl restart snmpd sudo systemctl status snmpd - Ubuntu 22.04 server management
- Service lifecycle (systemctl)
- User/permission management
- L2/L3 topology understanding
- VLAN configuration
- MAC address tables
- Port trunking
- SNMPv2c configuration
- Community string security
- MIB polling
- Agent deployment
- Cron job scheduling
- Perl CPAN management
- Bash scripting
- Service orchestration
- PostgreSQL administration
- Schema migrations
- Query optimization
- Backup procedures
All monitoring tools deployed on Ubuntu 22.04 LTS VMs running on Hyper-V. Future consideration: migrate to LXC containers for reduced overhead.
Switchmap requires careful Perl CPAN module management. Used localenv wrapper for Netdisco to isolate Perl dependencies from system packages.
Hourly polling balances freshness with resource usage. Low-change environment doesn't require more aggressive intervals.
SNMP v2c with read-only community strings. Monitoring VMs isolated on management VLAN with ACL-restricted access.
- ✓ Netdisco topology mapping operational
- ✓ LibreNMS performance monitoring active
- ✓ Switchmap port directory generated
- ✓ SNMP deployed across all physical/virtual assets
- ✓ Automated polling schedules configured
- ✓ Database maintenance procedures documented