This project is a FastAPI-based application that connects to a Windows Server using SSH and retrieves various health metrics such as CPU usage, memory usage, disk usage, and network usage. The results are then sent to Telex.
- Connects to a Windows Server using SSH
- Retrieves CPU usage, memory usage, disk usage, and network usage
- Sends the results to a specified channel on Telex
- Asynchronous processing using FastAPI and BackgroundTasks
- Python 3.8+
- FastAPI
- Paramiko
- HTTPX
- Pytest (for testing)
- Create a Telex account
- Create an organization
- Create a channel
- Note channel ID
-
Clone the repository:
git clone https://github.com/yourusername/Windows_Server_Health_Checker.git cd Windows_Server_Health_Checker -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Run the FastAPI application:
uvicorn main:app --reload
-
Add /integration to your integrations on Telex:
NB: /integration should return a json as seen below
{ "date": { "created_at": "2025-02-18", "updated_at": "2025-02-18" }, "descriptions": { "app_name": "Windows Server Health Checker", "app_description": "Monitor the performance of a Windows Server", "app_logo": "https://i.imgur.com/bRoRB1Y.png", "app_url": "base_url", "background_color": "#fff" }, "is_active": false, "integration_type": "interval", "key_features": [ "- Monitor the performance of a Windows Server", "- NB: This integration is only for Windows Servers" "- NB: Ensure that SSH is enabled on the Windows Server" ], "integration_category": "Monitoring & Logging", "author": "Chidubem Nwabuisi", "website": "base_url", "settings": [ { "label": "Server_IP", "type": "text", "required": true, "default": "", }, { "label": "username", "type": "text", "required": true, "default": "", }, { "label": "password", "type": "text", "required": true, "default": "", }, { "label": "interval", "type": "text", "required": true, "default": "* * * * *", } ], "tick_url": "<host_base_url>/api/v1/health", } -
Send a POST request to the
/api/v1/healthendpoint to test integration to call to Telex:You can use tools like
curl,Postman, or any HTTP client to send a POST request to the/healthendpoint with the required payload.Example payload:
{ "channel_id": "telex_channel_id", "return_url": "https://ping.telex.im/v1/return/<telex-channel-id>", "settings": [ { "label": "server_ip", "type": "string", "required": true, "default": "127.0.0.1" }, { "label": "username", "type": "string", "required": true, "default": "your_username" }, { "label": "password", "type": "string", "required": true, "default": "your_password" }, { "label": "interval", "type": "text", "required": true, "default": "* * * * *" } ] }On Telex you should expect the following response upon successful connection to the server

If there are problems while connecting to the server, you will get notified on Telex as seen below

- Ensure SSH is installed on the windows server. Follow guide here
- Ensure Windows Server is on the same network with you.
- Alternatively you can setup a windows server on any Virtualbox or VMware then test locally.
- Ensure user has administrative privileges.
- Deployement was done to render.com for HTTPs communication
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.
