Skip to content

Repository files navigation

Industrial SNMP Tracer

CI PHP 8.3 MySQL 8.4 Bootstrap 5 Docker SNMP License

A vendor-neutral engineering web application for learning and demonstrating SNMP GET/WALK diagnostics. The project combines a PHP/Bootstrap interface, MySQL trace history, a project-owned synthetic MIB, and a local Net-SNMP simulator.

The public demo model is intentionally generic: it represents an environmental sensor node with identity, ambient telemetry, and collection statistics. It does not model a commercial product, production protocol, customer network, or private device schema.

Industrial SNMP Tracer dashboard

SNMP Tracer view

SNMP Tracer query view

Highlights

  • SNMP v1/v2c endpoint profiles
  • SNMP GET for scalar objects
  • SNMP WALK for branch/subtree discovery
  • MIB-aware OID catalog and human-readable engineering formatting
  • Searchable MySQL audit history with operation, latency, status and response data
  • Generic Device Overview for the included synthetic sensor node
  • Community strings encrypted at rest with AES-256-GCM
  • CSRF protection on state-changing forms
  • Local Net-SNMP simulator for hardware-free testing
  • Docker Compose startup with localhost-only host bindings
  • GitHub Actions, security guidance, contribution guide and release audit

Architecture

flowchart LR
    U[Browser / Bootstrap UI] -->|HTTP| P[PHP 8.3 + Apache]
    P -->|SNMP GET / WALK\nUDP| A[Synthetic Net-SNMP Agent]
    P --> C[MIB / OID Catalog]
    P --> D[(MySQL Trace Store)]
    A --> S[Generic Sensor Values]
Loading

The simulator reproduces only the SNMP-facing project demo subtree. It does not emulate a production device or a separate field protocol.

Application pages

Page Purpose
Dashboard Device/query statistics, success rate, average latency and recent operations
Device Overview Reads the synthetic subtree and formats ambient/node telemetry
Devices Registers SNMP endpoints and tests connectivity
SNMP Tracer Executes GET/WALK and displays raw + formatted responses
MIB Browser Explores OIDs, types, branches, access, units and descriptions
History Searches the persisted SNMP audit trail

Independent demo MIB

The repository contains mib/OPEN-LAB-SENSOR-MIB.mib, created specifically for this public project.

1.3.6.1.4.1.32473.42
├── 10  labIdentity
│   ├── 1  labNodeLabel
│   ├── 2  labSoftwareBuild
│   ├── 3  labOperatingMode
│   └── 4  labUptimeSeconds
├── 20  labEnvironment
│   ├── 1  labTemperatureTenthsC
│   ├── 2  labHumidityTenthsPercent
│   ├── 3  labPressureHpa
│   └── 4  labSupplyMillivolts
└── 30  labTelemetry
    ├── 1  labSampleCount
    ├── 2  labTransportErrorCount
    └── 3  labLastSampleAgeSeconds

This is an 11-object, three-branch synthetic model. It deliberately avoids application-specific tariff, billing, metering, fieldbus, customer, or vendor semantics.

32473 is reserved by RFC 5612 for documentation/examples. This lab further places its module below .42 and uses it only for local demonstration. A production product should use its own IANA-assigned Private Enterprise Number.

Quick start

Requirements

  • Docker Desktop, or Docker Engine with Compose
  • Python 3 only for the one-time local .env generator

1. Generate local secrets

python scripts/init_env.py

This creates a local .env with random application/database secrets. .env is ignored by Git.

2. Start the lab

docker compose up --build

Open http://localhost:8080.

The synthetic SNMP agent is also exposed on host UDP 127.0.0.1:1161 for local testing. A profile named Open Lab Sensor Node is created automatically inside the application.

Suggested demo flow

  1. Open Devices and run a connectivity test.
  2. Open Device Overview and read a complete snapshot.
  3. Open SNMP Tracer and GET labTemperatureTenthsC.
  4. Switch to WALK and query labEnvironment, labTelemetry, or the whole .32473.42 subtree.
  5. Open History and inspect the persisted trace records.

Supported operations

Operation Support Notes
GET Scalar object queries
WALK Subtree discovery / collection
SET Deliberately excluded; project demo objects are read-only
TRAP Outside the current educational scope

Repository layout

industrial-snmp-tracer/
├── .github/                 CI workflow and templates
├── app/                     PHP controllers, repositories and services
├── database/                MySQL schema + synthetic OID catalog
├── docs/                    Architecture, security and screenshots
├── mib/                     Project-owned OPEN-LAB-SENSOR-MIB
├── public/                  Front controller and static assets
├── scripts/                 Environment generator and release checks
├── simulator/               Local Net-SNMP sensor agent
├── views/                   Bootstrap UI templates
├── compose.yaml
├── Dockerfile
└── README.md

Security model

This repository contains no real SNMP credentials, device inventory, internal IP address, customer data or production MIB. Keep those values out of source control when adapting the project.

Community strings saved through the application are encrypted at rest with AES-256-GCM, using the local APP_KEY. SNMP v1/v2c themselves do not provide modern transport confidentiality, so real deployments should use protected network access and consider SNMPv3 where appropriate.

The default Compose file binds the web UI and demo UDP port to 127.0.0.1, not all host interfaces.

See SECURITY.md and docs/security.md.

Development and validation

Run the public-release audit:

python scripts/repository_audit.py

PHP syntax check (Linux/macOS/Git Bash):

find app public views -name '*.php' -print0 | xargs -0 -n1 php -l

Python syntax check:

python -m py_compile simulator/*.py scripts/*.py

GitHub Actions runs syntax checks and the repository audit on pushes and pull requests.

To rebuild the lab from a clean MySQL volume:

docker compose down -v
docker compose up --build

docker compose down -v deletes the local demo database and trace history.

Public-release notes

  • The included MIB, OID catalog and simulator data are synthetic and project-owned.
  • Screenshots contain demo values only.
  • .env is intentionally absent from releases and ignored by Git.
  • The repository audit also checks that legacy demo-model identifiers are not accidentally reintroduced.
  • Review your own employment, internship or organizational IP policy before publishing code created during work activities.

Documentation

License

Released under the MIT License.

About

Vendor-neutral SNMP GET/WALK tracer with a synthetic MIB, MySQL trace history, PHP/Bootstrap UI and Dockerized Net-SNMP simulator.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages