{"id":25131997,"url":"https://github.com/taleblou/servermonitoring_python","last_synced_at":"2025-04-03T00:11:48.613Z","repository":{"id":272635441,"uuid":"917268999","full_name":"taleblou/ServerMonitoring_Python","owner":"taleblou","description":" This Python script monitors a URL's performance, logging metrics like ping time, loading time, response size, status code, and errors into a CSV file every 30 seconds. Ideal for tracking website health and performance over time. Customizable and easy to use.","archived":false,"fork":false,"pushed_at":"2025-01-15T17:13:26.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T14:16:11.863Z","etag":null,"topics":["monitors","python","server"],"latest_commit_sha":null,"homepage":"https://taleblou.ir/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taleblou.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}},"created_at":"2025-01-15T17:10:47.000Z","updated_at":"2025-01-15T17:13:59.000Z","dependencies_parsed_at":"2025-01-15T19:41:43.219Z","dependency_job_id":"12b774c0-1543-4f7c-b9ee-e550bbe7fe19","html_url":"https://github.com/taleblou/ServerMonitoring_Python","commit_stats":null,"previous_names":["taleblou/servermonitoring_python"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taleblou%2FServerMonitoring_Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taleblou%2FServerMonitoring_Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taleblou%2FServerMonitoring_Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taleblou%2FServerMonitoring_Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taleblou","download_url":"https://codeload.github.com/taleblou/ServerMonitoring_Python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246911471,"owners_count":20853657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["monitors","python","server"],"created_at":"2025-02-08T14:16:15.127Z","updated_at":"2025-04-03T00:11:48.593Z","avatar_url":"https://github.com/taleblou.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## **How It Works**\n\n1. The script monitors a URL specified in the `url` variable.  \n   * Default: `https://www.taleblou.ir/`  \n2. It runs in an infinite loop, collecting data every 30 seconds.  \n3. The collected metrics include:  \n   * **Date and Time**: Timestamp of the data collection.  \n   * **Ping Time**: Time taken to ping the server in milliseconds.  \n   * **Loading Time**: Time taken to load the webpage in seconds.  \n   * **Response Size**: The content length of the HTTP response in bytes.  \n   * **Status Code**: The HTTP status code returned by the server.  \n   * **Error Message**: Details of any error encountered during the request.  \n4. The data is appended to a CSV file named `url_reports.csv`.  \n   * If the file doesn't exist, headers are added automatically.\n\n## **Usage**\n\n1. Clone the repository or copy the script into your project directory.  \n2. Modify the `url` variable to the URL you want to monitor.  \n3. Run the script:  \n   bash  \n   Copy code  \n   `python main.py`  \n     \n4. The script will create (or update) a CSV file named `url_reports.csv` with the collected data.\n\n## **CSV Format**\n\nThe generated CSV file contains the following columns:\n\n* `Date`: Timestamp of the monitoring event.  \n* `Ping Time (ms)`: Ping response time in milliseconds.  \n* `Loading Time (s)`: Time taken to load the page in seconds.  \n* `Response Size (bytes)`: Size of the HTTP response in bytes.  \n* `Status Code`: HTTP status code returned by the server.  \n* `Error Message`: Error details, if any.\n\n## **Customization**\n\n* **Change Monitoring Interval**: Update the `time.sleep(30)` line to modify the check frequency.  \n* **Specify a Different Output File**: Change the `csv_file` variable to use a different filename.\n\n## **Notes**\n\n* The script will continue running until manually stopped.  \n* Ensure you have proper permissions to write to the directory where the CSV file is stored.  \n* The script handles missing ping times and response sizes by logging `NaN` values.\n\n## **License**\n\nThis project is licensed under the MIT License. Feel free to use and modify it as needed.\n\ncss \n\n``Feel free to adjust the `README.md` according to any specific details or extra context you'd like to include!``\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaleblou%2Fservermonitoring_python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaleblou%2Fservermonitoring_python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaleblou%2Fservermonitoring_python/lists"}