YuriPavlivsky

Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
Цитата: 1. Как настроить установку (обновление пакетов агента) на компьютеры с учетом разрядности операционок. | У меня отлично работает вот такой скрипт. Option Explicit On Error Resume Next Dim AgentCurrentVersion, AgentInstalledVersion, AgentInstallArguments, AgentUpdateArguments, AgentSetupFile, Arch Dim WshShell, OSType, InstallCommand, UpdateCommand, InstalledKey ' ' Устанавливаем текущую версию агента, параметры обновления, размещение установочного файла ' AgentCurrentVersion = "2.3.5" AgentUpdateArguments = "/execmode=none" ' Определяем количество памяти, Мб Dim objWMIService, colItems, Item, SystemMemory, ReqMemory Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_Computersystem") For Each Item In colItems SystemMemory = Round(Item.TotalPhysicalMemory/1048576) Next ' Если памяти меньше ReqMemory, ставим как задачу в планировщике иначе ставим как службу ReqMemory = 900 If (SystemMemory < ReqMemory) Then AgentInstallArguments = "/S /acceptlicense /delaytime=15 /execmode=Task /task-frequency=Daily /task-daily-modifier=1 /installtasks=Default /server=""http://glpi.ms.epfr.ru/plugins/fusioninventory/"" /no-start-menu /runnow" Else AgentInstallArguments = "/S /acceptlicense /delaytime=15 /execmode=Service /add-firewall-exception /httpd-trust=""127.0.0.1/32,10.75.0.0/16"" /installtasks=Default /server=""http://192.168.0.1/plugins/fusioninventory/"" /no-start-menu /runnow" end If ' Main Set WshShell = Wscript.CreateObject("Wscript.shell") ' Get OS Type, 32 or 64 bit OsType = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE") If (OsType = "x86") Then Arch = "x86" 'InstalledKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent\DisplayVersion" Else Arch = "x64" 'InstalledKey = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent\DisplayVersion" end If InstalledKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent\DisplayVersion" AgentSetupFile = "\\192.168.0.1\fiagent\fusioninventory-agent_windows-" & Arch & "_" & AgentCurrentVersion & ".exe" InstallCommand = AgentSetupFile & " " & AgentInstallArguments UpdateCommand = InstallCommand & " " & AgentUpdateArguments ' Install FusionInventory if not yet installed ' Update FusionInventory if available version is different from installed one AgentInstalledVersion = WshShell.RegRead(InstalledKey) if AgentInstalledVersion = "" then 'Wscript.Echo "FusionInventory not installed, installing version " & AgentCurrentVersion 'Wscript.Echo "Running command: " & InstallCommand WshShell.Run "CMD.EXE /C """ & InstallCommand & """",0,True elseif AgentInstalledVersion <> AgentCurrentVersion then 'Wscript.Echo "Installed version: " & AgentInstalledVersion & " - New version available: " & AgentCurrentVersion 'Wscript.Echo "Running command: " & UpdateCommand WshShell.Run "CMD.EXE /C """ & UpdateCommand & """",0,True else 'Wscript.Echo "Current version " & AgentInstalledVersion & " is up to date" WScript.Quit end if Добавлено: Цитата: Уважаемые, кто то подскажет как настроить оповещение о изменении конфигурации компьютера, связка GLPI 0.84.6 + OCS 2.1.1 Спасибо | Этот функционал обещали в финальной версии 0.85 |