Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Examples: Monitors

This section assumes that Test Agents (as many as are required by the monitors) have been created according to the section Creating and Deploying a New Test Agent.

YANG Model Paths for Monitors

Item YANG model path: /accounts/account/monitors ...
monitors /.
monitor[name] /monitor
name /monitor/name
description /monitor/description
started /monitor/started
template /monitor/template
alarm-configs /monitor/alarm-configs
Item YANG model path: /accounts/account/monitors/monitor/alarm-configs ...
alarm-config[identifier] /alarm-config
identifier /alarm-config/identifier
template /alarm-config/template
email /alarm-config/email
snmp /alarm-config/snmp
thr-es-critical /alarm-config/thr-es-critical
thr-es-critical-clear /alarm-config/thr-es-critical-clear
thr-es-major /alarm-config/thr-es-major
thr-es-major-clear /alarm-config/thr-es-major-clear
thr-es-minor /alarm-config/thr-es-minor
thr-es-minor-clear /alarm-config/thr-es-minor-clear
thr-es-warning /alarm-config/thr-es-warning
thr-es-warning-clear /alarm-config/thr-es-warning-clear
no-data-severity /alarm-config/no-data-severity
no-data-timeout /alarm-config/no-data-timeout
action /alarm-config/action
window-size /alarm-config/window-size
interval /alarm-config/interval
send-only-once /alarm-config/send-only-once
snmp-trap-per-stream /alarm-config/snmp-trap-per-stream
Item YANG model path: /accounts/account/monitors ...
parameters /monitor/parameters
Item YANG model path: /accounts/account/monitors/monitor/parameters ...
parameter[key] /parameter
key /parameter/key
(value-type) /parameter
:(integer) /parameter
integer /parameter/integer
:(float) /parameter
float /parameter/float
:(string) /parameter
string /parameter/string
:(test-agent-interfaces) /parameter
test-agent-interfaces /parameter/test-agent-interfaces
test-agent-interface[1] /parameter/test-agent-interfaces/
account /parameter/test-agent-interfaces/test-agent-interface/account
test-agent /parameter/test-agent-interfaces/test-agent-interface/test-agent
interface /parameter/test-agent-interfaces/test-agent-interface/interface
ip-version /parameter/test-agent-interfaces/test-agent-interface/ip-version
:(twamp-reflectors) /parameter
twamp-reflectors /parameter/twamp-reflectors
twamp-reflector[name] /parameter/twamp-reflectors/twamp-reflector
name /parameter/twamp-reflectors/twamp-reflector/name
:(y1731-meps) /parameter
y1731-meps /parameter/y1731-meps
y1731-mep[name] /parameter/y1731-meps/y1731-mep
name /parameter/y1731-meps/y1731-mep/name
:(sip-accounts) /parameter
sip-accounts /parameter/sip-accounts
sip-account[2] /parameter/sip-accounts/sip-account
account /parameter/sip-accounts/sip-account/account
test-agent /parameter/sip-accounts/sip-account/test-agent
interface /parameter/sip-accounts/sip-account/interface
sip-address /parameter/sip-accounts/sip-account/sip-address
:(iptv-channels) /parameter
iptv-channels /parameter/iptv-channels
iptv-channel[name] /parameter/iptv-channels/iptv-channel
name /parameter/iptv-channels/iptv-channel/name
  1. account test-agent interface

  2. account test-agent interface sip-address

Item YANG model path: /accounts/account/monitors ...
status /monitor/status
last-15-minutes /monitor/status/last-15-minutes
status /monitor/status/last-15-minutes/status
status-value /monitor/status/last-15-minutes/status-value
last-hour /monitor/status/last-hour
status /monitor/status/last-hour/status
status-value /monitor/status/last-hour/status-value
last-24-hours /monitor/status/last-24-hours
status /monitor/status/last-24-hours/status
status-value /monitor/status/last-24-hours/status-value
templates /templates
template[name] /templates/template
name /templates/template/name
description /templates/template/description
parameters /templates/template/parameters
parameter[key] /templates/template/parameters/parameter
key /templates/template/parameters/parameter/key
type /templates/template/parameters/parameter/type

Prerequisites for Monitor Orchestration

Before you can start a monitor through NETCONF using ncclient, you need to build a monitor template in the Control Center GUI as explained in the in-app help under "Tests and monitors" > "Creating templates". All fields specified as "Template input" in that template will be required as parameters in the XML when orchestrating the initiation of the template.

Getting Input Parameters from Monitor Templates

Below, two templates are shown. The first is for UDP monitoring between two Test Agent interfaces, and the second is for HTTP using a single Test Agent interface.

To find out the input parameters of a template, click the box representing the template. For the HTTP template, the parameters may look like this:

We need to define these parameters in the next step when starting a monitor.

Starting a Monitor

Using the Test Agents that we defined and deployed in the section Creating and Deploying a New Test Agent, we can start a monitor from the template "HTTP" as shown below.

For each parameter, the <key> attribute needs to be supplied. The key is identical to the parameter's Variable name in Control Center. You can inspect variable names as follows:

  • Click Monitoring on the side bar and select New Monitor.
  • Click My Templates.
  • Click the Edit link below the template of interest.
  • Click the Edit input button in the top right corner.

In our example, and by default, the variable names are simply lowercase versions of the display names seen in Control Center ("url" vs. "URL", etc.). However, in the Control Center GUI, you can rename the variables to whatever you like.

Besides the key, each parameter needs to have its type specified: for example, <string> for the URL. Please note that full information on the parameter type is found in the YANG model. For Test Agent interfaces the type has a more complex structure, as evidenced in the code below.

In the example that follows, no alarm is associated with the monitor. For examples involving alarms, go to the section Starting a Monitor with an Alarm.

Run this script using ncclient. Provided that all is correct, the monitor will be initiated and started:

Starting a Monitor with an Alarm

To associate an alarm with a monitor, you can either point to an alarm template that has been defined, or you can supply the entire alarm configuration when creating the monitor. We will give one example of each approach below.

Setting Up a Monitor Alarm by Pointing to an Alarm Template

In order to make use of an alarm template, you must know its ID. To this end, first retrieve all your alarm templates as described in the section Retrieving All Alarm Templates and note the name of the relevant template. You can then refer to that template as follows:

Setting Up a Monitor Alarm by Configuring It Directly

Alternatively, you can set up an alarm for a monitor by supplying its entire configuration when creating the monitor, without referring to an alarm template. This is done as shown in the following example.

Retrieving Running Monitors

To retrieve all monitors that are currently executing, run this script:

The output is a list of all running monitors as shown below:

Retrieving SLA Status for a Monitor

Here is how to retrieve the SLA status for a monitor. In this example, we are retrieving the SLA status for the monitor "Network Quality" for three intervals of time: the last 15 minutes, the last hour, and the last 24 hours.

The output will look something like this:

NETCONF Notifications

NETCONF notifications for monitors are triggered by SLA violations. These occur when the SLA for the monitor drops below an SLA threshold ("Good" or "Acceptable") within a given time window, by default the last 15 minutes. It should be noted that SLA violation notifications are quick to appear after a service is impacted by an issue, while the SLA status will revert to "Good" only after 15 minutes, and only if no further violations occur.

The time window can be changed by editing the setting SLA_STATUS_WINDOW (value in seconds) in /etc/netrounds/netrounds.conf.

Exporting and Importing Monitor Templates

This is done in exactly the same way as for test templates; compare the section Exporting and Importing Test Templates. The code snippets below illustrate how to export and import templates for monitors.

Exporting Monitor Templates

Importing Monitor Templates