cnos_logging – Manage logging on network devices

From Get docs
Ansible/docs/2.8/modules/cnos logging module


cnos_logging – Manage logging on network devices

New in version 2.8.


Synopsis

  • This module provides declarative management of logging on Cisco Cnos devices.

Parameters

Parameter Choices/Defaults Comments

aggregate

-

List of logging definitions.

dest

-

  • server
  • console
  • monitor
  • logfile

Destination of the logs. Lenovo uses the term server instead of host in its CLI.

facility

-

Set logging facility. This is applicable only for server logging

level

-

Default:

5

Set logging severity levels. 0-emerg;1-alert;2-crit;3-err;4-warn; 5-notif;6-inform;7-debug

name

-

If value of dest is file it indicates file-name and for server indicates the server name to be notified.

size

-

Default:

10485760

Size of buffer. The acceptable value is in range from 4096 to 4294967295 bytes.

state

-

  • present

  • absent

State of the logging configuration.



Notes

Note

  • Tested against CNOS 10.9.1


Examples

- name: configure server logging
  cnos_logging:
    dest: server
    name: 10.241.107.224
    facility: local7
    state: present

- name: remove server logging configuration
  cnos_logging:
    dest: server
    name: 10.241.107.224
    state: absent

- name: configure console logging level and facility
  cnos_logging:
    dest: console
    level: 7
    state: present

- name: configure buffer size
  cnos_logging:
    dest: logfile
    level: 5
    name: testfile
    size: 5000

- name: Configure logging using aggregate
  cnos_logging:
    aggregate:
      - { dest: console, level: 6 }
      - { dest: logfile, size: 9000 }

- name: remove logging using aggregate
  cnos_logging:
    aggregate:
      - { dest: console, level: 6 }
      - { dest: logfile, name: anil, size: 9000 }
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description

commands

list

always

The list of configuration mode commands to send to the device


Sample:

['logging console 7', 'logging server 10.241.107.224']




Status

Authors

  • Anil Kumar Muraleedharan (@amuraleedhar)

Hint

If you notice any issues in this documentation you can edit this document to improve it.


© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.8/modules/cnos_logging_module.html