Parmi Notes Random short any article

Alloy-Grafana REMOVE service

Karena Kaspersky memblokir instalasi, Anda perlu menghapus service Alloy yang mungkin sudah terinstall sebagian. Berikut cara menghapusnya:

1. HAPUS SERVICE ALLOY DARI CMD/POWERSHELL:

Metode 1: Menggunakan SC (Service Control)

@echo off
echo Removing Alloy service...
echo.

REM Stop and delete Alloy service
sc stop "Alloy" 2>nul
timeout /t 3 /nobreak > nul
sc delete "Alloy" 2>nul

REM Also check for Grafana Agent service
sc stop "Grafana Agent" 2>nul
timeout /t 2 /nobreak > nul
sc delete "Grafana Agent" 2>nul

echo Service removal attempted.
echo.
pause

Metode 2: Menggunakan PowerShell (Run as Administrator)

# Stop and remove Alloy service
Stop-Service -Name "Alloy" -ErrorAction SilentlyContinue -Force
Get-Service -Name "Alloy" -ErrorAction SilentlyContinue | Remove-Service -Verbose

# Also remove Grafana Agent if exists
Stop-Service -Name "Grafana Agent" -ErrorAction SilentlyContinue -Force
Get-Service -Name "Grafana Agent" -ErrorAction SilentlyContinue | Remove-Service -Verbose

# Check for Windows Exporter service
Stop-Service -Name "windows_exporter" -ErrorAction SilentlyContinue -Force
Get-Service -Name "windows_exporter" -ErrorAction SilentlyContinue | Remove-Service -Verbose

Write-Host "Services removed successfully" -ForegroundColor Green

2. HAPUS FILE DAN FOLDER MANUAL:

Script Cleanup Lengkap:

@echo off
echo ================================================
echo  ALLOY MONITORING AGENT REMOVAL TOOL
echo ================================================
echo.
echo Run as Administrator for complete cleanup
echo.

REM Stop services first
echo [1/5] Stopping services...
sc stop "Alloy" >nul 2>&1
sc stop "Grafana Agent" >nul 2>&1
sc stop "windows_exporter" >nul 2>&1
timeout /t 5 /nobreak > nul

REM Delete services
echo [2/5] Removing services...
sc delete "Alloy" >nul 2>&1
sc delete "Grafana Agent" >nul 2>&1
sc delete "windows_exporter" >nul 2>&1

REM Remove program files
echo [3/5] Removing program files...
rmdir /s /q "C:\Program Files\Alloy" 2>nul
rmdir /s /q "C:\Program Files\Grafana Agent" 2>nul
rmdir /s /q "C:\ProgramData\Alloy" 2>nul
rmdir /s /q "C:\ProgramData\Grafana Agent" 2>nul

REM Remove startup entries
echo [4/5] Cleaning registry...
reg delete "HKLM\SYSTEM\CurrentControlSet\Services\Alloy" /f 2>nul
reg delete "HKLM\SYSTEM\CurrentControlSet\Services\Grafana Agent" /f 2>nul
reg delete "HKLM\SYSTEM\CurrentControlSet\Services\windows_exporter" /f 2>nul

REM Remove from PATH if exists
reg delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "Path" /f 2>nul

REM Clean TEMP files
echo [5/5] Cleaning temporary files...
del /q "%TEMP%\install-windows.ps1" 2>nul
del /q "%TEMP%\alloy*.exe" 2>nul
del /q "%TEMP%\grafana-agent*.exe" 2>nul
del /q "%TEMP%\windows_exporter*.exe" 2>nul

echo.
echo ================================================
echo  CLEANUP COMPLETED
echo ================================================
echo.
echo Please reboot your computer to complete removal.
echo.
pause

3. METODE MANUAL DENGAN GUI:

A. Melalui Services.msc:

  1. Buka Run (Win + R)
  2. Ketik: services.msc
  3. Cari service Alloy atau Grafana Agent
  4. Klik kanan → Stop (jika berjalan)
  5. Klik kanan → Properties
  6. Catat Path to executable
  7. Buka CMD sebagai Administrator
  8. Jalankan: sc delete "Alloy"

B. Melalui Task Manager:

  1. Buka Task Manager (Ctrl + Shift + Esc)
  2. Ke tab Services
  3. Cari Alloy
  4. Klik kanan → Stop Service
  5. Klik kanan → Open Services
  6. Hapus dari Services window

4. VERIFIKASI PENGHAPUSAN:

Script Verifikasi:

# Run this in PowerShell to verify removal
Write-Host "Checking for remaining services..." -ForegroundColor Yellow

$services = @("Alloy", "Grafana Agent", "windows_exporter")
foreach ($service in $services) {
    $svc = Get-Service -Name $service -ErrorAction SilentlyContinue
    if ($svc) {
        Write-Host "❌ Service $service still exists" -ForegroundColor Red
        Write-Host "   Status: $($svc.Status)" -ForegroundColor Yellow
        Write-Host "   To remove: sc delete `"$service`"" -ForegroundColor Gray
    } else {
        Write-Host "✅ Service $service not found" -ForegroundColor Green
    }
}

Write-Host "`nChecking for program files..." -ForegroundColor Yellow
$paths = @(
    "C:\Program Files\Alloy",
    "C:\Program Files\Grafana Agent",
    "C:\ProgramData\Alloy",
    "C:\ProgramData\Grafana Agent"
)

foreach ($path in $paths) {
    if (Test-Path $path) {
        Write-Host "❌ Folder exists: $path" -ForegroundColor Red
    } else {
        Write-Host "✅ Folder removed: $path" -ForegroundColor Green
    }
}

5. PENTING: KASPERSKY EXCLUSION (Jika Ingin Install Kembali):

Jika nanti ingin menginstal ulang, tambahkan exclusion di Kaspersky:

Untuk Kaspersky:

  1. Buka Kaspersky
  2. Pilih Settings ⚙️
  3. AdditionalThreats and Exclusions
  4. Manage ExclusionsAdd
  5. Tambahkan exclusion untuk: C:\Program Files\Alloy\** C:\Program Files\Grafana Agent\** C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
  6. Trusted applicationsAdd:
    • alloy.exe
    • grafana-agent.exe
    • windows_exporter.exe

Atau nonaktifkan sementara:

# Hanya jika benar-benar diperlukan, nonaktifkan sementara
# (Risiko keamanan - lakukan dengan hati-hati)
net stop "Kaspersky Anti-Virus Service" 2>nul
timeout /t 10
# Jalankan instalasi di sini
net start "Kaspersky Anti-Virus Service" 2>nul

6. ALTERNATIF INSTALASI AMAN DENGAN KASPERSKY:

Jika tetap ingin monitoring, gunakan tools yang lebih diterima:

A. Windows Built-in Monitoring:

# Gunakan Performance Monitor bawaan Windows
perfmon.exe

B. NetData Community Edition:

# Install dengan Chocolatey (lebih aman)
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco install netdata-agent -y

Rekomendasi: Jalankan script removal pertama (Metode 1) sebagai Administrator, lalu reboot komputer untuk pembersihan sempurna.