{"id":34896471,"url":"https://github.com/fajar-dev/onu-scrape","last_synced_at":"2026-05-22T08:06:37.492Z","repository":{"id":318253858,"uuid":"1069787664","full_name":"fajar-dev/onu-scrape","owner":"fajar-dev","description":"Retrieve RX optical power (dBm) data from FTTX ONU devices with Prometheus metrics endpoint.","archived":false,"fork":false,"pushed_at":"2025-10-11T03:12:06.000Z","size":132,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-27T16:26:06.244Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fajar-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-04T16:15:01.000Z","updated_at":"2025-10-11T03:12:10.000Z","dependencies_parsed_at":"2025-10-06T05:40:41.684Z","dependency_job_id":"30df9250-5a92-473b-bbc7-43adc1ea348f","html_url":"https://github.com/fajar-dev/onu-scrape","commit_stats":null,"previous_names":["fajar-dev/onu-scrape"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fajar-dev/onu-scrape","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajar-dev%2Fonu-scrape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajar-dev%2Fonu-scrape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajar-dev%2Fonu-scrape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajar-dev%2Fonu-scrape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fajar-dev","download_url":"https://codeload.github.com/fajar-dev/onu-scrape/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajar-dev%2Fonu-scrape/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33334777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"online","status_checked_at":"2026-05-22T02:00:06.671Z","response_time":265,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-26T07:04:05.630Z","updated_at":"2026-05-22T08:06:37.450Z","avatar_url":"https://github.com/fajar-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ONU Scrape\n\nA simple automation tool to retrieve RX optical power (dBm) data from FTTX ONU devices with Prometheus metrics endpoint.\n\n## 📋 Features\n\n- Automatic optical power data scraping from ONU devices\n- Retrieves RX power values in dBm\n- Support for multiple devices\n- Automated browser-based scraping using Playwright\n- Configurable device credentials and endpoints\n- **Prometheus-compatible metrics endpoint for monitoring**\n\n## 🚀 Installation\n\n### Prerequisites\n- Node.js (v22 or higher)\n- npm or yarn\n- TypeScript\n\n### Steps\n\n```bash\n# Clone repository\ngit clone https://github.com/fajar-dev/onu-scrape.git\ncd onu-scrape\n\n# Install dependencies\nnpm install\n\n# Install browser for Playwright\nnpx playwright install chromium\n\n# Setup environment variables\ncp .env.example .env\n```\n\n## ⚙️ Configuration\n\n### 1. Environment Variables\n\nRename `.env.example` to `.env` and configure your settings:\n\n```env\n# === Ddatabase ===\nDB_HOST=localhost\nDB_PORT=3306\nDB_USER=user\nDB_PASSWORD=password\nDB_DATABASE=database\n```\n\n## 📖 Usage\n\n### Run the Application\n\n```bash\n# Start scraping\nnpm run start\n```\n\n### Expected Output\n\n```\n[2025-10-06 10:30:05] Processing 192.168.1.1\n[2025-10-06 10:30:08] 192.168.1.1 -\u003e -15.17 dBm\n[2025-10-06 10:30:10] Processing 192.168.1.2\n[2025-10-06 10:30:13] 192.168.1.2 -\u003e -15.20 dBm\n```\n\n## 📊 Metrics Endpoint\n\nThe application exposes Prometheus-compatible metrics for monitoring optical power levels.\n\n### Access Metrics\n\n```\nhttp://localhost:3000/cgs-onu/metrics\n```\n\n### Metrics Format\n\n```\n# HELP fttx_rx_power Received optical power (dBm)\n# TYPE fttx_rx_power gauge\nfttx_rx_power{cid=\"WMDNMAN202507226H\", sid=\"63817\"} -15.20\nfttx_rx_power{cid=\"WMDNMAN202507227H\", sid=\"63818\"} -15.23\n```\n\n**Labels:**\n- `cid`: Operator CID or device identifier\n- `sid`: Service ID or port identifier\n\n**Value:** RX optical power in dBm (lower/more negative values indicate weaker signal)\n\n## 🔗 Integration with Monitoring\n\n### Prometheus Configuration\n\nAdd this scrape config to your `prometheus.yml`:\n\n```yaml\nscrape_configs:\n  - job_name: 'fttx-onu'\n    static_configs:\n      - targets: ['localhost:3000']\n    metrics_path: '/cgs-onu/metrics'\n    scrape_interval: 30s\n    scrape_timeout: 10s\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffajar-dev%2Fonu-scrape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffajar-dev%2Fonu-scrape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffajar-dev%2Fonu-scrape/lists"}