{"id":28915859,"url":"https://github.com/nodesniff/nodesniff-linux-agent","last_synced_at":"2026-04-21T16:36:26.723Z","repository":{"id":299782232,"uuid":"1004141233","full_name":"nodesniff/nodesniff-linux-agent","owner":"nodesniff","description":"NodeSniff agent for collecting system metrics on Linux servers.","archived":false,"fork":false,"pushed_at":"2026-03-21T15:35:13.000Z","size":76,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-22T05:54:49.790Z","etag":null,"topics":["agent","fasapi","linux","linux-agent","linux-app","metrics","metrics-collector","monitoring","nodesniff","python","servers","system-monitoring"],"latest_commit_sha":null,"homepage":"https://www.nodesniff.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nodesniff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-06-18T07:16:52.000Z","updated_at":"2026-03-21T15:28:02.000Z","dependencies_parsed_at":"2025-10-08T18:21:50.814Z","dependency_job_id":null,"html_url":"https://github.com/nodesniff/nodesniff-linux-agent","commit_stats":null,"previous_names":["nodesniff/nodesniff-linux-agent"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/nodesniff/nodesniff-linux-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesniff%2Fnodesniff-linux-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesniff%2Fnodesniff-linux-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesniff%2Fnodesniff-linux-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesniff%2Fnodesniff-linux-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodesniff","download_url":"https://codeload.github.com/nodesniff/nodesniff-linux-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesniff%2Fnodesniff-linux-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32100538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["agent","fasapi","linux","linux-agent","linux-app","metrics","metrics-collector","monitoring","nodesniff","python","servers","system-monitoring"],"created_at":"2025-06-21T23:06:27.237Z","updated_at":"2026-04-21T16:36:26.716Z","avatar_url":"https://github.com/nodesniff.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NodeSniff Agent\n\nNodeSniff Agent is a lightweight server metrics collector for the NodeSniff monitoring system.  \nThe agent collects and securely sends metrics to your NodeSniff backend over HTTPS.\n\n**License:** GNU GPL v3 (non-commercial use only)\n\n---\n\n## Features\n\n- Collects CPU, RAM, disk, network, and OS metrics (extensible via Python plugins)\n- Secure HTTPS metric transmission with HMAC authentication\n- CLI modes for install, remove, cleanup\n- Systemd integration with `/usr/bin/nsagent` symlink\n- Recommended setup as dedicated unprivileged `nodesniff` user\n\n---\n\n## Requirements\n\n- Python 3.7+\n- Linux (x86, ARM, etc.)\n- Python packages:\n  - `psutil`\n  - `PyYAML`\n  - `requests`\n  - `setuptools` (required for some plugin systems)\n\nInstall dependencies:\n```sh\npip install -r requirements.txt\n```\n\n---\n\n## Installation and Registration (as dedicated user)\n\n### 1. Create dedicated system user\n\n```bash\nsudo useradd --system --no-create-home --shell /usr/sbin/nologin nodesniff\n```\n\n### 2. Register the agent (as root)\n\n```bash\nsudo ./nsagent.py\n```\n\nIf Python or packages are missing:\n```bash\nsudo apt install python3-pip\nsudo pip3 install -r requirements.txt\n# or, for Raspberry Pi and similar:\nsudo pip3 install --break-system-packages PyYAML\n```\n\nPaste your company key into:\n```bash\nsudo nano /etc/nodesniff/nsagent.token\n```\n\nRun agent again:\n```bash\nsudo ./nsagent.py\n```\n\n---\n\n### 3. Set ownership for runtime directories\n\n```bash\n# Create log directory\nsudo mkdir -p /var/log/nodesniff\n\n# Ensure agent user owns all runtime paths\nsudo chown -R nodesniff:nodesniff /etc/nodesniff\nsudo chown -R nodesniff:nodesniff /usr/lib/nodesniff\nsudo chown -R nodesniff:nodesniff /var/log/nodesniff\n\n# Secure permissions\nsudo chmod 750 /var/log/nodesniff\n\n# Ensure log file is writable by agent\nsudo touch /var/log/nodesniff/nsagent.log\nsudo chown nodesniff:nodesniff /var/log/nodesniff/nsagent.log\nsudo chmod 640 /var/log/nodesniff/nsagent.log\n```\n\n### 4. Install and enable the systemd service\n```bash\nsudo ./nsagent.py --service\nsudo systemctl daemon-reload\nsudo systemctl restart nodesniff-agent\nsudo systemctl enable nodesniff-agent\n```\nAgent will now run as `nodesniff` user.\n\n---\n\n### 5. Confirm it's working\n\n```bash\nps aux | grep nsagent\nsystemctl status nodesniff-agent\n```\n\nYou should see:\n```\nUser=nodesniff\nActive: active (running)\n```\n\n---\n\n## CLI Modes\n\n- `sudo ./nsagent.py`  \n  One-time run (registers if needed, then loops)\n\n- `sudo ./nsagent.py --service`  \n  Installs systemd service (requires registration)\n\n- `sudo ./nsagent.py --clean`  \n  Uninstalls: removes configs, service, logs, symlink\n\n---\n\n## Re-registration (after dashboard deletion)\n\n```bash\nsudo ./nsagent.py\n# Paste company key again if prompted\nsudo ./nsagent.py --service\n```\n\n---\n\n## Updating the Agent\n\n```bash\nsudo ./nsagent.py --clean\n# Copy updated nsagent.py\nsudo ./nsagent.py\nsudo ./nsagent.py --service\n```\n\n---\n\n## Uninstall\n\n```bash\nsudo ./nsagent.py --clean\n```\n\n---\n\n## Troubleshooting\n\n### Permission denied: `/var/log/nodesniff/nsagent.log`\n\nCreate and fix permissions manually:\n```bash\nsudo mkdir -p /var/log/nodesniff\nsudo touch /var/log/nodesniff/nsagent.log\nsudo chown nodesniff:nodesniff /var/log/nodesniff /var/log/nodesniff/nsagent.log\nsudo chmod 750 /var/log/nodesniff\nsudo chmod 640 /var/log/nodesniff/nsagent.log\nsudo systemctl restart nodesniff-agent\n```\n\n---\n\n### Agent not starting (`exit-code 1`)\n\nCheck logs:\n```bash\njournalctl -u nodesniff-agent -n 50 --no-pager\n```\n\nCommon causes:\n- Missing or placeholder token file `/etc/nodesniff/nsagent.token`\n- Wrong permissions on `/etc/nodesniff` or `/var/log/nodesniff`\n- Outdated Python version\n- Backend or database unavailable\n\n---\n\n### Check which user the agent runs as\n\n```bash\nsystemctl show -p User nodesniff-agent.service\n```\n\nExpected:\n```\nUser=nodesniff\n```\n\n---\n\n### Manual test run\n\n```bash\nsudo -u nodesniff python3 /usr/lib/nodesniff/nsagent.py --daemon\n```\n\n---\n\n## License\n\nGPL v3 — **non-commercial use only**.  \nFor commercial use or support, contact us: [info@nodesniff.com](mailto:info@nodesniff.com)\n\n---\n\n## Contact\n\n📧 info@nodesniff.com  \n🌐 https://www.nodesniff.com\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodesniff%2Fnodesniff-linux-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodesniff%2Fnodesniff-linux-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodesniff%2Fnodesniff-linux-agent/lists"}