dellemc.enterprise_sonic.sonic_logging module – Manage logging configuration on SONiC.
Note
This module is part of the dellemc.enterprise_sonic collection (version 2.2.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install dellemc.enterprise_sonic
.
To use it in a playbook, specify: dellemc.enterprise_sonic.sonic_logging
.
New in dellemc.enterprise_sonic 2.1.0
Synopsis
This module provides configuration management of logging for devices running SONiC.
Parameters
Parameter |
Comments |
---|---|
Specifies logging related configurations. |
|
Remote logging sever configuration. |
|
IPv4/IPv6 address or host name of the remote logging server. |
|
Type of messages that remote server receives. message_type can not be deleted. Choices:
|
|
Destination port number for logging messages sent to the server. remote_port can not be deleted. |
|
Source interface used as source ip for sending logging packets. source_interface can not be deleted. |
|
VRF name used by remote logging server. |
|
The state of the configuration after module completion. Choices:
|
Examples
# Using deleted
#
# Before state:
# -------------
#
#sonic# show logging servers
#--------------------------------------------------------------------------------
#HOST PORT SOURCE-INTERFACE VRF MESSGE-TYPE
#--------------------------------------------------------------------------------
#10.11.0.2 5 Ethernet24 - event
#10.11.1.1 616 Ethernet8 - log
#log1.dell.com 6 Ethernet28 - log
#
- name: Delete logging server configuration
sonic_logging:
config:
remote_servers:
- host: 10.11.0.2
- host: log1.dell.com
state: deleted
# After state:
# ------------
#
#sonic# show logging servers
#--------------------------------------------------------------------------------
#HOST PORT SOURCE-INTERFACE VRF MESSGE-TYPE
#--------------------------------------------------------------------------------
#10.11.1.1 616 Ethernet8 - log
#
#
# Using merged
#
# Before state:
# -------------
#
#sonic# show logging servers
#--------------------------------------------------------------------------------
#HOST PORT SOURCE-INTERFACE VRF MESSGE-TYPE
#--------------------------------------------------------------------------------
#10.11.1.1 616 Ethernet8 - log
#
- name: Merge logging server configuration
sonic_logging:
config:
remote_servers:
- host: 10.11.0.2
remote_port: 5
source_interface: Ethernet24
message_type: event
- host: log1.dell.com
remote_port: 6
source_interface: Ethernet28
state: merged
# After state:
# ------------
#
#sonic# show logging servers
#--------------------------------------------------------------------------------
#HOST PORT SOURCE-INTERFACE VRF MESSGE-TYPE
#--------------------------------------------------------------------------------
#10.11.0.2 5 Ethernet24 - event
#10.11.1.1 616 Ethernet8 - log
#log1.dell.com 6 Ethernet28 - log
#
#
# Using overridden
#
# Before state:
# -------------
#
#sonic# show logging servers
#--------------------------------------------------------------------------------
#HOST PORT SOURCE-INTERFACE VRF MESSGE-TYPE
#--------------------------------------------------------------------------------
#10.11.1.1 616 Ethernet8 - log
#10.11.1.2 626 Ethernet16 - event
#
- name: Replace logging server configuration
sonic_logging:
config:
remote_servers:
- host: 10.11.1.2
remote_port: 622
source_interface: Ethernet24
message_type: event
state: overridden
#
# After state:
# ------------
#
#sonic# show logging servers
#--------------------------------------------------------------------------------
#HOST PORT SOURCE-INTERFACE VRF MESSGE-TYPE
#--------------------------------------------------------------------------------
#10.11.1.2 622 Ethernet24 - event
#
# Using replaced
#
# Before state:
# -------------
#
#sonic# show logging servers
#--------------------------------------------------------------------------------
#HOST PORT SOURCE-INTERFACE VRF MESSGE-TYPE
#--------------------------------------------------------------------------------
#10.11.1.1 616 Ethernet8 - log
#10.11.1.2 626 Ethernet16 - event
#
- name: Replace logging server configuration
sonic_logging:
config:
remote_servers:
- host: 10.11.1.2
remote_port: 622
state: replaced
#
# After state:
# ------------
#
# "MESSAGE-TYPE" has default value of "log"
#
#sonic# show logging servers
#--------------------------------------------------------------------------------
#HOST PORT SOURCE-INTERFACE VRF MESSGE-TYPE
#--------------------------------------------------------------------------------
#10.11.1.1 616 Ethernet8 - log
#10.11.1.2 622 - - log
#
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The resulting configuration model invocation. Returned: when changed Sample: |
|
The configuration prior to the model invocation. Returned: always Sample: |
|
The set of commands pushed to the remote device. Returned: always Sample: |