Skip to content
LopeKinz edited this page Jul 6, 2023 · 1 revision

gsi.py

This module provides a function to retrieve system information and send it to a webhook.

Dependencies

  • platform
  • socket
  • json
  • re
  • uuid
  • ctypes
  • requests

Usage

import gsi

# Get system information and send it to the webhook
gsi.get_system_info()

Functions

get_system_info()

def get_system_info():

This function retrieves various system information such as platform, architecture, hostname, IP address, MAC address, processor, and RAM. It uses the following steps:

  1. Initializes a MEMORYSTATUSEX structure using ctypes.Structure to store memory information.
  2. Retrieves total RAM using ctypes.windll.kernel32.GlobalMemoryStatusEx.
  3. Collects system information and stores it in the info dictionary.
  4. Converts the info dictionary to JSON format with indentation.
  5. Sends a POST request to the specified webhook URL with the JSON data as the content.

Note: Ensure that the webhook variable is properly set to the desired webhook URL before calling this function.

Example

import gsi

# Set the webhook URL
gsi.webhook = 'https://your-webhook-url'

# Get system information and send it to the webhook
gsi.get_system_info()
Clone this wiki locally