Page MenuHomeVyOS Platform

No OneTemporary

Size
15 KB
Referenced Files
None
Subscribers
None
diff --git a/debian/control b/debian/control
index 99a2b3e31..12b288931 100644
--- a/debian/control
+++ b/debian/control
@@ -1,433 +1,434 @@
Source: vyos-1x
Section: contrib/net
Priority: extra
Maintainer: VyOS Package Maintainers <maintainers@vyos.net>
Build-Depends:
debhelper (>= 9),
dh-python,
fakeroot,
gcc,
iproute2,
libzmq3-dev,
python3 (>= 3.10),
# For libvyosconfig
libpcre2-dev,
libffi-dev,
# For QA/Lint
pylint,
python3-vici (>= 5.7.2),
python3-fastapi,
python3-pyudev,
python3-systemd,
python3-certbot-nginx,
python3-pam,
python3-dbus,
python3-pyroute2,
python3-voluptuous,
# For generating command definitions
python3-lxml,
python3-xmltodict,
# For generating serialization functions
protobuf-compiler,
# For running tests
python3-coverage,
python3-hurry.filesize,
python3-netaddr,
python3-netifaces,
python3-nose2,
python3-jinja2,
python3-paramiko,
python3-passlib,
python3-psutil,
python3-requests,
python3-setuptools,
python3-tabulate,
python3-zmq,
quilt,
whois
Standards-Version: 3.9.6
Package: vyos-1x
Architecture: amd64 arm64
Pre-Depends:
libpam-runtime [amd64],
libnss-tacplus [amd64],
libpam-tacplus [amd64],
vyos-libpam-radius-auth,
vyos-libnss-mapuser,
tzdata (>= 2025b)
Depends:
## Fundamentals
${python3:Depends} (>= 3.10),
dialog,
libvyosconfig0,
libpam-cap,
bash-completion,
ipvsadm,
udev,
less,
at,
rsync,
vyatta-bash,
vyatta-biosdevname,
vyatta-cfg,
vyos-http-api-tools,
vyos-utils,
## End of Fundamentals
## Python libraries used in multiple modules and scripts
python3,
python3-cryptography,
python3-hurry.filesize,
python3-inotify,
python3-jinja2,
python3-jmespath,
python3-netaddr,
python3-netifaces,
python3-paramiko,
python3-passlib,
python3-protobuf,
python3-pyroute2,
python3-psutil,
python3-pyhumps,
python3-pystache,
python3-pyudev,
python3-six,
python3-tabulate,
python3-tomli,
python3-voluptuous,
python3-xmltodict,
python3-zmq,
## End of Python libraries
## Basic System services and utilities
coreutils,
sudo,
systemd,
bsdmainutils,
openssl,
curl,
dbus,
file,
iproute2 (>= 6.0.0),
linux-cpupower,
+ hwloc,
# ipaddrcheck is widely used in IP value validators
ipaddrcheck,
ethtool (>= 6.10),
lm-sensors,
procps,
netplug,
sed,
ssl-cert,
tuned,
beep,
wide-dhcpv6-client,
# Generic colorizer
grc,
## End of System services and utilities
## For the installer
fdisk,
gdisk,
mdadm,
efibootmgr,
libefivar1,
dosfstools,
grub-efi-amd64-signed [amd64],
grub-efi-arm64-bin [arm64],
mokutil,
shim-signed [amd64],
sbsigntool [amd64],
# Image signature verification tool
minisign,
# Live filesystem tools
squashfs-tools,
fuse-overlayfs,
# Tools for checking password strength
python3-cracklib,
## End installer
auditd,
iputils-arping,
iputils-ping,
isc-dhcp-client,
# For "vpn pptp", "vpn l2tp", "vpn sstp", "service ipoe-server"
accel-ppp-ng,
# End "vpn pptp", "vpn l2tp", "vpn sstp", "service ipoe-server"
avahi-daemon,
conntrack,
conntrackd,
## Conf mode features
# For "interfaces wireless"
hostapd,
hsflowd,
iw,
wireless-regdb,
wpasupplicant (>= 0.6.7),
# End "interfaces wireless"
# For "interfaces wwan"
modemmanager,
usb-modeswitch,
libqmi-utils,
# End "interfaces wwan"
# For "interfaces openvpn"
openvpn,
openvpn-auth-ldap,
openvpn-auth-radius,
openvpn-otp,
openvpn-dco,
libpam-google-authenticator,
# End "interfaces openvpn"
# For "interfaces wireguard"
wireguard-tools,
qrencode,
# End "interfaces wireguard"
# For "interfaces pppoe"
pppoe,
# End "interfaces pppoe"
# For "interfaces sstpc"
sstp-client,
# End "interfaces sstpc"
# For "protocols *"
frr (>= 10.2),
frr-pythontools,
frr-rpki-rtrlib,
frr-snmp,
# End "protocols *"
# For "protocols igmp-proxy"
igmpproxy,
# End "protocols igmp-proxy"
# For "pki"
certbot,
# End "pki"
# For "service console-server"
conserver-client,
conserver-server,
console-data,
dropbear,
# End "service console-server"
# For "service dns dynamic"
ddclient (>= 3.11.1),
# End "service dns dynamic"
# # For "service ids"
suricata,
suricata-update,
# End "service ids"
# # For "service ndp-proxy"
ndppd,
# End "service ndp-proxy"
# For "service router-advert"
radvd (>= 2.20),
# End "service route-advert"
# For "load-balancing haproxy"
haproxy,
# End "load-balancing haproxy"
# For "service dhcp-relay"
isc-dhcp-relay,
# For "service dhcp-server"
isc-kea-dhcp4,
isc-kea-dhcp6,
isc-kea-dhcp-ddns,
isc-kea-hooks,
# End "service dhcp-server"
# For "service lldp"
lldpd,
# End "service lldp"
# For "service https"
nginx-light,
# End "service https"
# For "service ssh"
openssh-server,
sshguard,
# End "service ssh"
# For "service salt-minion"
salt-minion,
# End "service salt-minion"
# For "service snmp"
snmp,
snmpd,
# End "service snmp"
# For "service webproxy"
squid,
squidclient,
squidguard,
# End "service webproxy"
# For "service monitoring prometheus node-exporter"
node-exporter,
# End "service monitoring prometheus node-exporter"
# For "service monitoring prometheus frr-exporter"
frr-exporter,
# End "service monitoring prometheus frr-exporter"
# For "service monitoring prometheus blackbox-exporter"
blackbox-exporter,
# End "service monitoring prometheus blackbox-exporter"
# For "service monitoring telegraf"
telegraf (>= 1.20),
# End "service monitoring telegraf"
# For "service monitoring zabbix-agent"
zabbix-agent2,
# End "service monitoring zabbix-agent"
# For "service tftp-server"
tftpd-hpa,
# End "service tftp-server"
# For "service dns forwarding"
pdns-recursor,
# End "service dns forwarding"
# For "service sla owamp"
owamp-client,
owamp-server,
# End "service sla owamp"
# For "service sla twamp"
twamp-client,
twamp-server,
# End "service sla twamp"
# For "service broadcast-relay"
udp-broadcast-relay,
# End "service broadcast-relay"
# For "high-availability vrrp"
keepalived (>=2.0.5),
# End "high-availability-vrrp"
# For "system console"
util-linux,
# End "system console"
# For "system task-scheduler"
cron,
# End "system task-scheduler"
# For "system lcd"
lcdproc,
lcdproc-extra-drivers,
# End "system lcd"
# For "system config-management commit-archive"
git,
# End "system config-management commit-archive"
# For firewall
libndp-tools,
libnetfilter-conntrack3,
libnfnetlink0,
nfct,
nftables (>= 0.9.3),
# For "vpn ipsec"
strongswan (>= 5.9),
strongswan-swanctl (>= 5.9),
charon-systemd,
libcharon-extra-plugins (>=5.9),
libcharon-extauth-plugins (>=5.9),
libstrongswan-extra-plugins (>=5.9),
libstrongswan-standard-plugins (>=5.9),
python3-vici (>= 5.7.2),
# End "vpn ipsec"
# For "nat64"
jool,
# End "nat64"
# For "system conntrack modules rtsp"
nat-rtsp,
# End "system conntrack modules rtsp"
# For "service ntp"
chrony,
# End "system ntp"
# For "vpn openconnect"
ocserv,
# End "vpn openconnect"
# For "system syslog"
rsyslog,
rsyslog-openssl,
# End "system syslog"
# For "system option keyboard-layout"
kbd,
# End "system option keyboard-layout"
# For "container"
podman (>=4.9.5),
netavark,
aardvark-dns,
# iptables is only used for containers now, not the the firewall CLI
iptables,
# End container
# For "vpp"
libvppinfra,
python3-vpp-api,
vpp,
vpp-crypto-engines,
vpp-dev,
vpp-plugin-core,
vpp-plugin-dpdk,
# End "vpp"
## End Configuration mode
## Operational mode
# Used for hypervisor model in "run show version"
hvinfo,
# For "run traceroute"
traceroute,
# For "run monitor traffic"
tcpdump,
# End "run monitor traffic"
# For "show hardware dmi"
dmidecode,
# For "show protocols static arp"
net-tools,
# For "run show hardware storage smart"
smartmontools,
# For "run show hardware scsi"
lsscsi,
# For "run show hardware pci"
pciutils,
# For "show hardware usb"
usbutils,
# For "run show hardware storage nvme"
nvme-cli,
# For "run monitor bandwidth-test"
iperf,
iperf3,
# End "run monitor bandwidth-test"
# For "run wake-on-lan"
etherwake,
# For "run force ipv6-nd"
ndisc6,
# For "run monitor bandwidth"
bmon,
# For "run format disk"
parted,
# End Operational mode
## TPM tools
cryptsetup,
tpm2-tools,
## End TPM tools
## Optional utilities
easy-rsa,
tcptraceroute,
mtr-tiny,
telnet,
stunnel4,
uidmap
## End optional utilities
Description: VyOS configuration scripts and data
VyOS configuration scripts, interface definitions, and everything
Package: libvyosconfig0
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends}
Description: VyConf config tree manipulation library
VyConf config tree parsing and manipulation library
Package: vyos-1x-aws
Architecture: all
Depends:
vyos-1x,
# For "service aws glb"
aws-gwlbtun,
Description: VyOS configuration scripts and data for AWS Gateway Load Balancer
Adds configuration files required for AWS Gateway Load Balancer service
running on top of VyOS.
Package: vyos-1x-smoketest
Architecture: all
Depends:
skopeo,
snmp,
vyos-1x,
vmtouch
Description: VyOS build sanity checking toolkit
Package: vyos-1x-vmware
Architecture: all
Depends:
vyos-1x,
open-vm-tools
Description: VyOS configuration scripts and data for VMware
Adds configuration files required for VyOS running on VMware hosts.
diff --git a/src/op_mode/generate_tech-support_archive.py b/src/op_mode/generate_tech-support_archive.py
index 1d3f26d39..92442b78d 100755
--- a/src/op_mode/generate_tech-support_archive.py
+++ b/src/op_mode/generate_tech-support_archive.py
@@ -1,148 +1,169 @@
#!/usr/bin/env python3
#
# Copyright VyOS maintainers and contributors <maintainers@vyos.io>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
# published by the Free Software Foundation.
#
# 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. If not, see <http://www.gnu.org/licenses/>.
import os
import argparse
import glob
from datetime import datetime
from pathlib import Path
from shutil import rmtree
from socket import gethostname
from sys import exit
from tarfile import open as tar_open
+from vyos.utils.process import call
from vyos.utils.process import rc_cmd
from vyos.remote import upload
def op(cmd: str) -> str:
"""Returns a command with the VyOS operational mode wrapper."""
return f'/opt/vyatta/bin/vyatta-op-cmd-wrapper {cmd}'
def save_stdout(command: str, file: Path) -> None:
rc, stdout = rc_cmd(command)
body: str = f'''### {command} ###
Command: {command}
Exit code: {rc}
Stdout:
{stdout}
'''
with file.open(mode='a') as f:
f.write(body)
def __rotate_logs(path: str, log_pattern:str):
files_list = glob.glob(f'{path}/{log_pattern}')
if len(files_list) > 5:
oldest_file = min(files_list, key=os.path.getctime)
os.remove(oldest_file)
def __generate_archived_files(location_path: str) -> None:
"""
Generate arhives of main directories
:param location_path: path to temporary directory
:type location_path: str
"""
# Dictionary arhive_name:directory_to_arhive
archive_dict = {
'etc': '/etc',
'home': '/home',
'var-log': '/var/log',
'root': '/root',
'tmp': '/tmp',
'core-dump': '/var/core',
'config': '/opt/vyatta/etc/config'
}
# Dictionary arhive_name:excluding pattern
archive_excludes = {
# Old location of archives
'config': 'tech-support-archive',
# New locations of arhives
'tmp': 'tech-support-archive'
}
for archive_name, path in archive_dict.items():
archive_file: str = f'{location_path}/{archive_name}.tar.gz'
with tar_open(name=archive_file, mode='x:gz') as tar_file:
if archive_name in archive_excludes:
tar_file.add(path, filter=lambda x: None if str(archive_excludes[archive_name]) in str(x.name) else x)
else:
tar_file.add(path)
def __generate_main_archive_file(archive_file: str, tmp_dir_path: str) -> None:
"""
Generate main arhive file
:param archive_file: name of arhive file
:type archive_file: str
:param tmp_dir_path: path to arhive memeber
:type tmp_dir_path: str
"""
with tar_open(name=archive_file, mode='x:gz') as tar_file:
tar_file.add(tmp_dir_path, arcname=os.path.basename(tmp_dir_path))
+def __generate_topology_snapshots(output_dir: Path) -> None:
+ """
+ Generates physical and logical topology PNG files using `lstopo`
+
+ :param output_dir: directory where topology PNGs will be stored
+ """
+
+ physical_topo = output_dir / 'topology.png'
+ logical_topo = output_dir / 'topology-logical.png'
+
+ # Capture physical topology
+ call(['lstopo', '--output-format', 'png', str(physical_topo)])
+
+ # Capture logical topology
+ call(['lstopo', '--logical', '--output-format', 'png', str(logical_topo)])
+
if __name__ == '__main__':
defualt_tmp_dir = '/tmp'
parser = argparse.ArgumentParser()
parser.add_argument("path", nargs='?', default=defualt_tmp_dir)
args = parser.parse_args()
location_path = args.path[:-1] if args.path[-1] == '/' else args.path
hostname: str = gethostname()
time_now: str = datetime.now().isoformat(timespec='seconds').replace(":", "-")
remote = False
tmp_path = ''
tmp_dir_path = ''
if 'ftp://' in args.path or 'scp://' in args.path:
remote = True
tmp_path = defualt_tmp_dir
else:
tmp_path = location_path
archive_pattern = f'_tech-support-archive_'
archive_file_name = f'{hostname}{archive_pattern}{time_now}.tar.gz'
# Log rotation in tmp directory
if tmp_path == defualt_tmp_dir:
__rotate_logs(tmp_path, f'*{archive_pattern}*')
# Temporary directory creation
tmp_dir_path = f'{tmp_path}/drops-debug_{time_now}'
tmp_dir: Path = Path(tmp_dir_path)
tmp_dir.mkdir(parents=True)
report_file: Path = Path(f'{tmp_dir_path}/show_tech-support_report.txt')
report_file.touch()
+
+ # Call the topology snapshot function here
+ __generate_topology_snapshots(tmp_dir)
+
try:
save_stdout(op('show tech-support report'), report_file)
# Generate included archives
__generate_archived_files(tmp_dir_path)
# Generate main archive
__generate_main_archive_file(f'{tmp_path}/{archive_file_name}', tmp_dir_path)
# Delete temporary directory
rmtree(tmp_dir)
# Upload to remote site if it is scpecified
if remote:
upload(f'{tmp_path}/{archive_file_name}', args.path)
print(f'Debug file is generated and located in {location_path}/{archive_file_name}')
except Exception as err:
print(f'Error during generating a debug file: {err}')
# cleanup
if tmp_dir.exists():
rmtree(tmp_dir)
finally:
# cleanup
exit()

File Metadata

Mime Type
text/x-diff
Expires
Fri, Nov 6, 7:54 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4639872
Default Alt Text
(15 KB)

Event Timeline