An Action (e.g. sql execution, script execution, ssh command, local program, etc) can executed via the click on a link in an Alert (email or sms) sent by germainAPM. Unlimited number of links can be added to an Alert and any Alert can be customized and you can create your own alert.

Some use cases:

  • Start/Stop/Restart an Application/Service/Server/Database

  • Send data to a ticket system to create a ticket

  • Enter data into a DB

  • Generate a report

There are currently 4 arguments you can fill:

Required:

id

This is the name of the action you want to run

Optional: (All are strings, but will be separate variables for the Action to consume)

server

A string variable to store the server's identity or hostname
<a href="$workspaceUrl/action.jsp?q=trigger&id=actionname&server=serverName">Click Here</a>

database

A string variable to store the way to identity or connect to the DB
<a href="$workspaceUrl/action.jsp?q=trigger&id=actionname&database=databaseName">Click Here</a>

application

A string variable to store identifying information about an application or service
<a href="$workspaceUrl/action.jsp?q=trigger&id=actionname&app=appName">Click Here</a>

Here is an example of a Action Link.

Example of a Service Restart Action Link

<#if context.fact?? && context.fact.name?? && context.fact.system?? && context.fact.system.hostname??>
<div><strong>This is a restart enabled template:</strong></div>
<div><a href="${workspaceUrl}action.jsp?q=trigger&id=restartservice&app=${context.fact.name!}&server=${context.fact.system.hostname!}">Click here to restart service "${context.fact.name!}" on "${context.fact.system.hostname!}"</a></div>
</#if>
HTML

Variable Name

Description

${workspaceUrl}

is an automatic variable with the URL of your germainAPM Server.  No Need to change it.

${context.fact.name!}

This is the name of the service.

${context.fact.system.hostname!}

The is the hostname

In this case it would execute the Action “restartservice” (“id”) and pass in two arguments (“server” and “app”).

The <#if> is there to protect against unexpectedly missing data.  If any of the following were missing, it would not try to create a link.  By not trying to create a link with missing data, it avoids errors that could prevent the alert from being sent out:

  • context.fact

  • context.fact.name

  • context.fact.system

  • context.fact.system.hostname