Alerting for an exception in a custom plugin

How do I get alerted for an exception in a custom plugin?

Include the attributes ['status'] = 0 and  ['msg']=str(e) under Exception. This would change the monitor status to Down and ensure the exception captured in 'msg' keyword would be shown as the reason for the Down status.

except Exception as e:    
     data["status"]=0
     
     data["msg"]=str(e)

In a sample PowerShell plugin script , include these attributes as follows: 
catch                             
{                                  
  $Script:Status = 0                                  
  $Script:msg = $_.Exception.Message
}
Tip: Add this in your plugin scripts for faster troubleshooting. 



    • Related Articles

    • Build custom Linux plugins

      Plugins are a great way to measure customized attributes and keep track of the data that matters the most. You can set thresholds to individual attributes and choose to get alerted if the set values exceed. Please follow the below steps to configure ...
    • Add a new Windows plugin

      Our open eco system for plugins give you the flexibility to create your own plugins and monitor data that you need, the way you want. You can also set thresholds to individual attributes and choose to get alerted if the set values exceed.  10 plugins ...
    • How to set thresholds and get alerted based on the number of DOWN locations?

      By configuring the proper thresholds for your web application, you can decide when to get alerted for a DOWN monitor. Let's say you have a web application that you monitor from our three global locations and your downtime rule is set as three ...
    • How to troubleshoot my Windows PowerShell Plugin?

      By default, the Site24x7 monitoring Windows agent will run as a SYSTEM user. In case, if you would like to verify if the plugin script is giving the output properly as SYSTEM user, follow these steps: Download PsExec from this link and extract the ...
    • How do I add the Dell iDRAC plugin for Windows?

      Prerequisites Install the latest version of the Net-SNMP package. Follow these steps to install and configure it. Install Python 3.6. Plugin Installation Create a folder named idrac. Download the files from our GitHub repository and place them in the ...