11. Generic Probes and Backend

The following section present some generic probes that inherit from framework.monitor.Probe. They can be used within your project files (refer to Defining a Project Environment) by inheriting from them and providing the expected parameters. Besides, you have to provide them with a means to access the monitored system, namely a framework.monitor.Backend. Note that you can use the same backend for simultaneous probes.

See also

To define your own probe refer to Defining Probes.

Let’s illustrate this with the following example where two probes are used to monitor a process through an SSH connection. One is used to check if the PID of the process has changed after each data sending, and the other one to check if the memory used by the process has exceeded its initial memory footprint by 5% (with a probing period of 0.2 second).

The project file should look like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
  # Assuming your Project() is referred by the 'project' variable

  ssh_backend = SSH_Backend(username='user', password='pass',
                            sshd_ip='127.0.0.1', sshd_port=22)

  @blocking_probe(project)
  class health_check(ProbePID):
      process_name = 'the_process_to_monitor'
      backend = ssh_backend

  @probe(project)
  class probe_mem(ProbeMem):
      process_name = 'the_process_to_monitor'
      tolerance = 5
      backend = ssh_backend

  targets = [ (YourTarget(), probe_pid, (probe_mem, 0.2)) ]

11.1. Generic Backend

See also

Refer to the class documentation for more details.

11.1.1. SSH_Backend

Reference:
framework.monitor.SSH_Backend
Description:
This generic backend enables you to interact with a monitored system through an SSH connection.

11.1.2. Serial_Backend

Reference:
framework.monitor.Serial_Backend
Description:
This generic backend enables you to interact with a monitored system through an serial line.

11.1.3. Shell_Backend

Reference:
framework.monitor.Shell_Backend
Description:
This generic backend enables you to interact with a local monitored system through a shell.

11.2. Generic Probes

See also

Refer to the class documentation for more details.

11.2.1. ProbePID

Reference:
framework.monitor.ProbePID
Description:
This generic probe enables you to monitor any modification of a process PID, by specifying its name through the parameter process_name.

11.2.2. ProbeMem

Reference:
framework.monitor.ProbeMem
Description:
Generic probe that enables you to monitor the process memory (RSS…) consumption. It can be done by specifying a threshold and/or a tolerance ratio.