Blog  |  Syncro,

How to Create a Custom RMM Alert Using Syncro’s Scripting Module

Syncro Blog: Learn How To get the most power out of Syncro

Hey Syncro users,

Happy New Year! We hope your 2018 is off to a productive start.

This is the first post in a new series about how to get the most power out of Syncro (appropriately named “How To”).

At Syncro, we like to say “embrace automation.” We’re constantly searching for ways Syncro can automate elements of your work in order to free up your time to better service your clients.

Let’s start by looking at How To Create a Custom RMM Alert using Syncro’s Scripting Module.

Syncro has built-in monitoring alerts that you can use, such as:

  • Low Hard Drive Space
  • Antivirus Installed
  • Application Crashes
  • Many more

However, you can also create a custom RMM alert via Syncro’s Scripting Module.

For example, say you want to monitor CPU Usage and receive a Syncro alert if an Asset’s CPU usage exceeds a certain threshold. You can use Syncro’s Scripting module and PowerShell “Quick Help” shortcuts to create this custom RMM alert.

Here’s how to create a custom RMM Alert via Syncro Scripting:

  1. Login to your Syncro account and navigate to the Scripts module.
  2. Click “New Script” in the top right corner. 

    Syncro Scripting: New Script

    Syncro Scripting: New Script

     

     

  3. Scroll to the bottom of the New Script page to find the “PowerShell Quick Help” section. This area contains PowerShell Modules. 

    Syncro Scripting: PowerShell Quick Help

    Syncro Scripting: PowerShell Quick Help

  4. Now it’s time to write the Script. First, make sure to copy Line 1 from PowerShell Quick Help into the New Script field. By importing our Syncro module, you’ll gain access to the Syncro-related PowerShell functions we wrote for you.
  5. Then, write the Script for the activity you need Syncro to monitor, such as CPU usage, ShadowProtect jobs, or Symantec Backup Exec. Note: if you want a refresher on PowerShell scripts, or just want to work smart and use scripts that already exist, check out this Microsoft TechNet page.
  6. If your script finds a condition that should create an RMM alert, simply use the ‘Rmm-Alert’ function from the PowerShell Quick Help section. Customize the RMM alert by setting the Category and Body Copy. Here’s an example of a finished script for checking CPU usage:

Import-Module $env:SyncroModule
# 5 minutes

$repeat_count = 15

$cpu_threshold = 85

$sleep_interval = 20

$hit = 0

 

foreach($turn in 1..$repeat_count) {

 $cpu = (gwmi -class Win32_Processor).LoadPercentage

 #write-host “CPU utilization is Currently at $($cpu)”

 If($cpu -ge $cpu_threshold) {

$hit = $hit+1

 } else {

$hit = 0

 }

start-sleep $sleep_interval

}

 

if($hit -eq 14) {

 write-host “CPU utilization is over threshold for 5 minutes straight”

 Rmm-Alert -Category “cpu_utilization” -Body “CPU Utilization is more than $($cpu_threshold)”

} else {

 write-host “CPU utilization is below threshold level”

}

 

Have you created custom RMM alerts in Syncro yet? What built-in RMM alerts and Scripts would you like to see? We want to hear from you, so drop a note to help@syncromsp.com and let us know your thoughts.

 

Cheers!

– Syncro team

Ian Alexander

Ian Alexander

Co-founder and Channel Chief at Syncro. Always trying to find ways to help MSPs. Former MSP tech and break-fix owner. Basketball player, human and dog dad. Grew up in Berkeley, living in Sacramento.

Leave a Reply

Your email address will not be published. Required fields are marked *