Manages RPM/SLA probes on the network device.
codeauthor: | Mircea Ulinic <mircea@cloudflare.com> & Jerome Fleury <jf@cloudflare.com> |
---|---|
maturity: | new |
depends: | napalm |
platform: | unix |
New in version 2016.11.0.
salt.modules.napalm_probes.
config
(*args, **kwargs)¶Returns the configuration of the RPM probes.
Returns: | A dictionary containing the configuration of the RPM/SLA probes. |
---|
CLI Example:
salt '*' probes.config
Output Example:
{
'probe1':{
'test1': {
'probe_type' : 'icmp-ping',
'target' : '192.168.0.1',
'source' : '192.168.0.2',
'probe_count' : 13,
'test_interval': 3
},
'test2': {
'probe_type' : 'http-ping',
'target' : '172.17.17.1',
'source' : '192.17.17.2',
'probe_count' : 5,
'test_interval': 60
}
}
}
salt.modules.napalm_probes.
delete_probes
(*args, **kwargs)¶Removes RPM/SLA probes from the network device. Calls the configuration template 'delete_probes' from the NAPALM library, providing as input a rich formatted dictionary with the configuration details of the probes to be removed from the configuration of the device.
Parameters: |
|
---|---|
Raises: | MergeConfigException -- If there is an error on the configuration sent. |
Returns: | A dictionary having the following keys: |
Input example:
probes = {
'existing_probe':{
'existing_test1': {},
'existing_test2': {}
}
}
salt.modules.napalm_probes.
results
(*args, **kwargs)¶Provides the results of the measurements of the RPM/SLA probes.
:return a dictionary with the results of the probes.
CLI Example:
salt '*' probes.results
Output example:
{
'probe1': {
'test1': {
'last_test_min_delay' : 63.120,
'global_test_min_delay' : 62.912,
'current_test_avg_delay': 63.190,
'global_test_max_delay' : 177.349,
'current_test_max_delay': 63.302,
'global_test_avg_delay' : 63.802,
'last_test_avg_delay' : 63.438,
'last_test_max_delay' : 65.356,
'probe_type' : 'icmp-ping',
'rtt' : 63.138,
'last_test_loss' : 0,
'round_trip_jitter' : -59.0,
'target' : '192.168.0.1',
'source' : '192.168.0.2'
'probe_count' : 15,
'current_test_min_delay': 63.138
},
'test2': {
'last_test_min_delay' : 176.384,
'global_test_min_delay' : 169.226,
'current_test_avg_delay': 177.098,
'global_test_max_delay' : 292.628,
'current_test_max_delay': 180.055,
'global_test_avg_delay' : 177.959,
'last_test_avg_delay' : 177.178,
'last_test_max_delay' : 184.671,
'probe_type' : 'icmp-ping',
'rtt' : 176.449,
'last_test_loss' : 0,
'round_trip_jitter' : -34.0,
'target' : '172.17.17.1',
'source' : '172.17.17.2'
'probe_count' : 15,
'current_test_min_delay': 176.402
}
}
}
salt.modules.napalm_probes.
schedule_probes
(*args, **kwargs)¶Will schedule the probes. On Cisco devices, it is not enough to define the probes, it is also necessary to schedule them.
This function calls the configuration template schedule_probes
from the
NAPALM library, providing as input a rich formatted dictionary with the
names of the probes and the tests to be scheduled.
Parameters: |
|
---|---|
Raises: | MergeConfigException -- If there is an error on the configuration sent. |
Returns: | a dictionary having the following keys: |
Input example:
probes = {
'new_probe':{
'new_test1': {},
'new_test2': {}
}
}
salt.modules.napalm_probes.
set_probes
(*args, **kwargs)¶Configures RPM/SLA probes on the device. Calls the configuration template 'set_probes' from the NAPALM library, providing as input a rich formatted dictionary with the configuration details of the probes to be configured.
Parameters: |
|
---|---|
Raises: | MergeConfigException -- If there is an error on the configuration sent. |
Return a dictionary having the following keys: | |
|
Input example - via state/script:
probes = {
'new_probe':{
'new_test1': {
'probe_type' : 'icmp-ping',
'target' : '192.168.0.1',
'source' : '192.168.0.2',
'probe_count' : 13,
'test_interval': 3
},
'new_test2': {
'probe_type' : 'http-ping',
'target' : '172.17.17.1',
'source' : '192.17.17.2',
'probe_count' : 5,
'test_interval': 60
}
}
}
set_probes(probes)
CLI Example - to push cahnges on the fly (not recommended):
salt 'junos_minion' probes.set_probes "{'new_probe':{'new_test1':{'probe_type':'icmp-ping', 'target':'192.168.0.1','source':'192.168.0.2','probe_count':13,'test_interval':3}}}" test=True
Output example - for the CLI example above:
junos_minion:
----------
already_configured:
False
comment:
Configuration discarded.
diff:
[edit services rpm]
probe transit { ... }
+ probe new_probe {
+ test new_test1 {
+ probe-type icmp-ping;
+ target address 192.168.0.1;
+ probe-count 13;
+ test-interval 3;
+ source-address 192.168.0.2;
+ }
+ }
result:
True