Suche Programm für Systray, das online/offline eines PCs im LAN anzeigt

romeon

Vice Admiral
Registriert
Feb. 2005
Beiträge
6.533
Hi,

ich suche ein Tool, was sich per Windows Autostart in die Systray legt und zB mit einem roten oder grünen Punkt den offline oder online Zustand eines PCs im Netzwerk anzeigt. Im Prinzip was ganz Kleines und Simples, was halt alle halbe Minute eine lokale IP anpingt und den Zustand zeigt.

Habt ihr sowas schon mal irgendwo gesehen? :)

Thx!
 
Ist doch schon eingebaut. Wenn das Netzwerksymbol in der Taskleiste zum Globus wird bist du offline, da Windows "msftconnecttest.com" nicht erreicht.
 
  • Gefällt mir
Reaktionen: conf_t und Engaged
Eine kurze Suche hat z.B. sowas gezeigt.
Ergänzung ()

Ja_Ge schrieb:
Ist doch schon eingebaut. Wenn das Netzwerksymbol in der Taskleiste zum Globus wird bist du offline, da Windows "msftconnecttest.com" nicht erreicht.
Eines PCs, nicht seines PCs ;-)
 
  • Gefällt mir
Reaktionen: SpiII, derlorenz, Tornhoof und 5 andere
Mit dem berühmten vibe Coding in wenigen Minuten selbst gebaut.
 
Passt nicht zu 100% aber wenn Du mehrere PCs überwachen willst ist PingInfoView ein gutes Tool. Wenn es etwas professioneller werden soll ist Uptime-Kuma einen Blick wert läuft z.B. auch gut auf einem alten Raspberry etc. :cool_alt:
 
empower schrieb:
@aluis super sinnlose antwort
Warum? Jeder würde in Linux diese Lösung wählen. Aber in Windows muss es immer irgend ein schlechtes proprietäres Programm sein?
 
  • Gefällt mir
Reaktionen: JumpingCat
JumpingCat schrieb:
Gute Idee. Gib mir 5min :-)
Dann aber gleich richtig, mit Alarmierung, wenn einer offline geht. Oder geht es um Überwachung, dann mit Alarmierung wenn online ;) .
 
Zuletzt bearbeitet:
@Ja_Ge Das war überhaupt nicht die Anforderung. Hier nochmal für dich zusammgefasst:

Systray roten oder grünen Punkt
 
  • Gefällt mir
Reaktionen: JumpingCat
@aluis Tolle Zusammenfassung, fehlt nur leider die Hälfte :D
 
  • Gefällt mir
Reaktionen: Ja_Ge
aluis schrieb:
Das war überhaupt nicht die Anforderung.
Ich dachte das Smiley im Post auf dem ich geantwortet habe reicht zur Einstufung der Ernsthaftigkeit, aber für dich habe ich an mein Post noch eins drangehängt.
 
Ich habe gerade mal ChatGPT gefragt und sofort ein PowerShell script MIT TRAYICON und eine Möglichkeit mit C# bekommen.

Leute, kommt bitte im Jahr 2026 an!
 
  • Gefällt mir
Reaktionen: JumpingCat
Ausgabe von Gemini, getestet und funktioniert.
  • Das Systray Icon ist erstmal im Dropdown versteckt, das muss eingeblendet werden.
  • Skript könnte man in den Autostart packen.

PowerShell:
# --- Ensure script runs in STA Mode for Windows Forms ---
if ([threading.thread]::CurrentThread.GetApartmentState() -ne 'STA') {
    Start-Process powershell -ArgumentList "-TaskReq", "-NoExit", "-ExecutionPolicy Bypass", "-File `"$PSCommandPath`"" -WindowStyle Hidden
    return
}

Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing

# --- Configuration ---
$Address = "192.168.0.161" # Change to your target IP/Host
$Interval = 5        # Seconds between checks

# --- Initialize Components ---
$Form = New-Object System.Windows.Forms.Form
$NotifyIcon = New-Object System.Windows.Forms.NotifyIcon
$ContextMenu = New-Object System.Windows.Forms.ContextMenu
$ExitItem = New-Object System.Windows.Forms.MenuItem("Exit")

$NotifyIcon.Text = "Ping Monitor: $Address"
$NotifyIcon.Visible = $true
$NotifyIcon.ContextMenu = $ContextMenu
$ContextMenu.MenuItems.Add($ExitItem) | Out-Null

# Exit logic
$Global:Running = $true
$ExitItem.Add_Click({
    $Global:Running = $false
    [System.Windows.Forms.Application]::Exit()
})

# Helper to create colored icons on the fly
function Set-TrayColor ([System.Drawing.Color]$Color) {
    $Bitmap = New-Object System.Drawing.Bitmap 16, 16
    $Graphics = [System.Drawing.Graphics]::FromImage($Bitmap)
    $Brush = New-Object System.Drawing.SolidBrush($Color)
    $Graphics.FillEllipse($Brush, 0, 0, 15, 15)
    $NotifyIcon.Icon = [System.Drawing.Icon]::FromHandle($Bitmap.GetHicon())
   
    # Cleanup GDI objects
    $Brush.Dispose()
    $Graphics.Dispose()
    $Bitmap.Dispose()
}

# --- Main Logic ---
try {
    Write-Host "Monitoring $Address... Press Ctrl+C or use Tray Menu to exit."
   
    while ($Global:Running) {
        # Perform Ping
        $Online = Test-Connection -ComputerName $Address -Count 1 -Quiet
       
        if ($Online) {
            Set-TrayColor "Green"
        } else {
            Set-TrayColor "Red"
        }

        # Handle UI events & Sleep loop
        $Timer = [System.Diagnostics.Stopwatch]::StartNew()
        while ($Timer.Elapsed.TotalSeconds -lt $Interval -and $Global:Running) {
            [System.Windows.Forms.Application]::DoEvents()
            Start-Sleep -Milliseconds 100
        }
    }
}
finally {
    # Cleanup to prevent "ghost" icons in the tray
    $NotifyIcon.Visible = $false
    $NotifyIcon.Dispose()
    Write-Host "Cleanup complete."
}
 
Zuletzt bearbeitet:
  • Gefällt mir
Reaktionen: aluis
Python:
import time
import subprocess
import threading
from PIL import Image, ImageDraw
from pystray import Icon, Menu, MenuItem

# --- KONFIGURATION ---
TARGET_IP = "IP-Hier eintragen"
CHECK_INTERVAL = 10      
running = True  # Flag für den sauberen Stopp

def check_online(ip):
    CREATE_NO_WINDOW = 0x08000000
    res = subprocess.call(
        ['ping', '-n', '2', '-w', '2000', ip],
        stdout=subprocess.DEVNULL,
        stderr=subprocess.STDOUT,
        creationflags=CREATE_NO_WINDOW
    )
    return res == 0

def create_image(color):
    image = Image.new('RGBA', (64, 64), (0, 0, 0, 0))
    dc = ImageDraw.Draw(image)
    padding = 4
    dc.ellipse([padding, padding, 64 - padding, 64 - padding], fill=color)
    return image

def update_loop(icon):
    global running
    while running:
        is_online = check_online(TARGET_IP)
        if not running: break  # Falls während des Pings beendet wurde
       
        status_text = f"{TARGET_IP}: {'Online' if is_online else 'Offline'}"
        new_color = "green" if is_online else "red"
       
        icon.icon = create_image(new_color)
        icon.title = status_text
       
        # Schlafen in kleinen Häppchen, damit das Programm sofort reagiert
        for _ in range(CHECK_INTERVAL):
            if not running: break
            time.sleep(1)

def on_quit(icon, item):
    global running
    running = False  # Stoppt den Loop
    icon.stop()      # Schließt das Tray-Icon

# Setup
icon = Icon("NetworkChecker", create_image("gray"), title="Prüfe Status...")
icon.menu = Menu(MenuItem("Beenden", on_quit))

thread = threading.Thread(target=update_loop, args=(icon,), daemon=True)
thread.start()

icon.run()
netmon.jpg
 
Zurück
Oben