Monitoring Veeam Backup Backup or Replication Jobs & Replication

Continuing with a centralizing mindset, today we will see how Centreon can monitor the status of Veeam Backup backups & Replication, With this we will unload another task to take into account in our thoughts, because if a copy or replica task fails, we will know it immediately. We will no longer have to be aware of having to enter the console to check them,

 

GOOD, We'll rely on a script called ‘check_veeam_eventlogs.ps1‘, that we are going to download to the machine in charge of making the backups. A PowerShell script that we will simply execute remotely using NRPE from the Centreon machine and read its output to monitor if the Copy or Replica tasks are executed correctly. As is clear, first we need to have NRPE installed and well configured on our Centreon machine, If you haven't done it, Reviewed This document.

 

The operation is very simple, we can try it to run it from a PowerShell, we will have left the downloaded file in the NSClient scripts folder, we will have to pass a couple of parameters to the script, one the name of the Job and another with the time in hours to check within that time. Example:

[SourceCode].\check_veeam_eventlogs.ps1 'Backup Job Open Services IT’ 24[/SourceCode]

 

The script works perfectly for Copy type Jobs, but not for the Replica type Jobs, nothing, We duplicate the script and rename it with a '_replica’ to have 2 Scripts, one that will monitor Copy Jobs and others Replica (in another post we will look at EndPoint Jobs). In this new file we make the following modifications:

On the line 35 we change for:

[SourceCode]$ArgEventID = 190 # Replication Job complete event id[/SourceCode]

 

On the line 78, we would replace

[SourceCode]if ($LogEntry.Message.ToString() -like "*Replica*''$ArgBackupJobName''*")[/SourceCode]

 

And then if we want to make it cool and change the output for something more personalized in Spanish, We'd change the line 186:

[SourceCode]$ResultString += "CRITICAL: $CriticalErrorResultCountCritical errors were found in the $ArgBackupJobName replica in the last $ArgLastHours hours"[/SourceCode]

 

Also the line 192:

[SourceCode]$ResultString += "Warning: The replica $ArgBackupJobName has $WarningResultCount Warning messages in the last $ArgLastHours hours"[/SourceCode]

 

The 202:

[SourceCode]$ResultString += "CRITICAL: The $ArgBackupJobName replica ended with errors in the last $ArgLastHours hours"[/SourceCode]

 

And finally, the 208:

[SourceCode]$ResultString += "OK: The $ArgBackupJobName reply ended perfectly in the last $ArgLastHours hours."[/SourceCode]

 

Ale, Well, we've got it ready, now it is nothing more than registering in the nsclient.ini file (NSClient Configuration) the aliases and commands that you must execute when we call you from another computer, as it is in our case from a Centreon. Add:

[SourceCode][/settings/external scripts/scripts]
check_veeam_copia_os = cmd /c echo scripts\check_veeam_eventlogs.ps1 'Backup Job Open Services IT’ 24; exit($lastexitcode) | powershell.exe -command –
check_veeam_replica = cmd /c echo scripts\check_veeam_eventlogs_replica.ps1 'Replication Job Open Services IT’ 24; exit($lastexitcode) | powershell.exe -command –

[/settings/external scripts/alias]
check_veeam_copia_os = check_veeam_copia_os
check_veeam_replica = check_veeam_replica

[/SourceCode]

 

We restart the team's NSClient++ service so that it can reread the configuration and we go to Centreon to register the Service that will monitor the Copy and Replica Jobs.

 

Since “Configuration” > “Services”, we duplicate any Service that we have monitored with NRPE and it will be much easier, We edit and modify it:

  • Description: The name of the Service, for example the name of the monitored job.
  • Lined with Hosts: We link it to the server that has Veeam installed and NRPE configured.
  • Check Command: Select the Command, If you have followed the documents in this blog, It will be called 'check_nrpe'.
  • Argument: In the argument we must put the Alias that we have defined in the nsclient.ini file so that it executes the script that interests us.

 

And it would be nice to indicate in the 'Normal Check Interval'’ that runs every X hours that we are interested in, Obviously we are not interested in the check being carried out every 5 minutes if the job is executed every 24 hours for example. We recorded the new service with “Save” and we can create as many services as we need for other Copy Jobs or Replica Jobs…

We record the configuration & We export files as usual…

 

And we will be able to see after a while that we have already monitored our backup or replication tasks! With this, another more centralized thing and that we can control and know at all times its status, in addition to enjoying all the advantages of a monitored system, we will be able to measure SLAs…

 

Recommended Posts

Author

nheobug@bujarra.com
Autor del blog Bujarra.com Cualquier necesidad que tengas, Do not hesitate to contact me, I will try to help you whenever I can, Sharing is living ;) . Enjoy documents!!!