community.general.onyx_syslog_remote (0.1.1) — module

Configure remote syslog module

Authors: Anas Shami (@anass)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

This module provides declarative management of syslog on Mellanox ONYX network devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remote logging port 8080
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- onyx_syslog_remote:
    host: 10.10.10.10
    port: 8080
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remote logging trap override
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- onyx_syslog_remote:
    host: 10.10.10.10
    trap_override:
        - override_class: events
          override_priority: emerg
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remote logging trap emerg
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- onyx_syslog_remote:
    host: 10.10.10.10
    trap: emerg
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remote logging filter include 'ERR'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- onyx_syslog_remote:
    host: 10.10.10.10
    filter: include
    filter_str: /ERR/
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: disable remote logging with class events
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- onyx_syslog_remote:
    enabled: False
    host: 10.10.10.10
    class: events
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name : disable remote logging
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- onyx_syslog_remote:
    enabled: False
    host: 10.10.10.10
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name : enable/disable override class
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- onyx_syslog_remote:
    host: 10.7.144.71
    trap_override:
        - override_class: events
          override_priority: emerg
          override_enabled: False
        - override_class: mgmt-front
          override_priority: alert

Inputs

    
host:
    description:
    - <IP4/IP6 Hostname> Send event logs to this server using the syslog protocol
    required: true
    type: str

port:
    description:
    - Set remote server destination port for log messages
    type: int

trap:
    choices:
    - none
    - debug
    - info
    - notice
    - alert
    - warning
    - err
    - emerg
    - crit
    description:
    - Minimum severity level for messages to this syslog server
    type: str

filter:
    choices:
    - include
    - exclude
    description:
    - Specify a filter type
    type: str

enabled:
    default: true
    description:
    - Disable/Enable logging to given remote host
    type: bool

filter_str:
    description:
    - Specify a regex filter string
    type: str

trap_override:
    description:
    - Override log levels for this sink on a per-class basis
    suboptions:
      override_class:
        choices:
        - mgmt-front
        - mgmt-back
        - mgmt-core
        - events
        - debug-module
        - sx-sdk
        - mlx-daemons
        - protocol-stack
        description:
        - Specify a class whose log level to override
        required: true
        type: str
      override_enabled:
        default: true
        description:
        - disable override priorities for specific class.
        type: bool
      override_priority:
        choices:
        - none
        - debug
        - info
        - notice
        - alert
        - warning
        - err
        - emerg
        - crit
        description: -Specify a priority whose log level to override
        type: str
    type: list

Outputs

commands:
  description: The list of configuration mode commands to send to the device.
  returned: always
  sample:
  - logging x port 8080
  - logging 10.10.10.10 trap override class events priority emerg
  - no logging 10.10.10.10 trap override class events
  - logging 10.10.10.10 trap emerg
  - logging 10.10.10.10 filter [include | exclude] ERR
  type: list