Veeam Integration with ServiceNow
ServiceNow Integration with Veeam comes up frequently in conversations to which SEs famously respond, "You can easily script integration." The goal of this post is to help users do exactly that. Easily script integration between Veeam ONE and ServiceNow. Luckily, there are already great resources from Veeam SEs that document how-to do this via Slack or Teams and also a great script on Github that I used for this blog post from Carlos Talbot.
Veeam ONE has over 200+ built-in alarms for VMware, Hyper-v and Veeam Backup and Replication. Veeam ONE goes well beyond the basic alarming and reporting for backup and dives deep into the hypervisor to extract details about disk/CPU usage, snapshot size/age, VM power status, orphaned snapshots and much more. In addition, Veeam ONE can monitor specific processes or services on a per-VM level, which we will expand on more later.
Username and password for ServiceNow
Admin access to the Veeam ONE Client server
Ideally a little familiarity with PowerShell but this post should be straightforward enough if you have zilch
To get started, download both createticket.ps1 and resolveticket.ps1 scripts to the same directory on Veeam ONE. Edit both files under "Configure the variables" section and ONLY change the $SNOWURL and $ScriptDir variables as shown below. Do the same for the resolveticket.ps1 file as well. If troubleshooting is needed setting $Debug to true can be leveraged.
############################################### ###Configure the variables below, you will be prompted for SNOW login ###during the first run which is then saved securely $SNOWURL = "https://dev71578.service-now.com/" $ScriptDir = "C:\createticket.ps1" $Debug = $false #enables writing to SNOWDebug.log file
Run the below command in PowerShell which will prompt you for ServiceNow credentials. You will only need to enter the creds once, and they will be stored where your script directory is under the name SNOWCredentials.xml.
c:\createticket.ps1 "VM power status" "EXCH2K16" "virtual machine is not Running" "12/13/2021 9:56:38 PM" "Error" "Reset/Resolved" "21117"
This also acts as a test to verify if we can properly connect between Veeam ONE and ServiceNow. Login to ServiceNow and confirm there is an incident created with the details of the command we just ran. Should look similar to the screenshot below.
Congratulations! You now have the power to create incidents in ServiceNow with over 200+ alarms in Veeam ONE. Go head and log in to Veeam ONE and click-on Alarm Management in the bottom left. Feel free to edit any alarm you like to test this functionality. For those following along, let's search for "VM with no Backup." This is a great alarm to validate our work and for practical use. Make sure you enable the alarm and set the rule to whatever RPO you like. The alarm can be set on the entire virtual infrastructure or just a specific cluster/host. In the Notification setting of the alarm paste the below two commands and set the action to Run script as shown below.
powershell.exe C:\createticket.ps1 '%1' '%2' '%3' '%4' '%5' '%6' '%7'
powershell.exe C:\resolveticket.ps1 '%1' '%2' '%3' '%4' '%5' '%6' '%7'
Assuming there are VMs in your environment that have not been protected log in to ServiceNow and confirm a ticket was created. Should look similar to the below screenshot.
As I mentioned earlier, there are hundreds of alarms you can enable. Feel free to set any of them by following the same workflow we just went through. To help give you some guidance though, another popular alarm is Snapshot Age. It never ceases to amaze me how some customers have snapshots in VMware that are months old taking up space on production datastores. To alleviate this you can create a ServiceNow ticket for any snap older than x amount of days as shown below. The Notification tab should be identical to the previous alarm.
Some additional popular alarms I see customers use are Guest OS disk space, datastore free space, backup job status, and ransomware activity just to name a few. But one last capability that is worth illustrating is the ability to set an alarm on a specific service. For example, the below screenshot shows how you can create an alarm if the VSS SQLWriter is Stopped. Something that might be useful to know if you're protecting SQL through Veeam. You can enable an alarm for any service or process on a VM though. Once again the Notification tab should be the same as the previous alarms.
I hope you find this post helpful as it's meant to be more of a guided how-to. Big shootouts to Jorge De La Cruz and Carlos Talbot who provided the majority of the heavy lifting. Let us know if you have any questions!