{"id":21526801,"url":"https://github.com/mfcodeworks/server-monitoring-script","last_synced_at":"2025-07-28T17:06:44.516Z","repository":{"id":41059251,"uuid":"152038903","full_name":"mfcodeworks/Server-Monitoring-Script","owner":"mfcodeworks","description":"Monitor System Info With Python Script","archived":false,"fork":false,"pushed_at":"2020-01-30T02:40:22.000Z","size":25,"stargazers_count":67,"open_issues_count":1,"forks_count":30,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-24T06:29:19.503Z","etag":null,"topics":["json","monitoring","monitoring-scripts","monitoring-tool","python","python-script","script"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mfcodeworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-08T07:46:05.000Z","updated_at":"2024-09-27T21:12:33.000Z","dependencies_parsed_at":"2022-09-20T22:01:43.018Z","dependency_job_id":null,"html_url":"https://github.com/mfcodeworks/Server-Monitoring-Script","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mfcodeworks/Server-Monitoring-Script","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfcodeworks%2FServer-Monitoring-Script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfcodeworks%2FServer-Monitoring-Script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfcodeworks%2FServer-Monitoring-Script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfcodeworks%2FServer-Monitoring-Script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mfcodeworks","download_url":"https://codeload.github.com/mfcodeworks/Server-Monitoring-Script/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfcodeworks%2FServer-Monitoring-Script/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267552097,"owners_count":24106000,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"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":["json","monitoring","monitoring-scripts","monitoring-tool","python","python-script","script"],"created_at":"2024-11-24T01:46:46.471Z","updated_at":"2025-07-28T17:06:44.451Z","avatar_url":"https://github.com/mfcodeworks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Server Monitoring Script\n\n[![GitHub license](https://img.shields.io/github/license/mfsoftworks/Server-Monitoring-Script.svg)](https://github.com/mfsoftworks/Server-Monitoring-Script/blob/master/LICENSE.md) [![Build Status](https://travis-ci.com/mfsoftworks/Server-Monitoring-Script.svg?branch=master)](https://travis-ci.com/mfsoftworks/Server-Monitoring-Script)\n[![Code Coverage](https://codecov.io/gh/mfsoftworks/Server-Monitoring-Script/branch/master/graphs/badge.svg)](https://codecov.io/gh/mfsoftworks/Server-Monitoring-Script) ![GitHub Size](https://img.shields.io/github/repo-size/mfsoftworks/Server-Monitoring-Script.svg)\n\n## Purpose\n\nThe Python script is designed to be run as a cronjob on every boot to run in the background.\nThe script will gather information:\n\n- UUID (Unique for each system to avoid overlapping hostname for multi-network monitoring)\n- Hostname\n- CPU\n- Memory\n- Network Usage\n- Network Cards\n- Hard Drives\n- System OS\n- System Uptime\n- UTC Timestamp\n\nThe script will produce a JSON output at intervals for use with any software or server accepting a JSON input.\nExample:\n\n```json\n{\n    \"hostname\": \"HOME-LAPTOP1\",\n    \"system\": {\n        \"name\": \"Windows\",\n        \"version\": \"10\"\n    },\n    \"uptime\" : 231199,\n    \"cpu_count\": 4,\n    \"cpu_usage\": 17.9,\n    \"memory_total\": 8440942592,\n    \"memory_used\": 6244225024,\n    \"memory_used_percent\": 74.0,\n    \"drives\": [\n        {\n            \"name\": \"C:\\\\\",\n            \"mount_point\": \"C:\\\\\",\n            \"type\": \"NTFS\",\n            \"total_size\": 536224985088,\n            \"used_size\": 167306108928,\n            \"percent_used\": 31.2\n        },\n        {\n            \"name\": \"D:\\\\\",\n            \"mount_point\": \"D:\\\\\",\n            \"type\": \"NTFS\",\n            \"total_size\": 463332921344,\n            \"used_size\": 49498419200,\n            \"percent_used\": 10.7\n        }\n    ],\n    \"network_up\": 54,\n    \"network_down\": 4150,\n    \"network_cards\": [\n        {\n            \"address\": \"127.0.0.1\",\n            \"address6\": \"::1\",\n            \"mac\": \"\",\n            \"name\": \"Loopback Pseudo-Interface 1\",\n            \"netmask\": \"255.0.0.0\"\n        },\n        {\n            \"address\": \"10.15.62.112\",\n            \"address6\": \"fe80::844d:a87:54ea:2100\",\n            \"mac\": \"1C-39-47-A6-4C-5E\",\n            \"name\": \"Ethernet\",\n            \"netmask\": \"255.255.0.0\"\n        }\n    ],\n    \"timestamp\" : \"2018-10-10T01:41:21+00:00\",\n    \"uuid\" : 180331603484325\n}\n```\n\nThe script includes a function to POST JSON to a remote server.\n\nThis script can be installed on several machines that report to a central monitoring server.\n\nThe destination, checking interval, sending attempts after failure and timeout between resending attempts can be set through arguments, use `python3 monitor.py -h` for more.\n\n## Usage\n\nClone the script with `git clone`.\n\nInstall Python.\n\nIf any library is missing do `pip3 install` *library*.\n\nTo test the script output run with `python3 monitor.py`.\n\n### **Linux Autostart**\n\nCreate a cron job to run the script on every boot.\n\nEdit cron with `crontab -e`.\n\nAdd the script at the bottom of the cron list as `@reboot /usr/bin/python3 /path/to/script/monitor.py \u0026`.\n\n### **Windows Autostart**\n\n`Windows/monitor.bat` and `Windows/monitor.vbs` scripts are included.\n\n`monitor.bat` will call python to launch `monitor.py`.\n\n`monitor.vbs` silently calls `monitor.bat` to run in the background.\n\nTo create an autostart for Windows open start menu and search for `Task Scheduler`.\n\nSelect `Create Task`.\n\nEnter a name e.g. monitor.\n\nAdd new trigger at login.\n\nAdd a new action and select the `Windows/monitor.vbs` script.\n\n**Unselect** Stop task if it runs longer than 3 days.\n\nSelect Okay.\n\nA new task will be created that runs the python monitoring script in the background every time a user starts the system and logs in.\n\n## Author\n\nMF Softworks \u003cmf@nygmarosebeauty.com\u003e\n\nmf.nygmarosebeauty.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfcodeworks%2Fserver-monitoring-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmfcodeworks%2Fserver-monitoring-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfcodeworks%2Fserver-monitoring-script/lists"}