During the course of using your Site24x7 account, you may have felt the need to customize email templates or update HTTP configuration for your monitors. Our predefined incident parameters would have helped you build such templates with ease. When you enter the incident parameter in the respective message fields, the value of the specified parameter gets substituted in the context of the triggering event(s) when it sends the actual request or email. However, there's always a lack of customization and global availability with regards to the system generated incident parameters. Thus, to help you achieve much better customization and offer complete control over your template design, we've launched Global Parameters; an all new method to build and submit custom name-value pairs of constant or dynamic type across your Site24x7 account.
What is a Global Parameter?
Global Parameters can be defined as a constant or dynamic name-value pair that can be used as part of your Site24x7 global configuration. Once defined, these parameters get embedded into your monitor configuration forms and message fields that you access, where it gets listed along with other default parameters. You can easily invoke a Global Parameter in these forms and message fields by entering a $ symbol and selecting the relevant parameter. The Global Parameter will be specified in the format ${PARAMETERNAME}. As and when the trigger events such as sending an actual HTTP request or email occurs, the specified parameter gets substituted by the relevant constant or dynamic value(s). Below we've listed down all the instances of the Site24x7 web client, where the global parameters can be applied successfully:
- Email Templates: Customize Subject and Body of your email
- Add/Edit Monitor form: HTTP Configuration - Header Name, Header Value and Request Body (for POST method)
- Add/Edit Invoke Action URL: Customize HTTP requests with Header Name, Header Value in Invoke Action URL
- Webhooks and Third-Party Integrations: Customize HTTP requests with Header Name and Header Value
Creating a Global Parameter.
To create a global parameter, you must access Admin > Configuration profiles > Global Parameters from your Site24x7 web client. You can either create a constant or a dynamic Parameter. No two global parameters can have the same name. Read our user documentation to learn in depth about defining a global parameter.
Constant Parameter:
To set a constant parameter, you must specify a unique name for a relevant value. The parameter value field can have any normal text, without any restrictions.
Dynamic Parameter:
For creating dynamic parameters, you must first specify a relevant strategy for your dynamic parameter and then define your parameter values based on the selected strategy. We support four strategies, they're:
- Current date and time
- Random number by length
- Random number by maximum value
- Time in milliseconds
Random Number by Length:
By defining a digit count in the Parameter Value field (should be less than 10), you can generate a random number in the output with the same digit length. As an example, If you specify the value as 3, then a three digit random number (such as 930) will be generated in the rendered form where it's contextually used.
Time in milliseconds:
By selecting the time in milliseconds strategy, you can render the current time in milliseconds inside your customized email or message templates. The UNIX timestamp will be utilized for this execution.
How to use a predefined Global Parameters in Site24x7?
Once the global parameters are defined under configuration settings, you can start using these parameters to customize multiple templates, including HTTP request forms for your monitors, actions, webhooks and third-party integrations. You can also create unique email templates by inserting custom text and global parameters contextually inside the subject and body of the email. Take an example of a predefined email template, where an email is triggered to the user each time there is a status change. The specified global parameter name will be substituted by the constant or dynamic values generated by the system.
Let us know your valuable feedback after using Global Parameters. Also, if you have any questions, please contact us at +1 408 352 9117 or via email support@site24x7.com.
Hi,
How can I send http status code (200, 404, 500 etc.,) and other metrics like response time etc., over json through webhook?
Thanks,
Vijay