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 # Assuming your Project() is referred by the 'project' variable 2 3 ssh_backend = SSH_Backend(username='user', password='pass', 4 sshd_ip='127.0.0.1', sshd_port=22) 5 6 @blocking_probe(project) 7 class health_check(ProbePID): 8 process_name = 'the_process_to_monitor' 9 backend = ssh_backend 10 11 @probe(project) 12 class probe_mem(ProbeMem): 13 process_name = 'the_process_to_monitor' 14 tolerance = 5 15 backend = ssh_backend 16 17 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:
- Description:
This generic backend enables you to interact with a monitored system through an SSH connection.
11.1.2. Serial_Backend¶
- Reference:
- Description:
This generic backend enables you to interact with a monitored system through an serial line.
11.1.3. Shell_Backend¶
- Reference:
- 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:
- 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:
- Description:
Generic probe that enables you to monitor the process memory (RSS…) consumption. It can be done by specifying a
threshold
and/or atolerance
ratio.
11.2.3. ProbeCmd¶
- Reference:
- Description:
Generic probe that enables you to execute shell commands and retrieve the output.