Default Services¶
Ansible Playbook Service¶
An Ansible Playbook service sends an ansible playbook to the devices.
The output can be validated with a command / pattern mechanism, like the Netmiko Validation Service.
Configuration parameters for creating this service instance:
Playbook Pathpath and filename to the Ansible Playbook. The location for displaying playbooks is configurable in eNMS settings.Argumentsansible-playbook command line options, which are documented here: (https://docs.ansible.com/ansible/latest/cli/ansible-playbook.html)Pass device properties to the playbookPass inventory properties using –extra-vars to the playbook if checked (along with the options dictionary provided below). All device properties are passed such asdevice.nameordevice.ip_addressoptionsAdditional –extra-vars to be passed to the playbook using the syntax {‘key1’:value1, ‘key2’: value2}. All inventory properties are automatically passed to the playbook using –extra-vars (if pass_device_properties is selected above). These options are appended.- Ansible itself supports a number of standard return codes; these are returned in the results of the service and include:
- 0 : OK or no hosts matched
- 1 : Error
- 2 : One or more hosts failed
- 3 : One or more hosts were unreachable
- 4 : Parser error
- 5 : Bad or incomplete options
- 99 : User interrupted execution
- 250 : Unexpected error
Note
This Service supports variable substitution (as mentioned in the previous section) in the arguments and options input fields of its configuration form.
Netmiko Services¶
The Netmiko services provide the ability to perform multiple actions through an SSH connection. Below are the values common to each Netmiko service and the specifics for each are in their own sections.
Common Netmiko Parameters¶
DriverThis selects which Netmiko driver to use when connecting to the device. This is not used ifUse Device Driveris checked.Use Device DriverIf checked, the driver assigned to the device in the inventory will be used.Enable modeIf checked, Netmiko should enter enablepriviledged mode on the device before applying the above configuration block. For the Linux driver, this means root/sudo.Config modeIf checked, Netmiko should enter config modeFast CLIIf checked, Netmiko will disable internal wait states and delays in order to execute the service as fast as possible.TimeoutNetmiko internal timeout in seconds to wait for a connection or response before declaring failure.Delay factorNetmiko multiplier used to increase internal delays (defaults to 1). Delay factor is used in the send_command Netmiko method. See here for more explanation: (https://pynet.twb-tech.com/blog/automation/netmiko-what-is-done.html)Global delay factorNetmiko multiplier used to increase internal delays (defaults to 1). Global delay factor affects more delays beyond Netmiko send_command. Increase this for devices that have trouble buffering and responding quickly.
Jump on connect Parameters¶
Jump on connect is designed to allow a second connection after connecting to the original device.
Jump to remote device on connectIf checked, the config items below will be processed for connection to the secondary device.Command that jumps to deviceCommand to initiate secondary connectionExpected username promptPrompt expected when connecting secondary connectionDevice usernameThe username to send when the expected username prompt is detectedExpected password promptPrompt expected when connecting secondary connectionDevice passwordThe password to send when the expected password prompt is detectedExpected prompt after loginPrompt expected after successfully negotiating a connectionCommand to exit device back to original deviceCommand required to exit the secondary connection
Netmiko Configuration Service¶
Uses Netmiko to send a list of commands to be configured on the devices.
Configuration parameters for creating this service instance:
- All Common Netmiko Parameters (see above)
ContentPaste a configuration block of text here for applying to the target device(s)Commit ConfigurationCalls netmikocommitfunction of the driver to commit the configurationExit config modeDetermines whether or not to exit config mode after completeConfig Mode CommandThe command that will be used to enter config mode- Advanced Netmiko Parameters
Strip commandRemove the echo of the command from the output (default: True)Strip promptRemove the trailing router prompt from the output (default: True)
Note
This Service supports variable substitution (as mentioned in the previous section) in the content input field of its configuration form.
Netmiko File Transfer Service¶
Uses Netmiko to send a file to a device, or retrieve a file from a device. Only Cisco IOS and some Juniper devices are supported at this time for SCP file transfer.
Configuration parameters for creating this service instance:
- All Common Netmiko Parameters (see above)
Source fileSource absolute path and filename of the file to sendDestination fileDestination file; absolute path and filename to send the file toFile systemMounted filesystem for storage on the default. For example, disk1:DirectionUpload or Download from the perspective of running on the deviceDisable_md5Disable checksum validation following the transferInline_transferCisco specific method of transferring files between internal components of the deviceOverwrite_fileIf checked, overwrite the file at the destination if it exists
Netmiko Data Backup Service¶
This service uses Netmiko to send commands to store information from devices.
Target Property and Commands¶
- Property to update (e.g
Configuration) Commands- This is a series of twelve commands that are used to pull data from the device.LabelThis is the label the data will be given in the results
Search Response and Replace¶
- Used to filter out unwanted information
PatternThe pattern to search through the retrieved data to replaceReplace WithThis is what will be substituted when thepatternis found.
Netmiko Prompts Service¶
Similar to Netmiko Validation Service, but expects up to 3 interactive prompts for your remote command, such as ‘Are you sure? Y/N’. This service allows the user to specify the expected prompt and response to send for it.
Configuration parameters for creating this service instance:
- All Common Netmiko Parameters (see above)
CommandCLI command to send to the deviceConfirmation1Regular expression to match first expected confirmation question prompted by the deviceResponse1response to first confirmation question prompted by the deviceConfirmation2Regular expression to match second expected confirmation question prompted by the deviceResponse2response to second confirmation question prompted by the deviceConfirmation3Regular expression to match third expected confirmation question prompted by the deviceResponse3response to third confirmation question prompted by the device
Note
This Service supports variable substitution (as mentioned in the previous section) in the command input field of its configuration form.
Netmiko Validation Service¶
Uses Netmiko to send commands to a device and validates the output to determine the state of that device. See the Workflow
section for examples of how it is used in a workflow.
There is a command field and an expect string field in the Advanced Netmiko Parameters. eNMS will check if the
expected pattern can be found in the output of the command. The values for a pattern field can also be a regular expression.
Configuration parameters for creating this service instance:
- All Common Netmiko Parameters (see above)
- All Validation parameters (see above)
CommandCLI command to send to the device
Also included in Netmiko Advanced Parameters:
- Expect String This is the string that signifies the end of output.
- Auto Find Prompt Tries to detect the prompt automatically.
Note
Expect String and Auto Find Prompt are mutually exclusive; both cannot be enabled at the same time.
If the user does not expect Netmiko to find the prompt automatically, the user should provide the expected prompt instead.
Command to Enter Config ModeThe default command used to enter config mode is determined by the Netmiko driver. An alternate configuration mode entry command can be specified here to overrride the default. Examples are the Juniperconfig privateandconfig exclusivecommands that isolate configuration changes from other users.Strip commandRemove the echo of the command from the output (default: True).Strip promptRemove the trailing router prompt from the output (default: True).Use GenieUse Cisco’s Genie implementation to create structured data from cli commands. (Currently does not work with some vendors. Refer to this link to see which CLI commands are currently supported: https://developer.cisco.com/docs/genie-docs/)
Note
This Service supports variable substitution (as mentioned in the previous section) in the command input field of its configuration form.
Napalm Services¶
Napalm connections are SSH connections to equipment in which a pre-defined set of data is retrieved from the equipment and presented to the user in a structured (dictionary) format.
Napalm Common Parameters¶
DriverWhich Napalm driver to use when connecting to the deviceUse driver from deviceIf set to True, the driver defined at device level (napalm_driverproperty of the device) is used, otherwise the driver defined at service level (driverproperty of the service) is used.Optional argumentsNapalm supports a number of optional arguments that are documented here: (https://napalm.readthedocs.io/en/latest/support/index.html#optional-arguments)
Napalm Data Backup¶
This service uses Napalm to pull data from devices and store it for later comparison and for historical tracking.
- All Napalm Common Parameters (See Above)
Configuration Getters- Choose the configuration getter named ‘Configuration’
Napalm Configuration service¶
Uses Napalm to configure a device.
Configuration parameters for creating this service instance:
- All Napalm parameters (see above)
ActionThere are two types of operations:Load merge: add the service configuration to the existing configuration of the targetLoad replace: replace the configuration of the target with the service configuration
ContentPaste a configuration block of text here for applying to the target device(s)
Note
This service is supported by a limited set of products.
Note
This Service supports variable substitution (as mentioned in the previous section) in the content input field of its configuration form.
Napalm Getters service¶
Uses Napalm to retrieve a list of getters whose output is displayed in the logs. The output can be validated with a
command / pattern mechanism like the Netmiko Validation Service.
Configuration parameters for creating this service instance:
- All Validation parameters (see above)
- All Napalm parameters (see above)
GettersChoose one or more getters to retrieve; Napalm getters (standard retrieval APIs) are documented here: (https://napalm.readthedocs.io/en/latest/support/index.html#getters-support-matrix)
Note
This Service supports variable substitution (as mentioned in the previous section) in the content_match input field of its configuration form.
Napalm Ping service¶
Uses Napalm to connect to the selected target devices and performs a ping to a designated target. The output contains
ping round trip time statistics. Note that the iosxr driver does not support ping, but you can use the ios driver in its
place by not selecting Use_device_driver.
Configuration parameters for creating this service instance:
- All Napalm parameters (see above)
Count: Number of ping packets to sendSizeSize of the ping packet payload to send in bytesSource IP addressOverride the source ip address of the ping packet with this provided IPTimeoutSeconds to wait before declaring timeoutTtlTime to Live parameter, which tells routers when to discard this packet because it has been in the network too long (too many hops)VrfPing a specific virtual routing and forwarding interface
Napalm Rollback Service¶
Use Napalm to rollback a configuration.
Configuration parameters for creating this service instance:
- All Napalm parameters (see above)
Napalm Traceroute service¶
Uses Napalm to connect to the selected target devices and performs a traceroute to a designated target.
Configuration parameters for creating this service instance:
- All Napalm parameters (see above)
Source IP addressOverride the source ip address of the ping packet with this provided IPTimeoutSeconds to wait before declaring timeoutttlTime to Live parameter, which tells routers when to discard this packet because it has been in the network too long (too many hops)vrfPing a specific virtual routing and forwarding interface
REST Call Service¶
Send a REST call (GET, POST, PUT or DELETE) to a URL with optional payload.
The output can be validated with a command / pattern mechanism, like the Netmiko Validation Service.
Configuration parameters for creating this service instance:
Call TypeREST type operation to be performed: GET, POST, PUT, DELETERest UrlURL to make the REST connection toPayloadThe data to be sent in POST Or PUT operationParamsAdditional parameters to pass in the request. From the requests library, params can be a dictionary, list of tuples or bytes that are sent in the body of the request.HeadersDictionary of HTTP Header information to send with the request, such as the type of data to be passed. For example, {“accept”:”application/json”,”content-type”:”application/json”}Verify SSL CertificateIf checked, the SSL certificate is verified. Default is to not verify the SSL certificate.TimeoutRequests library timeout, which is the number of seconds to wait on a response before giving upUsernameUsername to use for authenticating with the REST serverPasswordPassword to use for authenticating with the REST server
Note
This Service supports variable substitution (as mentioned in the previous section) in the url and content_match input fields of its configuration form.
Generic File Transfer Service¶
Transfer a single file to/from the eNMS server to the device using either SFTP or SCP.
Configuration parameters for creating this service instance:
DirectionGet or Put the file from/to the target device’s filesystemProtocolUse SCP or SFTP to perform the transferSource fileFor Get, source file is the path-plus-filename on the device to retrieve to the eNMS server. For Put, source file is the path-plus-filename on the eNMS server to send to the device.Destination fileFor Get, destination file is the path-plus-filename on the eNMS server to store the file to. For Put, destination file is the path-plus-filename on the device to store the file to.Missing Host Key PolicyIf checked, auto-add the host key policy on the ssh connectionLoad Known Host KeysIf checked, load host keys on the eNMS server before attempting the connectionLook For KeysFlag that is passed to the paramiko ssh connection to indicate if the library should look for host keys or ignore.Source file includes glob pattern (Put Direction only)Flag indicates that for Put Direction transfers only, the above Source file field contains a Glob pattern match (https://en.wikipedia.org/wiki/Glob_(programming)) for selecting multiple files for transport. When Globing is used, the Destination file directory should only contain a destination directory, because the source file names will be re-used at the destination.Max Transfer SizeThis is that maximum packet size that will be used during transfer. This may adversely impact transfer times.Window SizeThis is the requested windows size during transfer. This may adversely impact transfer times.
Note
This Service supports variable substitution (as mentioned in the previous section) in the url and content_match input fields of its configuration form.
ICMPTCP Ping¶
Implements a Ping from this automation server to the selected devices from inventory using either ICMP or TCP.
Configuration parameters for creating this service instance:
Protocol: Use either ICMP or TCP packets to ping the devicesPorts (TCP ping only)Which ports to ping (should be formatted as a list of ports separated by a comma, for example “22,23,49”).Count: Number of ping packets to sendTimeoutSeconds to wait before declaring timeoutTtlTime to Live parameter, which tells routers when to discard this packet because it has been in the network too long (too many hops)Packet SizeSize of the ping packet payload to send in bytes
UNIX Command Service¶
Runs a UNIX command on the server where eNMS is installed.
Configuration parameters for creating this service instance:
- Command: UNIX command to run on the server
Note
This Service supports variable substitution (as mentioned in the previous section) in the url and content_match input fields of its configuration form.
UNIX Shell Service¶
Runs a BASH script on the server where eNMS is installed.
- Source Code Bash code to be run on the server.
Mail Notification Service¶
This service is used to send an automatically generated email to a list of recipients.
TitleSubject Line of the EmailSenderIf left blank, the email address set in thesettings.jsonwill be used.RecipientsA comma delimited list of recipients for the emailReply-to AddressIf left blank, the reply-to address fromsettings.jsonis used. If populated, this email will be used by anyone replying to the automated email notification.BodyThis is the body of the email.
Note
This Service supports variable substitution (as mentioned in the previous section) in the url and content_match input fields of its configuration form.
Mattermost Notification Service¶
This service will send a message to a mattermost server that is configured in the site settings.
ChannelThe channel the message will be posted toBodyThe body of the message that will be posted to the above channel
Note
This Service supports variable substitution (as mentioned in the previous section) in the url and content_match input fields of its configuration form.
Python Snippet Service¶
Runs any python code.
In the code, you can use the following variables / functions :
- log: function to add a string to the service logs.
- parent: the workflow that the python snippet service is called from.
- save_result: the results of the service.
Additionally, you can use all the variables and functions described in the “Advanced / Python code” section of the docs.
Configuration parameters for creating this service instance:
- Source code: source code of the python script to run.
Payload Extraction Service¶
Extract some data from the payload with a python query, and optionally post-process the result with a regular expression or a TextFSM template.
Configuration parameters for creating this service instance:
- Variable Name: name of the resulting variable in the results.
- Python Extraction Query: a python query to retrieve data from the payload.
- Post Processing: choose the type of post-processing: Use Value as Extracted, Apply Regular Expression(findall), or TextFSM template.
- Regular Expression/ TestFSM Template Text: regular expression or TextFSM template, depending on the value of the “Match Type1”.
- Operation Choose the operation type: Set/Replace, Append to a list, Extend List, Update dictionary
- Same fields replicated twice (2,3 instead of 1): the service can extract / post-process up to 3 variables.
Payload Validation Service¶
Extract some data from the payload, and validate it against a string or a dictionary. This is used for conducting extra validations of a prior service’s result later in a workflow.
Configuration parameters for creating this service instance:
Python Query: a python query to retrieve data from the payload.
Slack Notification Service¶
This service will send a message to the slack server that is configured in the site settings.
ChannelThe channel the message will be posted toTokenAPI Token to allow communications to the workspaceBodyThe body of the message that will be posted to the above channel
Note
This Service supports variable substitution (as mentioned in the previous section) in the url and content_match input fields of its configuration form.
Topology Import Service¶
Import the topology from an instance of LibreNMS, Netbox or OpenNMS.
Import TypeChoose LibreNMS, Netbox or OpenNMS
Netbox¶
Configuration settings and options for importing topology from a Netbox Server
Netbox AddressAddress for the netbox serverNetbox TokenAPI token to allow netbox interactions
OpenNMS¶
Options available for importing a known set of devices from OpenNMS
Opennms AdressAddress for the OpenNMS serverOpennms DevicesA list of devices to query in the OpenNMS serverOpennms LoginLogin for the OpenNMS ServerOpennms PasswordPassword for the OpenNMS Server
LibreNMS¶
Configuration settings and options for importing topology from LibreNMS
- Librenms Address Address for the LibreNMS Server
- Librenms Token API token for allowing interaction with LibreNMS.