Overview

This tutorial demonstrates how to use the Element Service Set to obtain the network element process attributes, such as process ID, name, CPU and memory utilization.

Tutorial Code

The code used in this tutorial is available in the ElementProcessTutorial.py file located under <SDK Location>/python/tutorials/element.

Requirements/Prerequisites

These steps assume the application can connect properly to a network element. Please see the Connecting to a Network Element tutorial for information on how to make the initial connection.

Steps In Detail

Get an Element Process

Create a connection to the network element. Get a process element of the network element.

logger.info("Allocated Memory - %s", element_process.allocatedMemory)

Element Process Attributes

Get the allocated memory of the element process of the network element.

logger.info("Allocated Memory - %s", element_process.allocatedMemory)

Get the CPU utilization of the element process of the network element.

logger.info("CPU utilization - %s", element_process.cpuUsage)

Get the freed memory of the element process of the network element.

logger.info("Freed Memory - %s", element_process.freedMemory)

Get the process ID (PID) of the element process of the network element.

logger.info("Process ID - %s", element_process.processID)

Get the process name of the element process of the network element.

logger.info("Process Name - %s", element_process.processName)

Get the used memory of the element process of the Network Element

logger.info("Used Memory - %s", element_process.heldMemory)

Result

Congratulations! Now you are able to get the process and the process attributes of the network element.

To try out this tutorial code by compiling and running it, you can find the code located at: <SDK Location>/python/tutorials/element/ElementProcessTutorial.py.