7-Day Average CPU/RAM Usage for Fortigate Machine: How-To Guide
Monitoring the performance of a Fortigate machine is important to ensure its smooth operation and identify any potential issues before they cause significant problems. One way to do this is by tracking the 7-day average CPU and RAM usage. This article will provide you with a step-by-step guide on how to create a 7-day average usage report for Fortigate machines.
Prerequisites
To follow this guide, you will need the following:
- Access to a Fortigate machine
- Basic understanding of Fortigate CLI commands
Step 1: Connect to the Fortigate Machine
Establish a connection to the Fortigate machine using your preferred method, such as SSH or console.
Step 2: Enable Data Collection
By default, Fortigate machines do not store historical data for a long period. To enable data collection for a week, you need to configure the logging settings:
config log setting
set log-buffer-size 16777216
set log-msg-length 2048
set log-packets true
set log-buffer-high-watermark 80
set status enable
end
This configuration sets the buffer size, message length, and enables logging packets with a 80% high watermark. Adjust these parameters based on your machine's resources and requirements.
Step 3: Export Data
After a week of data collection, you can export the data using the CLI command:
diag system ha status
diag system top
diag system memstatus
export diagnostic-data.txt
These commands show detailed information about the system's current status, top processes, and memory. The export command saves the output to a diagnostic-data.txt file, which you can download from the Fortigate machine using SFTP or another file transfer method.
Step 4: Parse and Analyze Data
Once you have the diagnostic data file, you can analyze the data using a script or manually to calculate the 7-day average CPU and RAM usage. For instance, you can use the following commands in a Linux environment:
grep 'CPU usage' diagnostic-data.txt | awk '{print $3, $4}' > cpu_usage.txt
grep 'Memory usage' diagnostic-data.txt | awk '{print $4, $5}' > memory_usage.txt
These commands extract the CPU and memory usage information from the diagnostic data file. Next, you can use a tool like python or R to calculate the 7-day average.
Step 5: Create a Report
Based on the calculated 7-day average CPU and RAM usage, create a report including the data, analysis, and any recommendations for improvement.
Monitoring the 7-day average CPU and RAM usage for a Fortigate machine can be achieved by collecting and analyzing historical data. This process involves enabling data collection, exporting data, parsing and analyzing the data, and creating a report. With these steps, you can effectively track the performance of your Fortigate machine and make informed decisions. Here is a list of resources for further reading: