Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 107
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 234
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 235
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 236
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 237
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 238
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 239
"""
FortiMonitor Countermeasure log helper - base class to allow easy gathering of diagnostic
data from local log files.
Copyright 2023 Fortinet, Inc. All Rights Reserved.
fm-ops@fortinet.com
To use, create a subclass of CountermeasureLogHelper and define the following properties:
- name - A human-readable name for the countermeasure
- textkey - A unique textkey describing the countermeasure
- log_file: The log file or log files to gather. Either a string for a single file or
a list of strings for multiple. Must specify the full path to the log file
and the agent must have read access to the file
- line_count: Count of lines to retrieve from the bottom of the log file(s)
- description: Optional longer description of what the plugin does
For example:
class ApacheLogCountermeasure(CountermeasureLogHelper):
name = "Apache logs"
textkey = "logs.apache"
description = "Get recent Apache logs"
log_file = ["/var/log/apache/access.log", "/var/log/apache/error.log"]
line_count = 100
"""
from CountermeasurePlugin import CountermeasurePlugin
class CountermeasureLogHelper(CountermeasurePlugin):
wall_announce_delay = None
max_frequency = None
max_runtime = None
sudo_requirements = []
author = "support@panopta.com"
# The log file(s) to retrieve
log_file = None
# How many lines to capture
line_count = 100
def validate(self):
problems = []
if self.name == "Base Countermeasure":
problems.append("Missing name definition")
if self.textkey == "base":
problems.append("Missing textkey definition")
if self.log_file is None:
problems.append("Missing log file definition")
try:
lines = int(self.line_count)
except:
problems.append("Invalid line count definition")
return problems and ", ".join(problems) or None
def run(self):
if type(self.log_file) in (type(""), type("")):
self.log_file = [self.log_file]
output = ""
for file in self.log_file:
output += "%s:\n" % file
return_code, sub_output = self.execute(
"tail -n %s %s" % (self.line_count, file)
)
output += sub_output
output += "\n\n"
self.save_text_output(output)