# loukiknaik/synthetic-ping-monitoring-system architecture

> Architecture diagram of the GitHub repository loukiknaik/synthetic-ping-monitoring-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/loukiknaik/synthetic-ping-monitoring-system
- Repository: https://github.com/loukiknaik/synthetic-ping-monitoring-system

## Overview

##### Project type and purpose
- This is a small full-stack “monitoring pipeline” tool written in Python. Its purpose is to perform synthetic network monitoring by:
- Reading a YAML configuration of target servers and probe settings
- Issuing ICMP pings at configured intervals
- Parsing raw ping output into metrics
- Pushing those metrics into Prometheus
- Visualizing them in Grafana

##### File structure
- Top-level files:
- config.yaml – defines servers, probe counts, interval
- parseYaml.py – loads and validates config.yaml
- parsePing.py – parses the raw output from system ping commands
- pingMonitor.py – orchestration script tying parsing, pinging, and metric export
- requirements.txt – Python dependencies (e.g., prometheus_client)

##### README for additional insights
- The README already describes the flow:
[config.yaml] → parseYaml.py → pingMonitor.py → parsePing.py → Prometheus → Grafana
- Mentions that pingMonitor invokes system ping and uses prometheus_client to expose a metrics HTTP endpoint

##### Detail
- Every script and its role is represented
- Data transitions: raw ping → parsed metrics
- Deployment context if relevant (e.g., running on a monitoring host or container)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Project Files
    subgraph "ping-monitor-service"
        PYLOAD["parseYaml.py"]:::python
        PMON["pingMonitor.py"]:::python
        PPARSE["parsePing.py"]:::python
    end

    CFG["config.yaml"]:::config
    REQ["requirements.txt"]:::config
    IMG["images/"]:::config
    DOC["Readme.md"]:::config

    NET["Internet/Target Servers"]:::external
    PROM["Prometheus"]:::service
    GRAF["Grafana"]:::service

    %% Data Flows
    CFG -->|"YAML"| PYLOAD
    PYLOAD -->|"config object"| PMON
    PMON -->|"ICMP"| NET
    PMON -->|"stdout"| PPARSE
    PPARSE -->|"parsed metrics"| PMON
    PROM -.->|"scrape /metrics"| PMON
    PMON -->|"HTTP GET /metrics"| PROM
    PROM -->|"query metrics"| GRAF

    %% Click Events
    click PYLOAD "https://github.com/loukiknaik/synthetic-ping-monitoring-system/blob/master/parseYaml.py"
    click CFG "https://github.com/loukiknaik/synthetic-ping-monitoring-system/blob/master/config.yaml"
    click PMON "https://github.com/loukiknaik/synthetic-ping-monitoring-system/blob/master/pingMonitor.py"
    click PPARSE "https://github.com/loukiknaik/synthetic-ping-monitoring-system/blob/master/parsePing.py"
    click REQ "https://github.com/loukiknaik/synthetic-ping-monitoring-system/blob/master/requirements.txt"
    click IMG "https://github.com/loukiknaik/synthetic-ping-monitoring-system/tree/master/images/"
    click DOC "https://github.com/loukiknaik/synthetic-ping-monitoring-system/blob/master/Readme.md"

    %% Styles
    classDef python fill:#cce5ff,stroke:#004085,color:#004085;
    classDef external fill:#e2e3e5,stroke:#6c757d,color:#6c757d;
    classDef service fill:#d4edda,stroke:#155724,color:#155724;
    classDef config fill:#f8f9fa,stroke:#6c757d,color:#6c757d;
```
