From 02be5df186fa8391bf78acb918400855b2b4e537 Mon Sep 17 00:00:00 2001 From: Manuel Abascal Date: Mon, 13 Oct 2025 09:45:04 -0500 Subject: [PATCH 1/2] feat(utmstack): update installation and uninstallation commands for UTMStack Collector Signed-off-by: Manuel Abascal --- .../guide-utmstack.component.ts | 44 +++++++++++++------ 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/frontend/src/app/app-module/guides/guide-utmstack/guide-utmstack.component.ts b/frontend/src/app/app-module/guides/guide-utmstack/guide-utmstack.component.ts index e8d312dad..d8fc7eb00 100644 --- a/frontend/src/app/app-module/guides/guide-utmstack/guide-utmstack.component.ts +++ b/frontend/src/app/app-module/guides/guide-utmstack/guide-utmstack.component.ts @@ -65,14 +65,14 @@ export class GuideUtmstackComponent implements OnInit { this.architectures = [ { id: 1, name: 'Ubuntu 16/18/20+', - install: this.getCommandUbuntu('utmstack_agent_service'), - uninstall: this.getUninstallCommand('utmstack_agent_service'), + install: this.getCommandUbuntu('utmstack_collector'), + uninstall: this.getUninstallCommandUbuntu('utmstack_collector'), shell: '' }, { id: 2, name: 'Centos 7/Red Hat Enterprise Linux', - install: this.getCommandCentos7RedHat('utmstack_agent_service'), - uninstall: this.getUninstallCommand('utmstack_agent_service'), + install: this.getCommandCentos7RedHat('utmstack_collector'), + uninstall: this.getUninstallCommandRedHat('utmstack_collector'), shell: '' }, ]; @@ -81,29 +81,47 @@ export class GuideUtmstackComponent implements OnInit { getCommandUbuntu(installerName: string): string { const ip = window.location.host.includes(':') ? window.location.host.split(':')[0] : window.location.host; - return `sudo bash -c "apt update -y && apt install wget -y && mkdir -p /opt/utmstack-collector && \ + return `sudo bash -c "apt update -y && \ + apt install wget -y && \ + mkdir -p /opt/utmstack-collector && \ wget --no-check-certificate -P /opt/utmstack-collector \ https://${ip}:9001/private/dependencies/collector/${installerName} && \ chmod -R 777 /opt/utmstack-collector/${installerName} && \ /opt/utmstack-collector/${installerName} install ${ip} ${this.token} yes"`; } + getCommandCentos7RedHat(installerName: string): string { const ip = window.location.host.includes(':') ? window.location.host.split(':')[0] : window.location.host; - return `sudo bash -c "yum install wget -y && mkdir -p /opt/utmstack-collector && \ + return `sudo bash -c "dnf update -y && \ + dnf install wget -y && \ + mkdir -p /opt/utmstack-collector && \ wget --no-check-certificate -P /opt/utmstack-collector \ https://${ip}:9001/private/dependencies/collector/${installerName} && \ chmod -R 777 /opt/utmstack-collector/${installerName} && \ /opt/utmstack-collector/${installerName} install ${ip} ${this.token} yes"`; } - getUninstallCommand(installerName: string): string { - return `sudo bash -c "/opt/utmstack-collector/${installerName} uninstall || true; \ - systemctl stop UTMStackCollector 2>/dev/null || true; systemctl disable UTMStackCollector 2>/dev/null || true; \ - rm -f /etc/systemd/system/UTMStackCollector.service 2>/dev/null || true; \ - systemctl daemon-reload 2>/dev/null || true; \ - echo 'Removing UTMStack Collector dependencies...' && sleep 10 && rm -rf /opt/utmstack-collector 2>/dev/null || true; \ - echo 'UTMStack Collector dependencies removed successfully.'"`; + getUninstallCommandUbuntu(installerName: string): string { + return `sudo bash -c "/opt/utmstack-collector/${installerName} uninstall && \ + (systemctl stop UTMStackCollector 2>/dev/null || service UTMStackCollector stop 2>/dev/null || true) && \ + (systemctl disable UTMStackCollector 2>/dev/null || chkconfig UTMStackCollector off 2>/dev/null || true) && \ + rm -rf /opt/utmstack-collector && \ + rm -f /etc/systemd/system/UTMStackCollector.service && \ + rm -f /etc/init.d/UTMStackCollector && \ + (systemctl daemon-reload 2>/dev/null || true) && \ + echo 'UTMStack Collector uninstalled successfully'"`; + } + + + getUninstallCommandRedHat(installerName: string): string { + return `sudo bash -c "/opt/utmstack-collector/${installerName} uninstall && \ + (systemctl stop UTMStackCollector 2>/dev/null || true) && \ + (systemctl disable UTMStackCollector 2>/dev/null || true) && \ + rm -rf /opt/utmstack-collector && \ + rm -f /etc/systemd/system/UTMStackCollector.service && \ + systemctl daemon-reload && \ + echo 'UTMStack Collector uninstalled successfully'"`; } } From bce0d19ff850d7e1df7f086ba6bedd191b4d7dff Mon Sep 17 00:00:00 2001 From: Manuel Abascal Date: Mon, 13 Oct 2025 09:54:41 -0500 Subject: [PATCH 2/2] Update frontend/src/app/app-module/guides/guide-utmstack/guide-utmstack.component.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../guides/guide-utmstack/guide-utmstack.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/app-module/guides/guide-utmstack/guide-utmstack.component.ts b/frontend/src/app/app-module/guides/guide-utmstack/guide-utmstack.component.ts index d8fc7eb00..c1d2f9d8d 100644 --- a/frontend/src/app/app-module/guides/guide-utmstack/guide-utmstack.component.ts +++ b/frontend/src/app/app-module/guides/guide-utmstack/guide-utmstack.component.ts @@ -70,7 +70,7 @@ export class GuideUtmstackComponent implements OnInit { shell: '' }, { - id: 2, name: 'Centos 7/Red Hat Enterprise Linux', + id: 2, name: 'CentOS 8+/Red Hat Enterprise Linux', install: this.getCommandCentos7RedHat('utmstack_collector'), uninstall: this.getUninstallCommandRedHat('utmstack_collector'), shell: ''