feat: init projet supervision — monitoring systeme Windows
Interface web Flask securisee pour surveiller CPU, RAM, disques et processus (JVM, Nginx, Amadea Web 8 x64). Alertes email SMTP configurables, seuils reglables, compilation PyInstaller en .exe, installation service Windows via NSSM. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
41
install_service.bat
Normal file
41
install_service.bat
Normal file
@@ -0,0 +1,41 @@
|
||||
@echo off
|
||||
title Installation Service Windows
|
||||
echo ==========================================
|
||||
echo Installation de Supervision en service
|
||||
echo ==========================================
|
||||
echo.
|
||||
echo PRE-REQUIS: NSSM (https://nssm.cc/) doit etre dans le PATH
|
||||
echo.
|
||||
|
||||
REM Verifier les droits admin
|
||||
net session >nul 2>&1
|
||||
if errorlevel 1 (
|
||||
echo [ERREUR] Ce script doit etre execute en tant qu'administrateur.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
set SERVICE_NAME=Supervision
|
||||
set /p INSTALL_PATH="Chemin du dossier supervision (ex: C:\supervision): "
|
||||
|
||||
echo.
|
||||
echo [INFO] Installation du service '%SERVICE_NAME%'...
|
||||
nssm install %SERVICE_NAME% "%INSTALL_PATH%\supervision.exe"
|
||||
nssm set %SERVICE_NAME% AppDirectory "%INSTALL_PATH%"
|
||||
nssm set %SERVICE_NAME% Description "Monitoring systeme - Supervision"
|
||||
nssm set %SERVICE_NAME% Start SERVICE_AUTO_START
|
||||
nssm set %SERVICE_NAME% AppStdout "%INSTALL_PATH%\logs\stdout.log"
|
||||
nssm set %SERVICE_NAME% AppStderr "%INSTALL_PATH%\logs\stderr.log"
|
||||
nssm set %SERVICE_NAME% AppRotateFiles 1
|
||||
nssm set %SERVICE_NAME% AppRotateBytes 5000000
|
||||
|
||||
mkdir "%INSTALL_PATH%\logs" 2>nul
|
||||
|
||||
echo.
|
||||
echo [OK] Service installe. Demarrage...
|
||||
nssm start %SERVICE_NAME%
|
||||
|
||||
echo.
|
||||
echo [INFO] Le service demarre automatiquement avec Windows.
|
||||
echo [INFO] Gestion: nssm start/stop/restart %SERVICE_NAME%
|
||||
pause
|
||||
Reference in New Issue
Block a user