From 4ad966a1d4b9c8732d2a6bedb8d51cabd3ef0ef6 Mon Sep 17 00:00:00 2001 From: Ramassh Theivendran Date: Fri, 6 Jan 2023 15:06:20 +1300 Subject: [PATCH] Commands through file macro --- .../veritas-BackupExec-Backup/backupExec.cfg | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/templates/veritas-BackupExec-Backup/backupExec.cfg b/templates/veritas-BackupExec-Backup/backupExec.cfg index 79c48e1..8491d49 100644 --- a/templates/veritas-BackupExec-Backup/backupExec.cfg +++ b/templates/veritas-BackupExec-Backup/backupExec.cfg @@ -3,9 +3,16 @@ PATROL_CONFIG "/SENTRY/X/backupExec/collectionErrorCountAutoAcknowledgeTime" = { REPLACE = "900" }, "/SENTRY/X/backupExec/credentialsList" = { REPLACE = "" }, "/SENTRY/X/backupExec/databaseType" = { REPLACE = "" }, -"/SENTRY/X/backupExec/description" = { REPLACE = "Veritas Backup Exec Template" }, +"/SENTRY/X/backupExec/description" = { REPLACE = "Veritas Backup Exec (formerly Symantec Backup Exec)This is a Monitoring Studio X template for monitoring Veritas Backup Exec v20+ on Windows platforms.It monitors:- Agent Servers- Alerts- Jobs (completed and active)- Services- Storage Device Servers- Storage DevicesThe template uses the Backup Exec PowerShell module *BEMCLI* to execute commands on the Backup Exec Servers. Ensure that the user account used for monitoring has access to execute the module.Configuring through Monitoring Studio X Web UI* Add the Backup Exec Server host under the *Monitored Hosts* tab and define the system type as *Microsoft Windows*.* Provide appropriate user credentials to access the server.* Activate the *VERITAS BACKUP EXEC* template and click on Create.Configuring through TrueSight/Helix CMAOnce the template is imported into a TrueSight/Helix CMA policy for Monitoring Studio X (Configuration Variables), you need to:- add the Backup Exec servers with appropriate *System Credentials* that allow connecting to the server and run Backup Exec BEMCLI- associate the template (*backupExec*)- (optional) change the default macros by adding them to the *Required Macros*Required MacrosThe templates use following required macros. If you prefer to leave as default, do not add them to the *Required Macros* in the *Associated Templates* in the TrueSight CMA policy.- **JOB_HOURS**: Number of hours completed jobs are monitored for. Default: 48 hours" }, "/SENTRY/X/backupExec/disabled" = { REPLACE = "0" }, -"/SENTRY/X/backupExec/embeddedFileList" = { REPLACE = "" }, +"/SENTRY/X/backupExec/embeddedFileList" = { REPLACE = "BEAgentServer.ps1,BEAlert.ps1,BEActiveJobDetail.ps1,BEJobHistory.ps1,BEService.ps1,BEStorageDeviceServer.ps1,BEStorageDevice.ps1" }, +"/SENTRY/X/backupExec/embeddedFile_BEActiveJobDetail.ps1" = { REPLACE = "Import-Module BEMCLIGet-BEActiveJobDetail|Select-Object -Property Job,StartTime,ElapsedTime,IsOnHold,ProcessedBytes,FilesInUseCount,CorruptFileCount,SkippedFileCount,ProcessedVolumeCount,ProcessedFileCount,ProcessedDirectoryCount,JobId|ConvertTo-Csv -NoTypeInformation" }, +"/SENTRY/X/backupExec/embeddedFile_BEAgentServer.ps1" = { REPLACE = "Import-Module BEMCLIGet-BEAgentServer|Select-Object -Property Name,BackupStatus,IsConnectionEstablished,Id|ConvertTo-Csv -NoTypeInformation" }, +"/SENTRY/X/backupExec/embeddedFile_BEAlert.ps1" = { REPLACE = "Import-Module BEMCLIGet-BEAlert -Severity Warning,Error|Where-Object { $_.Date -gt (Get-Date).AddHours(-24) }|Select-Object -Property Name,Date,Severity,Category,Message,ExtendedMessage,Id|ConvertTo-Csv -NoTypeInformation" }, +"/SENTRY/X/backupExec/embeddedFile_BEJobHistory.ps1" = { REPLACE = "Import-Module BEMCLIGet-BEJobHistory|Where-Object { $_.StartTime -gt (Get-Date).AddHours(-%{JOB_HOURS}) }|Select-Object -Property JobName,JobStatus,StartTime,EndTime,ElapsedTime,TotalDataSizeBytes,JobRateMBPerMinute,JobType,PercentComplete,StorageName,JobId,ErrorCode|ConvertTo-Csv -NoTypeInformation" }, +"/SENTRY/X/backupExec/embeddedFile_BEService.ps1" = { REPLACE = "Import-Module BEMCLIGet-BEService|Select-Object -Property Name,DisplayName,Status|ConvertTo-Csv -NoTypeInformation" }, +"/SENTRY/X/backupExec/embeddedFile_BEStorageDevice.ps1" = { REPLACE = "Import-Module BEMCLIGet-BEStorageDevice|Select-Object -Property Name,Disabled,Paused,Active,UsedCapacityBytes,AvailableCapacityBytes,Id,@{Name='UsedPercent';Expression={100*$_.UsedCapacityBytes/$_.TotalCapacityBytes}}|ConvertTo-Csv -NoTypeInformation" }, +"/SENTRY/X/backupExec/embeddedFile_BEStorageDeviceServer.ps1" = { REPLACE = "Import-Module BEMCLIGet-BEStorageDevice|Select-Object -ExpandProperty Servers|Select-Object -Property Name,IsOnline,IsActive,Id|ConvertTo-Csv -NoTypeInformation" }, "/SENTRY/X/backupExec/label" = { REPLACE = "Veritas Backup Exec" }, "/SENTRY/X/backupExec/macroList" = { REPLACE = "JOB_HOURS;48;1" }, "/SENTRY/X/backupExec/messageList" = { REPLACE = "" }, @@ -23,7 +30,7 @@ PATROL_CONFIG "/SENTRY/X/backupExec:monitor-agent-servers/label" = { REPLACE = "Monitor Agent Servers" }, "/SENTRY/X/backupExec:monitor-agent-servers/messageList" = { REPLACE = "" }, "/SENTRY/X/backupExec:monitor-agent-servers/neverEnding" = { REPLACE = "0" }, -"/SENTRY/X/backupExec:monitor-agent-servers/osCommand" = { REPLACE = "powershell -command \"Import-Module BEMCLI;Get-BEAgentServer|Select-Object -Property Name,BackupStatus,IsConnectionEstablished,Id|Export-Csv %PATROL_TEMP%\\beagentserver.csv -NoTypeInformation -Force;Get-Content -Path %PATROL_TEMP%\\beagentserver.csv\"" }, +"/SENTRY/X/backupExec:monitor-agent-servers/osCommand" = { REPLACE = "powershell -inputformat none %{FILE: BEAgentServer.ps1} 2>$null" }, "/SENTRY/X/backupExec:monitor-agent-servers/parameterList" = { REPLACE = "ExecutionTime;1,ExitCode;0,Result;1,Status;0" }, "/SENTRY/X/backupExec:monitor-agent-servers/parent" = { REPLACE = "backupExec" }, "/SENTRY/X/backupExec:monitor-agent-servers/pollingIntervalList" = { REPLACE = "commandLineColl;continuous;900;" }, @@ -96,7 +103,7 @@ PATROL_CONFIG "/SENTRY/X/backupExec:monitor-alerts/label" = { REPLACE = "Monitor Alerts" }, "/SENTRY/X/backupExec:monitor-alerts/messageList" = { REPLACE = "" }, "/SENTRY/X/backupExec:monitor-alerts/neverEnding" = { REPLACE = "0" }, -"/SENTRY/X/backupExec:monitor-alerts/osCommand" = { REPLACE = "powershell -command \"Import-Module BEMCLI;Get-BEAlert -Severity Warning,Error|Where-Object { $_.Date -gt (Get-Date).AddHours(-24) }|Select-Object -Property Name,Date,Severity,Category,Message,ExtendedMessage,Id|Export-Csv %PATROL_TEMP%\\bealert.csv -NoTypeInformation -Force;Get-Content -Path %PATROL_TEMP%\\bealert.csv\"" }, +"/SENTRY/X/backupExec:monitor-alerts/osCommand" = { REPLACE = "powershell -inputformat none %{FILE: BEAlert.ps1} 2>$null" }, "/SENTRY/X/backupExec:monitor-alerts/parameterList" = { REPLACE = "ExecutionTime;1,ExitCode;0,Result;1,Status;0" }, "/SENTRY/X/backupExec:monitor-alerts/parent" = { REPLACE = "backupExec" }, "/SENTRY/X/backupExec:monitor-alerts/pollingIntervalList" = { REPLACE = "commandLineColl;continuous;300;" }, @@ -150,7 +157,7 @@ PATROL_CONFIG "/SENTRY/X/backupExec:monitor-jobs-active/label" = { REPLACE = "Monitor Jobs (Active)" }, "/SENTRY/X/backupExec:monitor-jobs-active/messageList" = { REPLACE = "" }, "/SENTRY/X/backupExec:monitor-jobs-active/neverEnding" = { REPLACE = "0" }, -"/SENTRY/X/backupExec:monitor-jobs-active/osCommand" = { REPLACE = "powershell -command \"Import-Module BEMCLI;Get-BEActiveJobDetail|Select-Object -Property Job,StartTime,ElapsedTime,IsOnHold,ProcessedBytes,FilesInUseCount,CorruptFileCount,SkippedFileCount,ProcessedVolumeCount,ProcessedFileCount,ProcessedDirectoryCount,JobId|Export-Csv %PATROL_TEMP%\\beactivejobdetail.csv -NoTypeInformation -Force;Get-Content -Path %PATROL_TEMP%\\beactivejobdetail.csv\"" }, +"/SENTRY/X/backupExec:monitor-jobs-active/osCommand" = { REPLACE = "powershell -inputformat none %{FILE: BEActiveJobDetail.ps1} 2>$null" }, "/SENTRY/X/backupExec:monitor-jobs-active/parameterList" = { REPLACE = "ExecutionTime;1,ExitCode;0,Result;1,Status;0" }, "/SENTRY/X/backupExec:monitor-jobs-active/parent" = { REPLACE = "backupExec" }, "/SENTRY/X/backupExec:monitor-jobs-active/pollingIntervalList" = { REPLACE = "commandLineColl;continuous;120;" }, @@ -396,7 +403,7 @@ PATROL_CONFIG "/SENTRY/X/backupExec:monitor-jobs-completed/label" = { REPLACE = "Monitor Jobs (Completed)" }, "/SENTRY/X/backupExec:monitor-jobs-completed/messageList" = { REPLACE = "" }, "/SENTRY/X/backupExec:monitor-jobs-completed/neverEnding" = { REPLACE = "0" }, -"/SENTRY/X/backupExec:monitor-jobs-completed/osCommand" = { REPLACE = "powershell -command \"Import-Module BEMCLI;Get-BEJobHistory|Where-Object { $_.StartTime -gt (Get-Date).AddHours(-%{JOB_HOURS}) }|Select-Object -Property JobName,JobStatus,StartTime,EndTime,ElapsedTime,TotalDataSizeBytes,JobRateMBPerMinute,JobType,PercentComplete,StorageName,JobId,ErrorCode|Export-Csv %PATROL_TEMP%\\bejobshistory.csv -NoTypeInformation -Force;Get-Content -Path %PATROL_TEMP%\\bejobshistory.csv\"" }, +"/SENTRY/X/backupExec:monitor-jobs-completed/osCommand" = { REPLACE = "powershell -inputformat none %{FILE: BEJobHistory.ps1} 2>$null" }, "/SENTRY/X/backupExec:monitor-jobs-completed/parameterList" = { REPLACE = "ExecutionTime;1,ExitCode;0,Result;1,Status;0" }, "/SENTRY/X/backupExec:monitor-jobs-completed/parent" = { REPLACE = "backupExec" }, "/SENTRY/X/backupExec:monitor-jobs-completed/pollingIntervalList" = { REPLACE = "commandLineColl;continuous;300;" }, @@ -570,7 +577,7 @@ PATROL_CONFIG "/SENTRY/X/backupExec:monitor-services/label" = { REPLACE = "Monitor Services" }, "/SENTRY/X/backupExec:monitor-services/messageList" = { REPLACE = "" }, "/SENTRY/X/backupExec:monitor-services/neverEnding" = { REPLACE = "0" }, -"/SENTRY/X/backupExec:monitor-services/osCommand" = { REPLACE = "powershell -command \"Import-Module BEMCLI;Get-BEService|Select-Object -Property Name,DisplayName,Status|Export-Csv %PATROL_TEMP%\\beservice.csv -NoTypeInformation -Force;Get-Content -Path %PATROL_TEMP%\\beservice.csv\"" }, +"/SENTRY/X/backupExec:monitor-services/osCommand" = { REPLACE = "powershell -inputformat none %{FILE: BEService.ps1} 2>$null" }, "/SENTRY/X/backupExec:monitor-services/parameterList" = { REPLACE = "ExecutionTime;1,ExitCode;0,Result;1,Status;0" }, "/SENTRY/X/backupExec:monitor-services/parent" = { REPLACE = "backupExec" }, "/SENTRY/X/backupExec:monitor-services/pollingIntervalList" = { REPLACE = "commandLineColl;continuous;120;" }, @@ -624,7 +631,7 @@ PATROL_CONFIG "/SENTRY/X/backupExec:monitor-storage-device-servers/label" = { REPLACE = "Monitor Storage Device Servers" }, "/SENTRY/X/backupExec:monitor-storage-device-servers/messageList" = { REPLACE = "" }, "/SENTRY/X/backupExec:monitor-storage-device-servers/neverEnding" = { REPLACE = "0" }, -"/SENTRY/X/backupExec:monitor-storage-device-servers/osCommand" = { REPLACE = "powershell -command \"Import-Module BEMCLI;Get-BEStorageDevice|Select-Object -ExpandProperty Servers|Select-Object -Property Name,IsOnline,IsActive,Id|Export-Csv %PATROL_TEMP%\\bestoragedeviceserver.csv -NoTypeInformation -Force;Get-Content -Path %PATROL_TEMP%\\bestoragedeviceserver.csv\"" }, +"/SENTRY/X/backupExec:monitor-storage-device-servers/osCommand" = { REPLACE = "powershell -inputformat none %{FILE: BEStorageDeviceServer.ps1} 2>$null" }, "/SENTRY/X/backupExec:monitor-storage-device-servers/parameterList" = { REPLACE = "ExecutionTime;1,ExitCode;0,Result;1,Status;0" }, "/SENTRY/X/backupExec:monitor-storage-device-servers/parent" = { REPLACE = "backupExec" }, "/SENTRY/X/backupExec:monitor-storage-device-servers/pollingIntervalList" = { REPLACE = "commandLineColl;continuous;900;" }, @@ -678,7 +685,7 @@ PATROL_CONFIG "/SENTRY/X/backupExec:monitor-storage-devices/label" = { REPLACE = "Monitor Storage Devices" }, "/SENTRY/X/backupExec:monitor-storage-devices/messageList" = { REPLACE = "" }, "/SENTRY/X/backupExec:monitor-storage-devices/neverEnding" = { REPLACE = "0" }, -"/SENTRY/X/backupExec:monitor-storage-devices/osCommand" = { REPLACE = "powershell -command \"Import-Module BEMCLI;Get-BEStorageDevice|Select-Object -Property Name,Disabled,Paused,Active,UsedCapacityBytes,AvailableCapacityBytes,Id,@{Name='UsedPercent';Expression={100*$_.UsedCapacityBytes/$_.TotalCapacityBytes}}|Export-Csv %PATROL_TEMP%\\bestoragedevice.csv -NoTypeInformation -Force;Get-Content -Path %PATROL_TEMP%\\bestoragedevice.csv\"" }, +"/SENTRY/X/backupExec:monitor-storage-devices/osCommand" = { REPLACE = "powershell -inputformat none %{FILE: BEStorageDevice.ps1} 2>$null" }, "/SENTRY/X/backupExec:monitor-storage-devices/parameterList" = { REPLACE = "ExecutionTime;1,ExitCode;0,Result;1,Status;0" }, "/SENTRY/X/backupExec:monitor-storage-devices/parent" = { REPLACE = "backupExec" }, "/SENTRY/X/backupExec:monitor-storage-devices/pollingIntervalList" = { REPLACE = "commandLineColl;continuous;900;" },