Documentation is now available for the Fall 2020 Update release!

Setting up Agentless Monitors

Describes how to set up agentless custom monitors.

Leave Feedback

Introduction

In addition to agent-based custom monitors, agentless monitoring are supported. Agentless monitors use the gateway to track the health and performance of the network, storage, and virtual resources as well as Platform as a Service (PaaS) cloud resources.

For agentless custom monitors, the gateway connects to a remote device using the following options:

  • SSH for Linux devices
  • PowerShell for Windows devices
  • Remote Script Executor for Windows and Linux devices

After connecting to the remote device, the gateway collects information and displays them as graphs or notifications according to the threshold.

Set up agentless custom monitors via Secure Shell (SSH) monitors

OpsRamp Remote Shell provides the provision to write the custom scripts using Bash, Perl, and Python to help monitor remote devices. 

Setting up monitoring to use Remote Shell Monitors includes:

  1. Creating metrics.
  2. Creating a custom remote shell monitor with remote shell metrics.
  3. Creating a template with a remote shell monitor.
  4. Assigning the template to a resource.
  5. Viewing graphs.

Prerequisites

  • Remote System
    • Resource has SSH support.
    • Installation of one of the scripting languages, such as Bash, Python, and Perl.
    • All the libraries of the installed script are available in the remote system.
    • The custom script follows the predefined response format of OpsRamp.
  • OpsRamp
    • As of OpsRamp Gateway version 5.5.0, SSH monitoring is supported.
    • Valid OpsRamp user credentials with permissions to create a metric, monitor, and template.
    • Access to the remote device requires a single valid SSH credential.

Step 1: Create metrics

You can create Custom Metrics using custom scripts.

To create custom Remote Shell metrics:

  1. From All Clients, select a client.
  2. Go to Setup > Monitoring > Metrics.
  3. From the METRICS screen, click + Add and provide the following:
    • Collector Type: Select Application.
    • Application Type: Select Remote Shell.
    • Name: Provide a Name for the metric.
      • OpsRamp recommends <Prefix>.<Script Type>.<OS>.<Name> as naming convention for the metric.
        For example: rshell.bash.linux.disk_utilization, rshell.python.linux.cpu_utilization, and rshell.perl.linux.memory_utilization
    • Tag: Refers to the user-defined tags for better filtering. For example, Application, Adapter, RemoteShell.
    • Display Name: Refers to the display Name provided for the metric.
    • Description: Refers to the purpose of the metric.
    • Script: Provide the custom script in the Script text box. Refer to sample Bash script and JSON outputs for single and multiple datapoints to view the sample script.
    • Data Point type: Select the required data point.
    • Units: Select the required values for Units, Unit Multiplication Factor, and Datapoint value conversion lists.
    • Unit Multiplication Factor: Refers to the value chosen to multiply a value based on the chosen unit.
    • Data Point Conversion: Refers to one of the following options:
      • Value
      • Enumerated Map
    • Metric Processing: Refers to one of the following values for processing the Metric:
      • Notification
      • Graph
      • Graph and Notification. To configure values for Graph and Notification, provide the details for the following parameters:
        • Warning if value: Refers to the warning threshold value.
        • Critical if value: Refers to the critical threshold value.
        • Subject: Refers to the subject for the metric.
        • Description: Refers to the description for the metric.
          Important: The values for Subject and Description are populated by default. OpsRamp recommends not to change the values as that can result in the failure of alert generation.
  4. Click Save.
Secure Shell Monitor Create Metric

Secure Shell Monitor Create Metric

Step 2: Create monitor

The custom remote shell monitor is a collection of remote shell metrics. You can create a template using the remote shell monitor.

  • Monitor only one bateway using remote shell.
  • Monitor to have metrics of the same script type.
  • Select the custom parameter path depending on the script type.

To create a custom remote shell monitor:

  1. From All Clients, select a client.
  2. Go to Setup > Monitor Management > Monitors.
  3. From Monitors, click + Add.
  4. From Create a Monitor, provide the following parameters.
    • Monitor Scope: Refers to the scope for each monitor.
    • Adaptor Type: Select Application.
    • Application Type: Select Remote Shell.
    • Name: Refers to the unique monitor name.
    • Description: Refers to the details of the added monitors.
    • Metrics: A metric is a measurement for a specific characteristic of the performance of a device.
      To add metrics:
      1. From Metrics, click Add Metrics.
        Note: A maximum of 20 metrics is recommended. Adding more number of metrics in a monitor can run into performance issues.
      2. Search the desired metric and click Add Metrics. The metrics section displays the selected metric.
    • Configuration Parameters: A configuration parameter is a user input to assist the metric collector.
      To add parameters:
      1. Provide Default Value for all the configuration parameters.
      2. Select the Configurable checkbox and click Add.
      3. Provide configuration parameters depending on your environment or devices.
        You can view the default value for the respective name selected. For example, the following shows the configuration parameters for a script type.
        • bash: rshell.bash.bin.path
        • python: rshell.python.bin.path
        • perl: rshell.perl.bin.path
        • custom executor: rshell.customexecutor.bin.path
  5. Click Save.
Secure Shell Create Monitor

Secure Shell Create Monitor

Step 3: Create a template

A template is an instance of a monitor and applied to devices.

To create a template:

  1. From All Clients, select a client.
  2. Go to Setup > Monitoring > Templates.
  3. From the TEMPLATES screen, click + Add.
  4. From MONITOR TEMPLATE, provide the following parameters:
    • Select Template Scope: Refers to the Template type.
    • Collector Type: Select Gateway.
    • Monitor Type: Select Monitors for G2 Templates.
    • Applicable for: Select Device.
    • Template Name: Refers to the name of the template.
    • Description: Refers to the summary of the template.
    • Generation: Refers to the generation that the template belongs to.
    • Tags: Refers to the user-defined tags for better filtering. For example, Application, Adapter.
    • Prerequisites: Refers to the essential things that you must consider while monitoring using the template. For example, check the SQL services while monitoring the SQL Parameters using the Windows templates.
    • Status: Refers to the Active or End-of-life templates.
    • Notes: Refers to the additional information that you want to add to the template.
    • Template Family Name: Refers to the category that applies to the application. For example, Windows Server, Storage Server, and Network Server.
    • Deployment Type: Refers to one of the following methods to apply the template to the resources:
      • Custom
      • Optional
      • Standard
    • After providing the template details, MONITOR TEMPLATE displays the Monitors section.
      Note: The user interface for the Monitors section varies with the option selected in the Collector Type.
    • Monitor: To add details in Monitors:
      1. From the Monitors section, click Add button.
      2. From the Monitor screen, provide the following parameters:
        • Frequency: Refer to the frequency to execute the template.
        • Monitor Definition: Refers to the monitor type.
        • When to Alert: Select Breach of a Threshold.
      3. Select the Availability and Alert check-box to initiate monitoring.
  5. Click Save.
Secure Shell Monitor Template

Secure Shell Monitor Template

Step 4: Assign a template

To assign a template to a resource:

Creating credentials for the template:

  1. From All Clients, select a client.
  2. Go to Infrastructure > Resources.
  3. Select a resource, click Credentials, and +Add.
  4. From Create New Credentials, provide details for the following parameters and Save.
    • Name
    • Description.
    • From the Type drop-down list, select SSH.
    • Authentication Type
    • Username
    • Password
    • Confirm Password.
    • Port
    • Connection Time Out (ms)

Assigning the template to a resource:

  1. Go to Infrastructure > Resources, select a resource, and click on the resource name to view details.
  2. Go to Monitors > Templates and click +Assign Templates.
  3. From Apply Templates, select the desired templates.
    The selected Templates section displays the chosen templates.
  4. Click Assign.
    The template gets assigned to the selected device.

After assigning the template to a resource for monitoring, select Get Latest Metric Values to view the latest metric information.

Step 5: View graphs

OpsRamp Gateway monitors the remote system using the assigned templates and displays the results in a graphical format.

To view the monitoring graphs:

  1. Go to Infrastructure > Resources, select a required resource from the list of resources. Alternatively, use the search option to locate the resource.
  2. Click the resource name to view details.
  3. From the left pane, click Metrics.
    The Metrics page displays graphs generated by all monitoring templates assigned to a device. 
  4. Search with the desired template name to filter the graphs.
Monitor Template Graphs

Monitor Template Graphs

Set up agentless custom monitors via PowerShell monitors

Windows PowerShell can help you to control and automate the administration of the Windows operating system and applications that run on Windows. 

Prerequisites

  • The PowerShell supports all versions of Windows devices.
  • Supported types: WQL queries and PowerShell scripts
  • Supported cmdlets: Get-WmiObject and Get-CimInstance
  • The target device must have WinRm in Running State (Enabled).
  • Target device must have User privileges.
  • Set the PowerShell environment variable in the target device.
  • PowerShell script works only on Windows Gateway.
  • Place the PowerShell script in Windows Gateway.  Default path: /OpsRamp/Gateway/scripts/wmi/monitoring/rpshellscripts
  • The script must follow a predefined response format at the metric level.
  • Arguments support for PowerShell script.
  • No argument support for the metric level script.

Usage

  • As of OpsRamp Gateway version 5.5.0, Powershell monitoring is supported.
  • Valid OpsRamp user credentials with Create metric, monitor and template permissions.
  • Access to the remote device requires a single valid Powershell credential.

Monitoring using PowerShell Monitors includes the following steps:

  1. Create Metrics
  2. Create a custom PowerShell monitor with PowerShell metrics
  3. Create a template with PowerShell monitor
  4. Assign the template to a device
  5. Get the latest metric value
  6. View Graphs

Step 1: Create custom metrics

Custom metrics can be created with custom scripts.

To create a custom remote shell metric:

  1. From All Clients, select a client.
  2. Go to Setup > Monitoring > Metrics.
  3. From METRIC, click + Add and provide the following:.
    • Metric Scope: Refers to Partner Metric or Client Specific Metric.
    • Adaptor Type: Select Application.
    • Application Type: Select PowerShell.
    • Name: Refers to a unique Name for the metric.
      OpsRamp recommends <Prefix>.<Script Type>.<OS>.<Name> as naming convention for the metric.
      For Example: windows.system.cpu.utilization, windows.system.disk.utilization, windows.system.drive.freeSpace, and windows.system.memory.usage.
    • Tag: Refers to the user-defined tags for better filtering. For example, Adapter, PowerShell.
    • Display Name: Provide Display Name. For example, System Drive Free Space.
    • Description: Provide the purpose of the metric.
    • Script: Refers to the custom script in the Script text box. You can refer to sample script and JSON outputs to view the sample script provided in the Script section in the user interface.
    • Data Point type: Refers to the value chosen to plot data in the graph.
    • Units: Refers to the required values for Units. You can choose Units depending on the chosen Data Point Type.
    • Unit Multiplication Factor: Refers to the value chosen to multiply a value based on the chosen unit.
    • Data Point Conversion: Refers to one of the following options:
      • Value
      • Enumerated Map
    • Metric Processing: Refers to one of the following values for processing the Metric:
      • Notification
      • Graph
      • Graph and Notification.
      • To configure values for Graph and Notification, provide the following:
        • Warning if value: Refers to the warning threshold value.
        • Critical if value: Refers to the critical threshold value.
        • Subject: Refers to the subject for the metric.
        • Description: Refers to the description for the metric.
  4. Click Save.
PowerShell Create Metric

PowerShell Create Metric

Step 2: Create monitor

Custom PowerShell monitor is a collection of PowerShell metrics. You can create a template using the PowerShell monitor.

Prerequisites:

  • Monitor to have metrics of the same script type.
  • Add the required custom parameters.

To create a custom PowerShell monitor:

  1. Go to Setup > Monitoring > Monitors.
  2. From Monitors, click + Add.
    CREATE A MONITOR screen appears.
  3. From CREATE A MONITOR, provide the following parameters:
    • Monitor Scope: Select either Partner Monitor or Client Specific Monitor.
    • Type: Select Application.
    • Application Type: Select PowerShell.
    • Name: Provide a unique name for the metric.
    • Description: Provide the purpose of creating the monitor.
    • After providing the monitor details, navigate to the Metrics section.
    • Metrics: To add Metrics:
      1. From Metrics, click Add Metrics.
        Metrics screen appears.
      2. Search the desired metric and click Add Metrics.
        Metrics section displays the selected metric.
    • After adding the metrics, navigate to Configuration Parameters.
    • Configuration Parameters: To add configuration Parameters:
      1. Provide Default Value for all the configuration parameters.
      2. Select the Configurable checkbox.
      3. Click Add.
        Configuration Parameters screen appears.
      4. Provide Configuration Parameters depending on the selected script type. You can view the default value for the respective Name selected.
  4. Click Save.
PowerShell Create Monitor

PowerShell Create Monitor

Step 3: Create template

A template is an instance of a monitor and applied to devices.

To create a template:

  1. From All Clients, select a client.
  2. Go to Setup > Monitoring >Templates and click + Add.
  3. From MONITOR TEMPLATE, provide the following:
    • Select Template Scope: Refers to the Template type.
    • Collector Type: Select Gateway.
    • Monitor Type: Select Monitors for G2 Templates.
    • Applicable for: Select Device.
    • Template Name: Refers to the name of the template.
    • Description: Refers to the summary of the template.
    • Generation: Refers to the generation that the template belongs to.
    • Tags: Refers to the user-defined tags for better filtering.
    • Prerequisites: Refers to the essential things that you must consider while monitoring using the template. For example, check the SQL services while monitoring the SQL Parameters using the Windows templates.
    • Status: Refers to the Active or End-of-life templates.
    • Notes: Refers to the additional information that you want to add to the template.
    • Template Family Name: Refers to the category that applies to the application. For example, Windows Server, Storage Server, and Network Server.
    • Deployment Type: Refers to one of the following methods to apply the template to the resources:
      • Custom
      • Optional
      • Standard
    • After providing the template details, MONITOR TEMPLATE displays the Monitors section.
      Note: The user interface for the Monitors section varies with the option selected in the Collector Type.
    • Monitor: To add details in Monitors:
      1. From Monitors section, click Add button.
        The monitor screen appears.
        • Frequency: Refers to the frequency to execute the template.
        • Monitor Definition: Refers to the monitor type.
        • When to Alert: Select Breach of a Threshold.
      2. Select Availability and Alert check-box to initiate monitoring.
  4. Click Save.
PowerShell Create Template

PowerShell Create Template

Step 4: Assign template

You need to create credentials to assign a template to a resource.

Prerequisite

Assign Credentials to access the required device and assign the template.

Creating credentials for the template

To create a credential:

  1. From All Clients, select a client.
  2. Go to Infrastructure > Resources, select a device.
    Navigates to the device information page.
  3. From the center pane, click Credentials > +Add.
  4. From Create New Credentials, provide the following:
    • Name
    • Description of the new credentials.
    • From the Type drop-down list, select Windows.
    • Username
    • Password
    • Confirm Password.
    • Connection Time Out (ms)
  5. Click Save.

Assigning templates

To assign a template to a device:

  1. From the left pane, click Infrastructure.
    The Infrastructure screen of the selected client appears.
  2. From Resources tab, select a required resource from the list of resources. Alternatively, use the search option to locate the resource.
  3. Click the resource name to view details.
  4. From the left pane, click Monitors.
    Templates tab appears.
  5. From Templates tab, click +Assign Templates.
    Apply Templates screen appears.
  6. From Apply Templates, select the desired templates.
    The selected Templates section displays the chosen templates.
  7. Click Assign.
    The template gets assigned to the selected device.

After assigning the template to a resource for monitoring, click Get Latest Metric Values to view the latest metric information.

Step 5: View graphs

OpsRamp Gateway monitors the remote system using the assigned templates and displays the results in a graphical format.

To view the monitoring graphs:

  1. From the left pane, click Infrastructure.
    The Infrastructure screen of the selected client appears.
  2. From Resources tab, select a required resource from the list of resources. Alternatively, use the search option to locate the resource.
  3. Click the resource name to view details.
  4. From the left pane, click Metrics.
    The Metrics page displays graphs generated by all monitoring templates assigned to a device. 
  5. Search with the desired template name to filter the graphs.
Custom PowerShell Graphs

Custom PowerShell Graphs

Set up agentless custom monitors via Remote Script Executor monitors

Using Remote Script Executor, you can execute scripts on both Linux and Windows workstations with different script types.

Key highlights

  • User-defined external arguments support to the script through custom attributes.
  • Monitor Level script execution – Ability to pull more metrics in a single script execution.
  • Ability to execute different types of scripts through custom script options apart from default options.
  • Able to use Credentials attached to the device in the script using the dynamic macro’s support.
  • The monitoring of Windows Workstations through Linux Gateway is not supported.

Prerequisite:

OpsRamp Gateway version 7.0.0 supports Remote Script Executor monitoring.

Monitoring using Remote Script Executor includes the following steps:

  1. Create Metrics
  2. Create a custom Remote Script Executor monitor and add the corresponding metrics of the same type
  3. Create a template with Remote Script Executor monitor
  4. Assign the template to a device
  5. Get the latest metric value
  6. View Graphs

Step 1: Create metrics

Metrics provide the metadata to correlate the script output and must match the metricsNames added to the Monitor.

  1. From All Clients, select a client.
  2. Go to Setup > Monitoring > Metrics.
    METRICS screen appears.
  3. From METRICS, click + Add and provide the following:
    • Metric Scope: Select Partner Metric or Client Specific Metric
    • Adaptor Type: Select Application.
    • Application Type: Select Remote Script Executor.
    • Name: Refers to the unique Name for the metric.
      OpsRamp recommends <vendorname>.<application name>.<component>.<metric> as naming convention for the metric. For example, apache.tomcat.webapps.count.
    • Tag Name: Refers to the user-defined tags for better filtering.
    • Display Name: Provide Display Name. For example, System Drive Free Space.
    • Description: Provide the purpose of the metric.
    • Data Point type: Refers to the value chosen to plot data in the graph.
    • Units: Refers to the required values for Units. You can choose Units depending on the chosen Data Point Type.
    • Unit Multiplication Factor: Refers to the value chosen to multiply a value based on the chosen unit.
    • Data Point Conversion: Refers to one of the following options:
      • Value: To populate data via values.
      • Enumerated Map: To populate alert and graph details after adding the states such as Up or Down. The screen displays an additional section where you can add the state descriptions and select Alerts and Graphs to populate data.
    • Metric Processing: Refers to one of the following values for processing the Metric:
      • Notification
      • Graph
      • Graph and Notification.
      • To configure values for Graph and Notification:
        • Warning if value: Refers to the warning threshold value.
        • Critical if value: Refers to the critical threshold value.
        • Subject: Refers to the subject for the metric.
        • Description: Refers to the description for the metric.
  4. Click Save.
Remote Script Executor Create Metric

Remote Script Executor Create Metric

Step 2: Create monitor

Custom Remote Script Executor Monitor is a collection of Remote Script Executor metrics. You can create a template using the Remote Script Executor monitor.

Prerequisites:

Add the required custom parameters.

Macros in Remote Script Executor

Macros are implemented to address the passing of dynamic arguments to scripts. Use the following macros to make available native attributes and custom attribute defined on the resource, within the script:

Static macros

Using the Static Macros, OpsRamp overrides the values that you provide in the script.

Description of static macros

Static Macros
MacroDescription
${resource.ipaddress}The IP address of the device
${resource.mac}Mac address of the device
${resource.serialno}Serial Number of  the device
${resource.make}Make of the device
${resource.model}Model of the device.
${resource.hostname}The hostname of the device
${resource.uniqueid}UniqueId of the device
${resource.os}Operating System of the device

Dynamic macros

Using Dynamic Macros, you can perform the following actions:

  • Get custom attributes of the device – If you want to use an argument in any script, you can apply the custom attributes to the device.
    Syntax: ${customattributes.customAttributekey}. For example, you have a custom Attribute on the device with Key: serviceName and Value: oracledb. During runtime, the Value: oracledb replaces the macro: ${customattributes.serviceName} in the script.
  • Get the credentials added to the device – You can use (macros) credentials in the script to avoid keeping the original username and password in plain text. The macros replace the original credentials when you execute the script.
    Syntax: ${credentials.CredentialName.credentialField}. For example, you define a Credential set of Name JMXCred and added to a device. You can use the macro ${credentials.JMXCred.username} in your script. The macro replaces the original credentials in your script at runtime.

Script execution path for configuration parameters in Linux and Windows

GatewayTarget Platform
Script TypeLinux/SSHWindows
Linux GatewayBashbash -sNot Applicable
PowershellNot ApplicableNot Applicable
Pythonpython -Not Applicable
PerlPerl - -Not Applicable
Windows GatewayBashbash -s
PowershellNot Applicablepowershell.exe
Pythonpython -python.exe
PerlPerl - -perl.exe

If your runtime is not set as an environment variable, mention the absolute path of your runtime. For example, if Python is not set as an environment variable, provide the absolute path of Python such as /usr/lib/python.

Create Monitor

To create a custom Remote Script Executor monitor:

  1. From All Clients, select a client.
  2. Go to Setup > Monitoring > Monitors.
    MONITORS screen appears.
  3. From Monitors, click + Add.
    CREATE A MONITOR screen appears.
  4. From CREATE A MONITOR, provide the details for the following parameters and click Save.
    • Monitor Scope: Select either Partner Monitor or Client Specific Monitor.
    • Type: Select Application.
    • Application Type: Select Remote Script Executor.
    • Name: Provide a unique name for the metric.
    • Description: Provide the purpose of creating the monitor.
    • Script: Refers to the custom script in the Script text box. You can refer to sample script and JSON output formats to view the sample script.
    • Metrics: To add Metrics:
      1. From Metrics, click Add Metrics. Metrics screen appears.
      2. Search the desired metric and click Add Metrics. The Metrics section displays the selected metric.
      3. After adding the metrics, navigate to Configuration Parameters.
    • Configuration Parameters: To add configuration Parameters:
    1. Provide Default Value for all the configuration parameters.
    2. Select the Configurable checkbox.
    3. Click +Add.
      Configuration Parameters screen appears.
    4. Provide Configuration Parameters depending on the selected script type.
      You can view the default value for the respective Name selected.
      Note: If you select the Custom value in Configuration Parameters, add the configuration parameter: custom.script.execution.path.
      MONITORS screen displays the new monitor.
Remote Script Executor Monitor

Remote Script Executor Monitor

Step 3: Create template

A template is an instance of a monitor and is applied to devices.

To create a template:

  1. From All Clients, select a client.
  2. Go to Setup > Monitoring >Templates.
    TEMPLATES screen appears.
  3. Click + Add.
    MONITOR TEMPLATE screen appears.
  4. From MONITOR TEMPLATE, provide the details for the following parameters and click Save.
    • Select Template Scope: Refers to the Template type.
    • Collector Type: Select Gateway.
    • Monitor Type: Select Monitors for G2 Templates.
    • Applicable for: Select Device.
    • Template Name: Refers to the name of the template.
    • Description: Refers to the summary of the template.
    • Generation: Refers to the generation that the template belongs to.
    • Tags: Refers to the user-defined tags for better filtering.
    • Prerequisites: Refers to the essential things that you must consider while monitoring using the template. For example, check the SQL services while monitoring the SQL Parameters using the Windows templates.
    • Status: Refers to the Active or End-of-life templates.
    • Notes: Refers to the additional information that you want to add to the template.
    • Template Family Name: Refers to the category that applies to the application. For example, Windows Server, Storage Server, and Network Server.
    • Deployment Type: Refers to one of the following methods to apply the template to the resources:
      • Custom
      • Optional
      • Standard
  5. After providing the template details, MONITOR TEMPLATE displays the Monitors section.
    Note: The user interface for the Monitors section varies with the option selected in the Collector Type.
    • Monitor: To add details in Monitors:
    1. From the Monitors section, click Add.
      The monitor screen appears.
    2. Provide details for the following parameters:
      • Frequency: Refer to the frequency to execute the template.
      • Monitor Definition: Refers to the monitor type.
      • When to Alert: Select Breach of a Threshold.
    3. Select Availability and Alert check box to initiate monitoring.
      The TEMPLATES section displays the configured details.

Assign template to a device

You need to create credentials to assign a template to a device.

Prerequisite

Assign Credentials to access the required device and assign the template.

Creating credentials

To create credentials:

  1. From All Clients, select a client.
  2. Go to Infrastructure > Resources.
  3. From the list of devices, select a device. Navigates to the device information page.
  4. From the center pane, click Credentials. Credentials screen appears.
  5. Click +Add.
    Create new credential screen appears.
  6. From Create new credential, provide details for the following parameters and click Save:
    • Name: Refers to the name of the credential.
    • Description: Refers to the description of the new credential.
    • Type: Refers to the application type. Select Windows.
    • Username: Refers to the username for the credential set.
    • Password: Refers to the password that you set for the credential set.
    • Confirm Password: Provide the same password.
    • Port: Refers to the port used to connect to the application.
    • Connection Time Out (ms): Refers to the time taken for the resource to connect to the application.
      The Credentials screen displays the new credentials

Assigning template

To assign a template to a device:

  1. From the left pane, click Infrastructure.
    The Infrastructure screen of the selected client appears.
  2. From the Resources tab, select a required resource from the list of resources. Alternatively, use the search option to locate the resource.
  3. Click the resource name to view details.
  4. From the left pane, click Monitors.
    Templates tab appears.
  5. From Templates tab, click +Assign Templates. Apply Templates screen appears.
  6. From Apply Templates, select the desired templates.
    The selected Templates section displays the chosen templates.
  7. Click Assign.
    The template gets assigned to the selected device.

After assigning the template to a resource for monitoring, you can click Get Latest Metric Values to view the latest metric information.

Viewing graphs

OpsRamp Gateway monitors the remote system using the assigned templates and displays the results in a graphical format.

To view the monitoring graphs:

  1. From the left pane, click Infrastructure.
    The Infrastructure screen of the selected client appears.
  2. From the Resources tab, select a required resource from the list of resources. Alternatively, use the search option to locate the resource.
  3. Click the resource name to view details.
  4. From the left pane, click Metrics.
    The Metrics page displays graphs generated by all monitoring templates assigned to a device.
  5. Search with the desired template name to filter the graphs.
Graphical Representation

Graphical Representation

Troubleshooting

  • The device is accessible to the Gateway
  • The appropriate port is available from the remote server.
  • Must not support the monitoring of Windows Workstations through Linux Gateway.

Sample: Bash scripts

In these samples:

  • Datapoints are used for plotting graphs.
  • Tokens are used for alert information.
system_load=`cat /proc/loadavg | awk '{print $2}'`
printf "{\n\"datapoints\":{\n\t\"System Load\" : %s\n},\n\"tokens\": {\n\t\"Current System Load\" : \"%s\"\n}\n}\n" "${system_load}" "${system_load}"

Bash single datapoint and token

This sample is a JSON output for a single datapoint and token.

{
"datapoints":{
	"System Load" : 1.60
},
"tokens": {
	"Current System Load" : "1.60"
}
}

Bash multiple datapoints and tokens

This sample is a JSON output for multiple datapoints and tokens.

{
   "datapoints":{
           "DiskC" : 50,
           "DiskD" : 81
   },
   "tokens": {
           "disk_utilization.total" : "DiskC : 40 GB, DiskD : 100 GB",
           "disk_utilization.used" : "DiskC : 20 GB, DiskD : 50 GB"
   }
}

Sample: PowerShell script

$Disk = Get-WMIObject Win32_Logicaldisk -filter "deviceid='C:'"
$DiskUtil = ((($Disk.Freespace /1Gb -as [float]) / ($Disk.Size / 1Gb -as [float]))*100) -as [int]
$TotalSpaceUtilized = 100 - $DiskUtil
write-host @" { "datapoints": { "DiskC": $TotalSpaceUtilized }}"@

PowerShell single instance

In this sample, JSON output is provided for a single instance.

{
"datapoints" : {
    "DiskC" : 50,
    "DiskD" : 81
    }
}

PowerShell multiple instances

In this sample, JSON output is provided for multiple instances.

{
  "datapoints" : {
    "DiskC" : 50,
    "DiskD" : 81
    }
  "alerttokens": {
    "disk_utilization.total" : "DiskC : 40 GB, DiskD : 100 GB",
    "disk_utilization.used" : "DiskC : 20 GB, DiskD : 50 GB"
    }
}

Sample: Remote script executor script

#!/bin/bash

CPU=$(top -bn1 | grep load | awk ‘{printf “%.2f\t\t\n”, $(NF-2)}’)
MEMORY=$(free -m | awk ‘NR==2{printf “%.2f\t\t”, $3*100/$2 }’)
DISK=`df -h | awk ‘$NF==”/”{ print $5}’ | sed ‘s/%//g’`

printf “{\”disk.utilization\” : %s , \”memory.utilization\” : %s , \”cpu.usage\” : %s}” “$DISK” “$MEMORY” “$CPU”

Output :

{“disk.utilization” : 23 , “memory.utilization” : 24.28 , “cpu.usage” : 0.64 }

standard JSON Output formats: Remote script executor script

Format 1
{
“Metric1”: 98,
“Metric2”: 70,
“Metric3”: 80
}
Format 2
{
“Metric1”: 98,
“Metric2”: “STATE”,
“Metric3”: 80
}
}
Format 3
{
    "MetricName1": {
        "components": {
            "component1": 70,
            "component2": 98
        }
    },
    "MetricName2": {
        "components": {
            "component1": 77,
            "component2": 98
        }
    }
}
Format 4
alertTokens: Using alertTokens, you can add more information to the alert Subject and Description.

{
    "MetricName1": {
        "components": {
            "component1": "STATE",
            "component2": 98
        },
        "alertTokens": {
            "token1": "value",
            "token2": "value2"
        }
    },
    "MetricName2": {
        "components": {
            "component1": 77,
            "component2": 98
        },
        "alertTokens": {
            "token1": "value",
            "token2": "value2"
        }
    }
}
Format 5

{
    "MetricName1": 254,
    "MetricName2": {
        "components": {
            "comp1": 90,
            "comp2": 60
        }
    },
    "MetricName3": {
        "components": {
            "component1": "STATE",
            "component2": 98
        },
        "alertTokens": {
            "token1": "value",
            "token2": "value2"
        }
    }
}