FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
btey
Staff
Staff
Description

This articles discusses about the troubleshooting command use to verify the SQL query for the FortiGate Local Report.

Scope  
Solution

In FortiGate CLI/SSH session, run the following commands:

 

# diagnose debug disable

# diagnose debug reset

# diagnose debug application reportd -1

# diagnose debug enable

 

From GUI.

 

Go to Log & Report -> Local Reports -> Generate Now.

 

From CLI.

 

# execute report run

 

Sample log as below:

 

Generating report for layout: default...

Request to generate a report is successfully sent to reportd.

[754] __handle_cron_message-Cron message. type=2, vd=root

 # [51] rptengine_create_report_dir- Report directory: /var/log/root/report/generated/On-Demand-default-2021-10-21-160253 is created successfully

[861] _handle_chart_item-Process chart item: id=311,  chart=traffic.bandwidth.history_c

 

sql="select timestamp, sum(sentbyte)*8/3600 sentbyte, sum(rcvdbyte)*8/3600 rcvdbyte, sum(sentbyte + rcvdbyte)*8/3600 bandwidth from grp_traffic_summary where  timestamp BETWEEN 1634716800 and 1634803199  and 1=1 group by timestamp order by timestamp"

num of periods:24

Current time: 1634803373

1634716800, 24, 3600

[861] _handle_chart_item-Process chart item: id=321,  chart=traffic.sessions.history_c

 

sql="select timestamp, sum(sessioncount) sessions from grp_traffic_summary where  timestamp BETWEEN 1634716800 and 1634803199  and 1=1 group by timestamp order by timestamp"

num of periods:24

Current time: 1634803373

1634716800, 24, 3600

[861] _handle_chart_item-Process chart item: id=331,  chart=traffic.statistics

 

Refer to the above SQL query for the report time range, calculation, current report time, order, grouping and number of lines show in the report.

 

To stop the debug:

 

# diagnose debug disable

# diagnose debug reset

 

For more detail of FortiGate Local Report:

https://community.fortinet.com/t5/FortiGate/Technical-Tip-Local-Reports/ta-p/198272?externalID=FD460...

 

https://community.fortinet.com/t5/FortiGate/Technical-Tip-Local-Reports-is-not-available-under-Featu...

Contributors