SlavikT

Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору evlad2 Ссылки даны только потому, что это база знаний по Вашей проблеме - не все проблемы можно решить в форуме, примеры можно брать из того же скрипт-центра, а можно писать самому используя вторую ссылку, а можно в том же MOM найти аналогичный скрипт или связку alert\event. Возможно Вам поможет этот скрипт MOM alerts via a response script (http://www.momresources.org/momscripts/MPBackups.txt): '=============================================================================== ' ' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 4.0 ' ' COMMENT: Script for backing up top level MOM Mgmt Packs ' Script creates subfolder with date/time name to store backup ' ' CONSTANTS - Must be assigned values for your environment or script will fail ' MOM_MGMT_SERVER - name of your MOM mgmt server (in quotes) ' MOM_SQL_SERVER - name of your MOM (Onepoint) db server (in quotes) ' BACKUP_DIRECTORY - name of target directory to store backups ' BKUP_RET_PERIOD - Number of days to keep MP backups on disk ' '=============================================================================== '********************************************************************* 'Assign values to required constants - REQUIRED BEFORE RUNNING SCRIPT '********************************************************************* 'Set the MOM Management Server Name Const MOM_MGMT_SERVER = "YOURMOMMSSERVER" 'Set the MOM SQL Server Name Const MOM_SQL_SERVER = "YOURMOMSQLSERVER" 'Set the Backup Directory - MUST END WITH "\" Const BACKUP_DIRECTORY = "D:\MgmtPack_Backups\" 'Set the Backup Retention Period (in days) 'Backup folders older than this date will be deleted Const BKUP_RET_PERIOD = 14 '*********END OF CONSTANT ASSIGNMENT************* '***************************************************************** 'Retrieve list of top-level rule groups from Onepoint '***************************************************************** 'Make DB Connection - Uses Windows Authentication for SQL connection Set DataConn = CreateObject("ADODB.Connection") 'Echo SQL conn string syntax (testing only) 'ConnString = "Provider=SQLOLEDB; Data Source=" & MOM_SQL_SERVER & "; Initial Catalog=OnePoint; Integrated Security=SSPI" 'WScript.Echo ConnString DataConn.Open "Provider=SQLOLEDB; Data Source=" & MOM_SQL_SERVER & "; Initial Catalog=OnePoint; Integrated Security=SSPI" 'Query the OnePoint DB for Management Pack Top Level Rule Groups SQLQuery = "SELECT idProcessRule AS ManagementPackID,[Name] AS ManagementPackName " & _ "FROM ProcessRule WHERE IsRuleGroup = 1 AND (idProcessRule NOT IN " & _ "( SELECT idProcessRuleMember FROM ProcessRuleMembership )) " & _ "ORDER BY Name" Set ManagementPacks = DataConn.Execute(SQLQuery) Set wshShell = WScript.CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") '--Get Backup directory sub folder name 'Replace spaces with underscores strFolderName = Replace(Now(), chr(32), chr(95)) '******************************************** 'Create subdirectory for this backup instance '******************************************** 'Replace colons with dashes strFolderName = Replace(strFolderName, chr(58), chr(45)) 'Replace forward slashes with dashes strFolderName = Replace(strFolderName, chr(47), chr(45)) 'Create the sub folder within the backup directory objFSO.CreateFolder(BACKUP_DIRECTORY & strFolderName) '******************************* 'Perform Management Pack Backups '******************************* Do While Not ManagementPacks.EOF 'Get backup AKM file name 'Replace spaces with underscores strDateTime = Replace(Now(), chr(32), chr(95)) 'Replace colons with dashes strDateTime = Replace(strDateTime, chr(58), chr(45)) 'Replace forward slashes with dashes strDateTime = Replace(strDateTime, chr(47), chr(45)) 'Set MP Backup File Name strMPBackupName = ManagementPacks("ManagementPackName").value & "_" & strDateTime 'Replace the spaces with underscores in the MP Backup File strMPBackupName = Replace(strMPBackupName, chr(32), chr(95)) strCommand = chr(34) & "C:\Program Files\Microsoft Operations Manager 2005\ManagementModuleUtil.exe" & chr(34) & _ " -O " & MOM_MGMT_SERVER & " " & ManagementPacks("ManagementPackID").value & _ " " & BACKUP_DIRECTORY & strFolderName & "\" & strMPBackupName & ".akm -W" 'Run the backup command wshShell.Run("%comspec% /c " & strCommand) 'Pause for 20 seconds to give the server time to backup the MP (so as not to overload the server) WScript.Sleep(20000) ManagementPacks.MoveNext Loop '****************************************************** 'Delete backup subdirectories older than retention Date '****************************************************** Set fso = CreateObject("Scripting.FileSystemObject") Set sFolder = fso.GetFolder(BACKUP_DIRECTORY) Set sFolders = sFolder.SubFolders For Each fldr In sFolders If fldr.datecreated < Date() - cInt(BKUP_RET_PERIOD) Then fldr.delete True End If Next Добавлено: denis255 У меня возникла проблема с SAV, только не с MOM, а с одним из сайтов на IIS, при определенных обстоятельствах сайт просто тихо останавливается и привет... В последнее время у меня много претензий к этому продукту. | Всего записей: 292 | Зарегистр. 24-12-2003 | Отправлено: 00:56 15-11-2006 | Исправлено: SlavikT, 01:04 15-11-2006 |
|