fortios_log_disk_setting – Settings for local disk logging in Fortinet’s FortiOS and FortiGate

New in version 2.8.

Synopsis

  • This module is able to configure a FortiGate or FortiOS by allowing the user to set and modify log_disk feature and setting category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v6.0.2

Requirements

The below requirements are needed on the host that executes this module.

  • fortiosapi>=0.9.8

Parameters

Parameter Choices/Defaults Comments
host
- / required
FortiOS or FortiGate ip address.
https
boolean
    Choices:
  • no
  • yes ←
Indicates if the requests towards FortiGate must use HTTPS protocol
log_disk_setting
-
Default:
null
Settings for local disk logging.
diskfull
-
    Choices:
  • overwrite
  • nolog
Action to take when disk is full. The system can overwrite the oldest log messages or stop logging when the disk is full (default = overwrite).
dlp-archive-quota
-
DLP archive quota (MB).
full-final-warning-threshold
-
Log full final warning threshold as a percent (3 - 100, default = 95).
full-first-warning-threshold
-
Log full first warning threshold as a percent (1 - 98, default = 75).
full-second-warning-threshold
-
Log full second warning threshold as a percent (2 - 99, default = 90).
ips-archive
-
    Choices:
  • enable
  • disable
Enable/disable IPS packet archiving to the local disk.
log-quota
-
Disk log quota (MB).
max-log-file-size
-
Maximum log file size before rolling (1 - 100 Mbytes).
max-policy-packet-capture-size
-
Maximum size of policy sniffer in MB (0 means unlimited).
maximum-log-age
-
Delete log files older than (days).
report-quota
-
Report quota (MB).
roll-day
-
    Choices:
  • sunday
  • monday
  • tuesday
  • wednesday
  • thursday
  • friday
  • saturday
Day of week on which to roll log file.
roll-schedule
-
    Choices:
  • daily
  • weekly
Frequency to check log file for rolling.
roll-time
-
Time of day to roll the log file (hh:mm).
source-ip
-
Source IP address to use for uploading disk log files.
status
-
    Choices:
  • enable
  • disable
Enable/disable local disk logging.
upload
-
    Choices:
  • enable
  • disable
Enable/disable uploading log files when they are rolled.
upload-delete-files
-
    Choices:
  • enable
  • disable
Delete log files after uploading (default = enable).
upload-destination
-
    Choices:
  • ftp-server
The type of server to upload log files to. Only FTP is currently supported.
upload-ssl-conn
-
    Choices:
  • default
  • high
  • low
  • disable
Enable/disable encrypted FTPS communication to upload log files.
uploaddir
-
The remote directory on the FTP server to upload log files to.
uploadip
-
IP address of the FTP server to upload log files to.
uploadpass
-
Password required to log into the FTP server to upload disk log files.
uploadport
-
TCP port to use for communicating with the FTP server (default = 21).
uploadsched
-
    Choices:
  • disable
  • enable
Set the schedule for uploading log files to the FTP server (default = disable = upload when rolling).
uploadtime
-
Time of day at which log files are uploaded if uploadsched is enabled (hh:mm or hh).
uploadtype
-
    Choices:
  • traffic
  • event
  • virus
  • webfilter
  • IPS
  • spamfilter
  • dlp-archive
  • anomaly
  • voip
  • dlp
  • app-ctrl
  • waf
  • netscan
  • gtp
  • dns
Types of log files to upload. Separate multiple entries with a space.
uploaduser
-
Username required to log into the FTP server to upload disk log files.
password
-
Default:
""
FortiOS or FortiGate password.
username
- / required
FortiOS or FortiGate username.
vdom
-
Default:
"root"
Virtual domain, among those defined previously. A vdom is a virtual instance of the FortiGate that can be configured and used as a different unit.

Notes

Note

  • Requires fortiosapi library developed by Fortinet

  • Run as a local_action in your playbook

Examples

- hosts: localhost
  vars:
   host: "192.168.122.40"
   username: "admin"
   password: ""
   vdom: "root"
  tasks:
  - name: Settings for local disk logging.
    fortios_log_disk_setting:
      host:  "{{ host }}"
      username: "{{ username }}"
      password: "{{ password }}"
      vdom:  "{{ vdom }}"
      https: "False"
      log_disk_setting:
        diskfull: "overwrite"
        dlp-archive-quota: "4"
        full-final-warning-threshold: "5"
        full-first-warning-threshold: "6"
        full-second-warning-threshold: "7"
        ips-archive: "enable"
        log-quota: "9"
        max-log-file-size: "10"
        max-policy-packet-capture-size: "11"
        maximum-log-age: "12"
        report-quota: "13"
        roll-day: "sunday"
        roll-schedule: "daily"
        roll-time: "<your_own_value>"
        source-ip: "84.230.14.43"
        status: "enable"
        upload: "enable"
        upload-delete-files: "enable"
        upload-destination: "ftp-server"
        upload-ssl-conn: "default"
        uploaddir: "<your_own_value>"
        uploadip: "<your_own_value>"
        uploadpass: "<your_own_value>"
        uploadport: "26"
        uploadsched: "disable"
        uploadtime: "<your_own_value>"
        uploadtype: "traffic"
        uploaduser: "<your_own_value>"

Return Values

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

Key Returned Description
build
string
always
Build number of the fortigate image

Sample:
1547
http_method
string
always
Last method used to provision the content into FortiGate

Sample:
PUT
http_status
string
always
Last result given by FortiGate on last operation applied

Sample:
200
mkey
string
success
Master key (id) used in the last call to FortiGate

Sample:
id
name
string
always
Name of the table used to fulfill the request

Sample:
urlfilter
path
string
always
Path of the table used to fulfill the request

Sample:
webfilter
revision
string
always
Internal revision number

Sample:
17.0.2.10658
serial
string
always
Serial number of the unit

Sample:
FGVMEVYYQT3AB5352
status
string
always
Indication of the operation's result

Sample:
success
vdom
string
always
Virtual domain used

Sample:
root
version
string
always
Version of the FortiGate

Sample:
v5.6.3


Status

Authors

  • Miguel Angel Munoz (@mamunozgonzalez)

  • Nicolas Thomas (@thomnico)

Hint

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