By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
IT Infras HolicIT Infras HolicIT Infras Holic
  • News
  • Linux
    • Application
    • SELinux
    • Centos
    • Ubuntu
  • Docker
  • Web Server
    • Kong
    • Nginx
    • Openlitespeed
  • Database
  • Mikrotik
  • Windows
  • Mail
  • Tools
    • 2048
    • Fantasy Forest
    • Hextris
    • Crossword
Search
  • Privacy Policy
© 2024. All Rights Reserved.
Font ResizerAa
IT Infras HolicIT Infras Holic
Font ResizerAa
  • News
  • Linux
  • Docker
  • Web Server
  • Database
  • Mikrotik
  • Windows
  • Mail
  • Tools
Search
  • News
  • Linux
    • Application
    • SELinux
    • Centos
    • Ubuntu
  • Docker
  • Web Server
    • Kong
    • Nginx
    • Openlitespeed
  • Database
  • Mikrotik
  • Windows
  • Mail
  • Tools
    • 2048
    • Fantasy Forest
    • Hextris
    • Crossword
Follow US
© 2022 Foxiz News Network. Ruby Design Company. All Rights Reserved.
IT Infras Holic > Blog > Cloud Services > Alibaba Cloud (Aliyun) > How to Uninstall CloudMonitor Agent (Alibaba CLoud)
Alibaba Cloud (Aliyun)Cloud ServicesLinuxWindows

How to Uninstall CloudMonitor Agent (Alibaba CLoud)

writer
Share
3 Min Read
SHARE

How to uninstall CloudMonitor agent?

 

Contents
How to uninstall CloudMonitor agent?WindowsLinux

This topic describes how to uninstall the CloudMonitor agent for Java, Go, or C++.

 

How to uninstall CloudMonitor agent

Windows

  1. Log on to the host where the CloudMonitor agent resides as the administrator.
  2. Create a .ps1 file, such as the test.ps1 file.
  3. Copy the following content to the test.ps1 file:

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
if([System.Environment]::Is64BitOperatingSystem -eq $true)
{
    $CMS_ARCH="amd64"
    $ARGUS_ARCH="win64"
}else
{
    $CMS_ARCH="386"
    $ARGUS_ARCH="win32"
}
 
$dest_path_prefix="C:\Program Files\Alibaba"
$dest_path="$dest_path_prefix\cloudmonitor"
 
echo "the current arch is $CMS_ARCH"
 
$go_dest_file="CmsGoAgent.windows-$CMS_ARCH.exe"
$argus_dest_file="cloudmonitor_$ARGUS_ARCH.zip"
$downloadpath="Argus/$CMS_VERSION/$argus_dest_file"
 
if (Test-Path "$dest_path\wrapper\bin\AppCommand.bat")
{
   echo "old java cloudmonitor already installed - remove it..."
   & "$dest_path\wrapper\bin\AppCommand.bat" remove
   rm -Force -Recurse "$dest_path"
}
if (Test-Path "C:\Program Files (x86)\Alibaba\cloudmonitor\wrapper\bin\AppCommand.bat" )
{
    echo "old java cloudmonitor already installed - remove it..."
    & "C:\Program Files (x86)\Alibaba\cloudmonitor\wrapper\bin\AppCommand.bat" remove
    rm -Force -Recurse "C:\Program Files (x86)\Alibaba\cloudmonitor"
}
 
if (Test-Path "$dest_path\$go_dest_file")
{
    "echo remove go-agent"
    & "$dest_path\$go_dest_file" stop
    & "$dest_path\$go_dest_file" uninstall
}
  1. Save and close the test.ps1 file.
  2. Right-click the test.ps1 file and select Run with PowerShell.

 

How to uninstall CloudMonitor agent

Linux

  1. Log on to the host where the CloudMonitor agent resides as the root user.
  2. Create a script file. For example, run the following command to create the test.sh file:

1
touch test.sh

 

  1. Run the following command to open the test.sh file:

1
vi test.sh

 

  1. Copy the following content to the test.sh file:

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
 
if [ -z "${CMS_HOME}" ]; then
  CMS_HOME_PREFIX="/usr/local"
  if [ -f /etc/os-release -a ! -z "`egrep -i coreos /etc/os-release`" ];then
    CMS_HOME_PREFIX="/opt"
  fi
fi
CMS_HOME="${CMS_HOME_PREFIX}/cloudmonitor"
 
if [ `uname -m` = "x86_64" ]; then
    ARCH="amd64"
    ARGUS_ARCH="64"
else
    ARCH="386"
    ARGUS_ARCH="32"
fi
 
case `uname -s` in
  Linux)
    CMS_OS="linux"
    ;;
  *)
    echo "Unsupported OS: $(uname -s)"
    exit 1
    ;;
esac
 
DEST_START_FILE=${CMS_HOME}/cloudmonitorCtl.sh
# Uninstall the CloudMonitor agent for Java or Go.
GOAGENT_ELF_NAME=${CMS_HOME}/CmsGoAgent.${CMS_OS}-${ARCH}
if [ -d ${CMS_HOME} ] ; then
  if [ -f ${DEST_START_FILE} ];then
    ${DEST_START_FILE} stop
  fi
  if [ -f ${CMS_HOME}/wrapper/bin/cloudmonitor.sh ] ; then
    ${CMS_HOME}/wrapper/bin/cloudmonitor.sh remove;
    rm -rf ${CMS_HOME};
  fi
  if [ -f ${GOAGENT_ELF_NAME} ]; then
    ${GOAGENT_ELF_NAME} stop
    rm -rf ${CMS_HOME}
  fi
fi
  1. Press the Esc key, enter :wq, and then press the Enter key to save and close the test.sh file.
  2. Run the following command to run the test.sh file:

1
sh test.sh

Done, you have done uninstall CloudMonitor agent

You Might Also Like

Monitoring File & Directory Changes using Bash Script

Vulnerability Checker CVE-2024-3094

Unleashing the Potential of Knowledge Management with Wiki.js

How to Install Apache Guacamole with Docker Compose

Unlocking Seamless Remote Access: Exploring the Power of Apache Guacamole

TAGGED: alibaba cloud, aliyun, cloudmonitor
Share This Article
Facebook Twitter Whatsapp Whatsapp LinkedIn Telegram Copy Link
Previous Article How to Enable Docker Remote API How to Enable Docker Remote API
Next Article Change Docker TImezone How to Change Docker Timezone
3 Comments
  • gothammag says:
    January 10, 2023 at 2:10 am

    I am really impressed with your writing skills and also with the layout on your weblog.
    Is this a paid theme or did you modify it yourself? Anyway keep up the nice quality writing, it’s rare to see a
    nice blog like this one these days.

    Reply
  • boostaro says:
    January 9, 2024 at 2:19 pm

    Thank you so much!

    Reply
  • uc satın al says:
    April 17, 2024 at 3:23 pm

    Thanks for thr great article!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Latest News

bash
Monitoring File & Directory Changes using Bash Script
Linux Application
vulnerability
Vulnerability Checker CVE-2024-3094
Linux
wiki.js
Unleashing the Potential of Knowledge Management with Wiki.js
Application Linux
Install Apache Guacamole
How to Install Apache Guacamole with Docker Compose
Application Linux

You Might also Like

How to Install Cyberpanel on Ubuntu 22.04
OpenlitespeedUbuntuWeb Server

Install Cyberpanel on Ubuntu 22.04

8 Min Read
How to map SFTP as a drive on Windows 10
LinuxWindows

How to map SFTP as a drive on Windows 10

3 Min Read
Follow US
© 2024
activity notes activity notes
Welcome Back!

Sign in to your account

Lost your password?