diff --git a/configs/grafana/dashboards/asterisk-overview.json b/configs/grafana/dashboards/asterisk-overview.json new file mode 100644 index 0000000..50af847 --- /dev/null +++ b/configs/grafana/dashboards/asterisk-overview.json @@ -0,0 +1,170 @@ +{ + "title": "Asterisk Overview", + "uid": "asterisk-overview", + "tags": ["voip", "asterisk", "pbx", "sip"], + "refresh": "30s", + "time": { + "from": "now-1h", + "to": "now" + }, + "panels": [ + { + "title": "Asterisk VM Status", + "type": "stat", + "gridPos": {"h": 4, "w": 6, "x": 0, "y": 0}, + "targets": [ + { + "expr": "up{job=\"voip-nodes\", instance=\"pbx-1\"}", + "legendFormat": "pbx-1", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "mappings": [{"type": "value", "options": {"0": {"text": "DOWN", "color": "red"}, "1": {"text": "UP", "color": "green"}}}], + "thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": 0}, {"color": "green", "value": 1}]} + } + }, + "options": {"colorMode": "background", "graphMode": "none"}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Asterisk Info", + "type": "text", + "gridPos": {"h": 4, "w": 18, "x": 6, "y": 0}, + "options": { + "mode": "markdown", + "content": "## Asterisk PBX (pbx-1)\n\n**Role:** Call processing, voicemail, IVR, recording\n\n| Port | Protocol | Purpose |\n|------|----------|--------|\n| 5080 | UDP | SIP (internal) |\n| 5038 | TCP | AMI (Asterisk Manager Interface) |\n| 8088 | TCP | ARI (Asterisk REST Interface) |\n\n*Note: Asterisk-specific metrics require asterisk_exporter to be installed*" + } + }, + { + "title": "CPU Usage", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 0, "y": 4}, + "targets": [ + { + "expr": "100 - (avg(irate(node_cpu_seconds_total{job=\"voip-nodes\", instance=\"pbx-1\", mode=\"idle\"}[5m])) * 100)", + "legendFormat": "CPU %", + "refId": "A" + } + ], + "fieldConfig": {"defaults": {"unit": "percent", "min": 0, "max": 100}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Memory Usage", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 12, "y": 4}, + "targets": [ + { + "expr": "node_memory_MemTotal_bytes{job=\"voip-nodes\", instance=\"pbx-1\"} - node_memory_MemAvailable_bytes{job=\"voip-nodes\", instance=\"pbx-1\"}", + "legendFormat": "Used", + "refId": "A" + }, + { + "expr": "node_memory_MemAvailable_bytes{job=\"voip-nodes\", instance=\"pbx-1\"}", + "legendFormat": "Available", + "refId": "B" + } + ], + "fieldConfig": {"defaults": {"unit": "bytes"}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Network I/O", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 0, "y": 12}, + "targets": [ + { + "expr": "rate(node_network_receive_bytes_total{job=\"voip-nodes\", instance=\"pbx-1\", device=\"lima0\"}[5m])", + "legendFormat": "RX", + "refId": "A" + }, + { + "expr": "rate(node_network_transmit_bytes_total{job=\"voip-nodes\", instance=\"pbx-1\", device=\"lima0\"}[5m])", + "legendFormat": "TX", + "refId": "B" + } + ], + "fieldConfig": {"defaults": {"unit": "Bps"}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Disk I/O (Recording Storage)", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 12, "y": 12}, + "targets": [ + { + "expr": "rate(node_disk_read_bytes_total{job=\"voip-nodes\", instance=\"pbx-1\"}[5m])", + "legendFormat": "Read", + "refId": "A" + }, + { + "expr": "rate(node_disk_written_bytes_total{job=\"voip-nodes\", instance=\"pbx-1\"}[5m])", + "legendFormat": "Write", + "refId": "B" + } + ], + "fieldConfig": {"defaults": {"unit": "Bps"}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Disk Usage", + "type": "gauge", + "gridPos": {"h": 6, "w": 8, "x": 0, "y": 20}, + "targets": [ + { + "expr": "(1 - (node_filesystem_avail_bytes{job=\"voip-nodes\", instance=\"pbx-1\", mountpoint=\"/\"} / node_filesystem_size_bytes{job=\"voip-nodes\", instance=\"pbx-1\", mountpoint=\"/\"})) * 100", + "legendFormat": "Root", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "percent", + "min": 0, + "max": 100, + "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": 0}, {"color": "yellow", "value": 70}, {"color": "red", "value": 85}]} + } + }, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Process Count", + "type": "stat", + "gridPos": {"h": 6, "w": 8, "x": 8, "y": 20}, + "targets": [ + { + "expr": "node_procs_running{job=\"voip-nodes\", instance=\"pbx-1\"}", + "legendFormat": "Running", + "refId": "A" + }, + { + "expr": "node_procs_blocked{job=\"voip-nodes\", instance=\"pbx-1\"}", + "legendFormat": "Blocked", + "refId": "B" + } + ], + "options": {"colorMode": "value", "graphMode": "area"}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "File Descriptors", + "type": "timeseries", + "gridPos": {"h": 6, "w": 8, "x": 16, "y": 20}, + "targets": [ + { + "expr": "node_filefd_allocated{job=\"voip-nodes\", instance=\"pbx-1\"}", + "legendFormat": "Allocated", + "refId": "A" + }, + { + "expr": "node_filefd_maximum{job=\"voip-nodes\", instance=\"pbx-1\"}", + "legendFormat": "Maximum", + "refId": "B" + } + ], + "datasource": {"type": "prometheus", "uid": "Prometheus"} + } + ] +} diff --git a/configs/grafana/dashboards/opensips-overview.json b/configs/grafana/dashboards/opensips-overview.json new file mode 100644 index 0000000..fb9913a --- /dev/null +++ b/configs/grafana/dashboards/opensips-overview.json @@ -0,0 +1,143 @@ +{ + "title": "OpenSIPS Overview", + "uid": "opensips-overview", + "tags": ["voip", "opensips", "sip", "proxy"], + "refresh": "30s", + "time": { + "from": "now-1h", + "to": "now" + }, + "panels": [ + { + "title": "OpenSIPS VM Status", + "type": "stat", + "gridPos": {"h": 4, "w": 6, "x": 0, "y": 0}, + "targets": [ + { + "expr": "up{job=\"voip-nodes\", instance=\"sip-1\"}", + "legendFormat": "sip-1", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "mappings": [{"type": "value", "options": {"0": {"text": "DOWN", "color": "red"}, "1": {"text": "UP", "color": "green"}}}], + "thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": 0}, {"color": "green", "value": 1}]} + } + }, + "options": {"colorMode": "background", "graphMode": "none"}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "OpenSIPS Info", + "type": "text", + "gridPos": {"h": 4, "w": 18, "x": 6, "y": 0}, + "options": { + "mode": "markdown", + "content": "## OpenSIPS SIP Proxy (sip-1)\n\n**Role:** SIP registration, routing, load balancing\n\n| Port | Protocol | Purpose |\n|------|----------|--------|\n| 5060 | UDP/TCP | SIP Signaling |\n| 5061 | TCP | SIP/TLS |\n| 8080 | TCP | WebSocket |\n| 8443 | TCP | WebSocket Secure |\n\n*Note: OpenSIPS-specific metrics require opensips_exporter to be installed*" + } + }, + { + "title": "CPU Usage", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 0, "y": 4}, + "targets": [ + { + "expr": "100 - (avg(irate(node_cpu_seconds_total{job=\"voip-nodes\", instance=\"sip-1\", mode=\"idle\"}[5m])) * 100)", + "legendFormat": "CPU %", + "refId": "A" + } + ], + "fieldConfig": {"defaults": {"unit": "percent", "min": 0, "max": 100, "color": {"mode": "palette-classic"}}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Memory Usage", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 12, "y": 4}, + "targets": [ + { + "expr": "node_memory_MemTotal_bytes{job=\"voip-nodes\", instance=\"sip-1\"} - node_memory_MemAvailable_bytes{job=\"voip-nodes\", instance=\"sip-1\"}", + "legendFormat": "Used", + "refId": "A" + }, + { + "expr": "node_memory_MemAvailable_bytes{job=\"voip-nodes\", instance=\"sip-1\"}", + "legendFormat": "Available", + "refId": "B" + } + ], + "fieldConfig": {"defaults": {"unit": "bytes"}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Network I/O", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 0, "y": 12}, + "targets": [ + { + "expr": "rate(node_network_receive_bytes_total{job=\"voip-nodes\", instance=\"sip-1\", device=\"lima0\"}[5m])", + "legendFormat": "RX", + "refId": "A" + }, + { + "expr": "rate(node_network_transmit_bytes_total{job=\"voip-nodes\", instance=\"sip-1\", device=\"lima0\"}[5m])", + "legendFormat": "TX", + "refId": "B" + } + ], + "fieldConfig": {"defaults": {"unit": "Bps"}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Network Packets", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 12, "y": 12}, + "targets": [ + { + "expr": "rate(node_network_receive_packets_total{job=\"voip-nodes\", instance=\"sip-1\", device=\"lima0\"}[5m])", + "legendFormat": "RX Packets", + "refId": "A" + }, + { + "expr": "rate(node_network_transmit_packets_total{job=\"voip-nodes\", instance=\"sip-1\", device=\"lima0\"}[5m])", + "legendFormat": "TX Packets", + "refId": "B" + } + ], + "fieldConfig": {"defaults": {"unit": "pps"}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "UDP Connections (SIP Traffic Indicator)", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 0, "y": 20}, + "targets": [ + { + "expr": "node_sockstat_UDP_inuse{job=\"voip-nodes\", instance=\"sip-1\"}", + "legendFormat": "UDP Sockets", + "refId": "A" + } + ], + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "TCP Connections", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 12, "y": 20}, + "targets": [ + { + "expr": "node_sockstat_TCP_inuse{job=\"voip-nodes\", instance=\"sip-1\"}", + "legendFormat": "TCP Established", + "refId": "A" + }, + { + "expr": "node_sockstat_TCP_tw{job=\"voip-nodes\", instance=\"sip-1\"}", + "legendFormat": "TCP Time-Wait", + "refId": "B" + } + ], + "datasource": {"type": "prometheus", "uid": "Prometheus"} + } + ] +} diff --git a/configs/grafana/dashboards/rtpengine-overview.json b/configs/grafana/dashboards/rtpengine-overview.json new file mode 100644 index 0000000..832c48c --- /dev/null +++ b/configs/grafana/dashboards/rtpengine-overview.json @@ -0,0 +1,201 @@ +{ + "title": "RTPEngine Overview", + "uid": "rtpengine-overview", + "tags": ["voip", "rtpengine", "rtp", "media"], + "refresh": "30s", + "time": { + "from": "now-1h", + "to": "now" + }, + "panels": [ + { + "title": "RTPEngine VM Status", + "type": "stat", + "gridPos": {"h": 4, "w": 6, "x": 0, "y": 0}, + "targets": [ + { + "expr": "up{job=\"voip-nodes\", instance=\"media-1\"}", + "legendFormat": "media-1", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "mappings": [{"type": "value", "options": {"0": {"text": "DOWN", "color": "red"}, "1": {"text": "UP", "color": "green"}}}], + "thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": 0}, {"color": "green", "value": 1}]} + } + }, + "options": {"colorMode": "background", "graphMode": "none"}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "RTPEngine Info", + "type": "text", + "gridPos": {"h": 4, "w": 18, "x": 6, "y": 0}, + "options": { + "mode": "markdown", + "content": "## RTPEngine Media Proxy (media-1)\n\n**Role:** RTP/RTCP media relay, transcoding, SRTP encryption\n\n| Port Range | Protocol | Purpose |\n|------|----------|--------|\n| 10000-20000 | UDP | RTP Media Streams |\n| 22222 | UDP | Control (ng protocol) |\n\n**Key Metrics:** Network throughput is critical for RTPEngine as it handles all media streams.\n\n*Note: RTPEngine-specific metrics require rtpengine_exporter to be installed*" + } + }, + { + "title": "CPU Usage", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 0, "y": 4}, + "targets": [ + { + "expr": "100 - (avg(irate(node_cpu_seconds_total{job=\"voip-nodes\", instance=\"media-1\", mode=\"idle\"}[5m])) * 100)", + "legendFormat": "CPU %", + "refId": "A" + }, + { + "expr": "avg(irate(node_cpu_seconds_total{job=\"voip-nodes\", instance=\"media-1\", mode=\"system\"}[5m])) * 100", + "legendFormat": "System %", + "refId": "B" + }, + { + "expr": "avg(irate(node_cpu_seconds_total{job=\"voip-nodes\", instance=\"media-1\", mode=\"softirq\"}[5m])) * 100", + "legendFormat": "SoftIRQ % (Network)", + "refId": "C" + } + ], + "fieldConfig": {"defaults": {"unit": "percent", "min": 0, "max": 100}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Memory Usage", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 12, "y": 4}, + "targets": [ + { + "expr": "node_memory_MemTotal_bytes{job=\"voip-nodes\", instance=\"media-1\"} - node_memory_MemAvailable_bytes{job=\"voip-nodes\", instance=\"media-1\"}", + "legendFormat": "Used", + "refId": "A" + }, + { + "expr": "node_memory_MemAvailable_bytes{job=\"voip-nodes\", instance=\"media-1\"}", + "legendFormat": "Available", + "refId": "B" + }, + { + "expr": "node_memory_Buffers_bytes{job=\"voip-nodes\", instance=\"media-1\"} + node_memory_Cached_bytes{job=\"voip-nodes\", instance=\"media-1\"}", + "legendFormat": "Buffers+Cache", + "refId": "C" + } + ], + "fieldConfig": {"defaults": {"unit": "bytes"}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Network Throughput (Critical for Media)", + "type": "timeseries", + "gridPos": {"h": 8, "w": 24, "x": 0, "y": 12}, + "targets": [ + { + "expr": "rate(node_network_receive_bytes_total{job=\"voip-nodes\", instance=\"media-1\", device=\"lima0\"}[5m])", + "legendFormat": "RX (Inbound Media)", + "refId": "A" + }, + { + "expr": "rate(node_network_transmit_bytes_total{job=\"voip-nodes\", instance=\"media-1\", device=\"lima0\"}[5m])", + "legendFormat": "TX (Outbound Media)", + "refId": "B" + } + ], + "fieldConfig": {"defaults": {"unit": "Bps", "custom": {"lineWidth": 2, "fillOpacity": 20}}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "UDP Packets (RTP Traffic)", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 0, "y": 20}, + "targets": [ + { + "expr": "rate(node_network_receive_packets_total{job=\"voip-nodes\", instance=\"media-1\", device=\"lima0\"}[5m])", + "legendFormat": "RX Packets/s", + "refId": "A" + }, + { + "expr": "rate(node_network_transmit_packets_total{job=\"voip-nodes\", instance=\"media-1\", device=\"lima0\"}[5m])", + "legendFormat": "TX Packets/s", + "refId": "B" + } + ], + "fieldConfig": {"defaults": {"unit": "pps"}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Network Errors & Drops", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 12, "y": 20}, + "targets": [ + { + "expr": "rate(node_network_receive_drop_total{job=\"voip-nodes\", instance=\"media-1\", device=\"lima0\"}[5m])", + "legendFormat": "RX Drops", + "refId": "A" + }, + { + "expr": "rate(node_network_transmit_drop_total{job=\"voip-nodes\", instance=\"media-1\", device=\"lima0\"}[5m])", + "legendFormat": "TX Drops", + "refId": "B" + }, + { + "expr": "rate(node_network_receive_errs_total{job=\"voip-nodes\", instance=\"media-1\", device=\"lima0\"}[5m])", + "legendFormat": "RX Errors", + "refId": "C" + }, + { + "expr": "rate(node_network_transmit_errs_total{job=\"voip-nodes\", instance=\"media-1\", device=\"lima0\"}[5m])", + "legendFormat": "TX Errors", + "refId": "D" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short", + "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": 0}, {"color": "yellow", "value": 1}, {"color": "red", "value": 10}]} + } + }, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "UDP Socket Usage", + "type": "stat", + "gridPos": {"h": 4, "w": 8, "x": 0, "y": 28}, + "targets": [ + { + "expr": "node_sockstat_UDP_inuse{job=\"voip-nodes\", instance=\"media-1\"}", + "legendFormat": "UDP Sockets", + "refId": "A" + } + ], + "options": {"colorMode": "value", "graphMode": "area"}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Context Switches", + "type": "timeseries", + "gridPos": {"h": 4, "w": 8, "x": 8, "y": 28}, + "targets": [ + { + "expr": "rate(node_context_switches_total{job=\"voip-nodes\", instance=\"media-1\"}[5m])", + "legendFormat": "Context Switches/s", + "refId": "A" + } + ], + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Interrupts", + "type": "timeseries", + "gridPos": {"h": 4, "w": 8, "x": 16, "y": 28}, + "targets": [ + { + "expr": "rate(node_intr_total{job=\"voip-nodes\", instance=\"media-1\"}[5m])", + "legendFormat": "Interrupts/s", + "refId": "A" + } + ], + "datasource": {"type": "prometheus", "uid": "Prometheus"} + } + ] +} diff --git a/configs/grafana/dashboards/voip-overview.json b/configs/grafana/dashboards/voip-overview.json new file mode 100644 index 0000000..5832fbf --- /dev/null +++ b/configs/grafana/dashboards/voip-overview.json @@ -0,0 +1,164 @@ +{ + "title": "VoIP Stack Overview", + "uid": "voip-overview", + "tags": ["voip", "overview", "sip", "asterisk", "opensips", "rtpengine"], + "refresh": "30s", + "time": { + "from": "now-1h", + "to": "now" + }, + "panels": [ + { + "title": "VoIP VM Status", + "type": "stat", + "gridPos": {"h": 4, "w": 8, "x": 0, "y": 0}, + "targets": [ + { + "expr": "up{job=\"voip-nodes\", instance=\"sip-1\"}", + "legendFormat": "sip-1 (OpenSIPS)", + "refId": "A" + }, + { + "expr": "up{job=\"voip-nodes\", instance=\"pbx-1\"}", + "legendFormat": "pbx-1 (Asterisk)", + "refId": "B" + }, + { + "expr": "up{job=\"voip-nodes\", instance=\"media-1\"}", + "legendFormat": "media-1 (RTPEngine)", + "refId": "C" + } + ], + "fieldConfig": { + "defaults": { + "mappings": [ + {"type": "value", "options": {"0": {"text": "DOWN", "color": "red"}, "1": {"text": "UP", "color": "green"}}} + ], + "thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": 0}, {"color": "green", "value": 1}]} + } + }, + "options": {"colorMode": "value", "graphMode": "none", "orientation": "horizontal"}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "VoIP Architecture", + "type": "text", + "gridPos": {"h": 4, "w": 16, "x": 8, "y": 0}, + "options": { + "mode": "markdown", + "content": "## Three-Tier VoIP Architecture\n\n| VM | Role | Component | Ports |\n|---|---|---|---|\n| **sip-1** | SIP Proxy | OpenSIPS | 5060/UDP, 5061/TCP |\n| **pbx-1** | PBX | Asterisk | 5080/UDP, 5038/TCP (AMI), 8088/TCP (ARI) |\n| **media-1** | Media Relay | RTPEngine | 10000-20000/UDP |" + } + }, + { + "title": "CPU Usage by VM", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 0, "y": 4}, + "targets": [ + { + "expr": "100 - (avg by (instance) (irate(node_cpu_seconds_total{job=\"voip-nodes\", mode=\"idle\"}[5m])) * 100)", + "legendFormat": "{{instance}}", + "refId": "A" + } + ], + "fieldConfig": {"defaults": {"unit": "percent", "min": 0, "max": 100}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Memory Usage by VM", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 12, "y": 4}, + "targets": [ + { + "expr": "(1 - (node_memory_MemAvailable_bytes{job=\"voip-nodes\"} / node_memory_MemTotal_bytes{job=\"voip-nodes\"})) * 100", + "legendFormat": "{{instance}}", + "refId": "A" + } + ], + "fieldConfig": {"defaults": {"unit": "percent", "min": 0, "max": 100}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Network RX (Receive)", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 0, "y": 12}, + "targets": [ + { + "expr": "rate(node_network_receive_bytes_total{job=\"voip-nodes\", device!~\"lo|veth.*\"}[5m])", + "legendFormat": "{{instance}} - {{device}}", + "refId": "A" + } + ], + "fieldConfig": {"defaults": {"unit": "Bps"}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Network TX (Transmit)", + "type": "timeseries", + "gridPos": {"h": 8, "w": 12, "x": 12, "y": 12}, + "targets": [ + { + "expr": "rate(node_network_transmit_bytes_total{job=\"voip-nodes\", device!~\"lo|veth.*\"}[5m])", + "legendFormat": "{{instance}} - {{device}}", + "refId": "A" + } + ], + "fieldConfig": {"defaults": {"unit": "Bps"}}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Disk Usage", + "type": "gauge", + "gridPos": {"h": 6, "w": 8, "x": 0, "y": 20}, + "targets": [ + { + "expr": "(1 - (node_filesystem_avail_bytes{job=\"voip-nodes\", mountpoint=\"/\"} / node_filesystem_size_bytes{job=\"voip-nodes\", mountpoint=\"/\"})) * 100", + "legendFormat": "{{instance}}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "percent", + "min": 0, + "max": 100, + "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": 0}, {"color": "yellow", "value": 70}, {"color": "red", "value": 85}]} + } + }, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Load Average (1m)", + "type": "stat", + "gridPos": {"h": 6, "w": 8, "x": 8, "y": 20}, + "targets": [ + { + "expr": "node_load1{job=\"voip-nodes\"}", + "legendFormat": "{{instance}}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": 0}, {"color": "yellow", "value": 2}, {"color": "red", "value": 4}]} + } + }, + "options": {"colorMode": "value", "graphMode": "area"}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + }, + { + "title": "Uptime", + "type": "stat", + "gridPos": {"h": 6, "w": 8, "x": 16, "y": 20}, + "targets": [ + { + "expr": "node_time_seconds{job=\"voip-nodes\"} - node_boot_time_seconds{job=\"voip-nodes\"}", + "legendFormat": "{{instance}}", + "refId": "A" + } + ], + "fieldConfig": {"defaults": {"unit": "s"}}, + "options": {"colorMode": "value", "graphMode": "none"}, + "datasource": {"type": "prometheus", "uid": "Prometheus"} + } + ] +} diff --git a/configs/prometheus/prometheus.yml b/configs/prometheus/prometheus.yml index a072fd3..280ca1f 100644 --- a/configs/prometheus/prometheus.yml +++ b/configs/prometheus/prometheus.yml @@ -98,6 +98,39 @@ scrape_configs: # static_configs: # - targets: ['cadvisor:8080'] + # VoIP Stack - Lima VMs (OpenSIPS, Asterisk, RTPEngine) + - job_name: 'voip-nodes' + static_configs: + - targets: + - '192.168.105.2:9100' # sip-1 (OpenSIPS) + - '192.168.105.6:9100' # pbx-1 (Asterisk) + - '192.168.105.5:9100' # media-1 (RTPEngine) + relabel_configs: + - source_labels: [__address__] + regex: '192.168.105.2:.*' + target_label: instance + replacement: 'sip-1' + - source_labels: [__address__] + regex: '192.168.105.6:.*' + target_label: instance + replacement: 'pbx-1' + - source_labels: [__address__] + regex: '192.168.105.5:.*' + target_label: instance + replacement: 'media-1' + - source_labels: [__address__] + regex: '192.168.105.2:.*' + target_label: role + replacement: 'sip-proxy' + - source_labels: [__address__] + regex: '192.168.105.6:.*' + target_label: role + replacement: 'pbx' + - source_labels: [__address__] + regex: '192.168.105.5:.*' + target_label: role + replacement: 'media' + # Vault metrics (if enabled) - job_name: 'vault' metrics_path: '/v1/sys/metrics'