$47 GRAYBYTE WORDPRESS FILE MANAGER $67

SERVER : in-mum-web1330.main-hosting.eu #1 SMP Mon Feb 10 22:45:17 UTC 2025
SERVER IP : 88.222.222.152 | ADMIN IP 216.73.216.21
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/lib/frr/

HOME
Current File : /lib/frr//generate_support_bundle.py
#! /usr/libexec/platform-python -s
#
# Copyright (c) 2021, LabN Consulting, L.L.C.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; see the file COPYING; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#

########################################################
### Python Script to generate the FRR support bundle ###
########################################################
import argparse
import logging
import os
import subprocess
import tempfile


def open_with_backup(path):
    if os.path.exists(path):
        print("Making backup of " + path)
        subprocess.check_call("mv {0} {0}.prev".format(path), shell=True)
    return open(path, "w")


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "-c",
        "--config",
        default="/etc/frr/support_bundle_commands.conf",
        help="input config",
    )
    parser.add_argument(
        "-l", "--log-dir", default="/var/log/frr", help="directory for logfiles"
    )
    args = parser.parse_args()

    collecting = False  # file format has sentinels (seem superfluous)
    proc_cmds = {}
    proc = None
    temp = None

    # Collect all the commands for each daemon
    try:
        for line in open(args.config):
            line = line.rstrip()
            if len(line) == 0 or line[0] == "#":
                continue

            cmd_line = line.split(":")
            if cmd_line[0] == "PROC_NAME":
                proc = cmd_line[1]
                temp = tempfile.NamedTemporaryFile("w+")
                collecting = False
            elif cmd_line[0] == "CMD_LIST_START":
                collecting = True
            elif cmd_line[0] == "CMD_LIST_END":
                collecting = False
                temp.flush()
                proc_cmds[proc] = open(temp.name)
                temp.close()
            elif collecting:
                temp.write(line + "\n")
            else:
                print("Ignoring unexpected input " + line.rstrip())
    except IOError as error:
        logging.fatal("Cannot read config file: %s: %s", args.config, str(error))
        return

    # Spawn a vtysh to fetch each set of commands
    procs = []
    for proc in proc_cmds:
        ofn = os.path.join(args.log_dir, proc + "_support_bundle.log")
        p = subprocess.Popen(
            ["/usr/bin/env", "vtysh", "-t"],
            stdin=proc_cmds[proc],
            stdout=open_with_backup(ofn),
            stderr=subprocess.STDOUT,
        )
        procs.append(p)

    for p in procs:
        p.wait()


if __name__ == "__main__":
    main()

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
10 Dec 2025 3.23 PM
root / root
0555
__pycache__
--
28 Feb 2025 12.49 AM
root / root
0755
babeld
208.328 KB
31 Dec 2024 10.54 AM
root / root
0755
bfdd
289.117 KB
31 Dec 2024 10.54 AM
root / root
0755
bgpd
2.98 MB
31 Dec 2024 10.54 AM
root / root
0755
eigrpd
274.867 KB
31 Dec 2024 10.54 AM
root / root
0755
fabricd
800.602 KB
31 Dec 2024 10.54 AM
root / root
0755
frr-reload
0.193 KB
31 Dec 2024 10.46 AM
root / root
0755
frr-reload.py
84.738 KB
31 Dec 2024 10.54 AM
root / root
0755
frr_babeltrace.py
8.723 KB
31 Dec 2024 10.46 AM
root / root
0755
frrcommon.sh
8.631 KB
31 Dec 2024 10.51 AM
root / root
0755
frrinit.sh
3.463 KB
31 Dec 2024 10.51 AM
root / root
0755
generate_support_bundle.py
3.088 KB
31 Dec 2024 10.54 AM
root / root
0755
isisd
1.05 MB
31 Dec 2024 10.54 AM
root / root
0755
ldpd
346.43 KB
31 Dec 2024 10.54 AM
root / root
0755
nhrpd
232.914 KB
31 Dec 2024 10.54 AM
root / root
0755
ospf6d
1010.445 KB
31 Dec 2024 10.54 AM
root / root
0755
ospfclient.py
40.622 KB
31 Dec 2024 10.46 AM
root / root
0755
ospfd
1.61 MB
31 Dec 2024 10.54 AM
root / root
0755
pathd
185.313 KB
31 Dec 2024 10.54 AM
root / root
0755
pbrd
153.633 KB
31 Dec 2024 10.54 AM
root / root
0755
pim6d
942.422 KB
31 Dec 2024 10.54 AM
root / root
0755
pimd
1.18 MB
31 Dec 2024 10.54 AM
root / root
0755
ripd
270.828 KB
31 Dec 2024 10.54 AM
root / root
0755
ripngd
202.141 KB
31 Dec 2024 10.54 AM
root / root
0755
staticd
166.938 KB
31 Dec 2024 10.54 AM
root / root
0755
vrrpd
171.219 KB
31 Dec 2024 10.54 AM
root / root
0755
watchfrr
77.133 KB
31 Dec 2024 10.54 AM
root / root
0755
watchfrr.sh
0.72 KB
31 Dec 2024 10.51 AM
root / root
0755
zebra
1.93 MB
31 Dec 2024 10.54 AM
root / root
0755

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF