⚝
One Hat Cyber Team
⚝
Your IP:
3.145.62.161
Server IP:
97.74.87.16
Server:
Linux 16.87.74.97.host.secureserver.net 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
bin
/
fm-agent
/
View File Name :
maintenance_noroot.py
#!/usr/bin/env python import sys from optparse import OptionParser AGG_URL = 'rx.us01.fortimonitor.com' VERSION = '2024.4.5' BASE_CONFIG_DIR = '/etc' PKG_DIR = 'fm-agent' BRAND = 'fm' if 'freebsd' in sys.platform.lower() or "darwin" in sys.platform.lower(): sys.path.insert(0, '/usr/local/fm-agent/lib/library') else: sys.path.insert(0, '/usr/lib/fm-agent/library') sys.path.insert(0, '/usr/lib/fm-agent/') from maintenance import Maintenance if __name__ == "__main__": parser = OptionParser() parser.add_option('-s', '--start', dest='start', action='store_true', help='Flag to determine if we are going to start a maintenance', default=False) parser.add_option('-e', '--end', dest="end", action="store_true", help="Flag to determine if we are going to end a maintenance", default=False) parser.add_option('-d', '--duration', dest="duration", help="The duration of the maintenance in minutes") parser.add_option('-t', '--metric-tags', dest="metric_tags", help="Optional comma separated list of tags to pass to the maintenance.") options, args = parser.parse_args() start = options.start end = options.end duration = options.duration if not start and not end: print "Please specify an action for the maintenance, --start/--end" sys.exit(1) if start and end: print "Please specific only one of our 2 actions, --start/--end" sys.exit(1) if not duration and not end: print "Please specify a duration for the maintenance." sys.exit(1) metric_tags = options.metric_tags maintenance = Maintenance(BRAND, AGG_URL, VERSION, BASE_CONFIG_DIR, PKG_DIR) if end: maintenance.end() elif start: maintenance.start(duration, metric_tags)