• Support
  • What's correct way to remove Netdata? Automated method not working

I find Netdata is taking up quite a bit of RAM, and as I never use it, I'd like to remove it.

I saw here an instruction on how to properly remove it.

I used this command: wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && sh /tmp/netdata-kickstart.sh --uninstall

But using that command failed for me. I tried it without, and then with sudo in case that was the cause of the issue.

Here's the output:

inspiredearth@whc4:/tmp$ sudo wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && sh /tmp/netdata-kickstart.sh --uninstall
--2023-01-14 08:18:27--  https://my-netdata.io/kickstart.sh
Resolving my-netdata.io (my-netdata.io)... 104.21.13.159, 172.67.156.192, 2606:4700:3031::6815:d9f, ...
Connecting to my-netdata.io (my-netdata.io)|104.21.13.159|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/octet-stream]
Saving to: ‘/tmp/netdata-kickstart.sh’

/tmp/netdata-kickstart.sh                                                 [ <=>                                                                                                                                                                    ]  79.14K  --.-KB/s    in 0.009s

2023-01-14 08:18:27 (8.38 MB/s) - ‘/tmp/netdata-kickstart.sh’ saved [81037]

 --- Using /tmp/netdata-kickstart-p4ykn4G9Iq as a temporary directory. ---
 --- Checking for existing installations of Netdata... ---
 --- Downloading netdata-uninstaller ... ---
[/tmp/netdata-kickstart-p4ykn4G9Iq]$ curl --fail -q -sSL --connect-timeout 10 --retry 3 --output /tmp/netdata-kickstart-p4ykn4G9Iq/netdata-uninstaller.sh https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/netdata-uninstaller.sh
 OK

[/tmp/netdata-kickstart-p4ykn4G9Iq]$ sudo /tmp/netdata-kickstart-p4ykn4G9Iq/netdata-uninstaller.sh --yes
/tmp/netdata-kickstart-p4ykn4G9Iq/netdata-uninstaller.sh: 699: .: Can't open /etc/netdata/.environment

Sat Jan 14 08:18:27 UTC 2023 : FATAL: netdata-uninstaller.sh: FAILED TO UNINSTALL NETDATA:  Failed to completely remove Netdata from this system.
 FAILED

Finished uninstalling the Netdata Agent.The following non-fatal warnings or errors were encountered:

  - Command "sudo /tmp/netdata-kickstart-p4ykn4G9Iq/netdata-uninstaller.sh --yes" failed with exit code 1.

It looks like I took the wrong approach because of what I read here. Which gave me the impression wo stack remove --netdata wasn't the right way.

I've since tried that command, it seems to have worked just fine.

22 days later

I am now (weeks later) trying to remove Netdata from another server. I find that just using wo stack remove --netdata seems to have no impact on Netdata.

I get the output,

~$ wo stack remove --netdata
Are you sure you to want to remove from server.
Package configuration will remain on server after this operation.
Remove stacks [y/N]?y
Removing /var/lib/wo/tmp/kickstart.sh                                      [Done]
Removing packages               [OK]
Successfully removed packages

And yet Netdata is still installed and running.

Please advise.

Further update (in case anyone else wanting to remove Netdata happens to find this) ...

On this latest server, running the command wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && sh /tmp/netdata-kickstart.sh --uninstall worked perfectly. The only different I know of is that I ran it after running the wo command, wo stack remove --netdata (which seemed to do nothing).

So ... PERHAPS that's the way to remove Netdata.

  1. Run wo stack remove --netdata
  2. Then run wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && sh /tmp/netdata-kickstart.sh --uninstall

The output I got from running the kickstart script (after running the wo command) was:

~$ wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && sh /tmp/netdata-kickstart.sh --uninstall
--2023-02-05 19:53:24--  https://my-netdata.io/kickstart.sh
Resolving my-netdata.io (my-netdata.io)... 172.67.156.192, 104.21.13.159, 2606:4700:3031::6815:d9f, ...
Connecting to my-netdata.io (my-netdata.io)|172.67.156.192|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/octet-stream]
Saving to: ‘/tmp/netdata-kickstart.sh’

/tmp/netdata-kickstart.sh                                            [ <=>                                                                                                                                                    ]  79.58K  --.-KB/s    in 0.01s

2023-02-05 19:53:24 (7.98 MB/s) - ‘/tmp/netdata-kickstart.sh’ saved [81488]


 --- Using /tmp/netdata-kickstart-v7uP1Tj3yN as a temporary directory. ---
 --- Checking for existing installations of Netdata... ---
 --- Downloading netdata-uninstaller ... ---
[/tmp/netdata-kickstart-v7uP1Tj3yN]$ curl --fail -q -sSL --connect-timeout 10 --retry 3 --output /tmp/netdata-kickstart-v7uP1Tj3yN/netdata-uninstaller.sh https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/netdata-uninstaller.sh
 OK

[/tmp/netdata-kickstart-v7uP1Tj3yN]$ sudo /tmp/netdata-kickstart-v7uP1Tj3yN/netdata-uninstaller.sh --yes
Found netdata native installation
Do you want to remove netdata?  [y/n]
y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libnetfilter-acct1 libprotobuf17 libsnappy1v5
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  netdata
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 128 MB disk space will be freed.
(Reading database ... 125791 files and directories currently installed.)
Removing netdata (1.37.0-260-nightly) ...
Do you want to remove netdata-repo-edge?  [y/n]
y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  debian-archive-keyring libnetfilter-acct1 libprotobuf17 libsnappy1v5
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  netdata-repo-edge
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 18.4 kB disk space will be freed.
(Reading database ... 124377 files and directories currently installed.)
Removing netdata-repo-edge (2-1) ...
dpkg-query: package 'netdata-repo' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.
 OK

The VMs always seem much happier (less bogged down in memory and CPU) after Netdata is removed. I won't be using Netdata on WO any more. It's a resource hog.

    2 years later

    I was LITERALLY coming here to ask the exact same question since netdata is almost always at the top of my cpu resources (when doing the HTOP command) and I never use it

    @corus9 so would the command be. . .

    wo stack purge netdata

    or is there something else to it?

      Endda that;s about it, add --force if still does not work

      @alexlii1971 did that command work for you with/without the pruge attribute?

      @corus9 I did the command and it says it executed it properly, but I still see the service at the top of htop

      do i need to reboot the vps or something?

        corus9

        I tried:

        wo stack stop --netdata --force

        wo stack remove --netdata --force

        wo stack purge --netdata --force

        but it still is running:

        I already report on Github, but there is no reply.

          jonathannz

          The following method does not work for m:

          Run wo stack remove --netdata
          Then run wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && sh /tmp/netdata-kickstart.sh --uninstall

          sudo wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && sh /tmp/netdata-kickstart.sh --uninstall
          --2024-09-18 04:17:46-- https://my-netdata.io/kickstart.sh
          Resolving my-netdata.io (my-netdata.io)... 2606:4700:3031::6815:d9f, 2606:4700:3036::ac43:9cc0, 172.67.156.192, ...
          Connecting to my-netdata.io (my-netdata.io)|2606:4700:3031::6815:d9f|:443... connected.
          HTTP request sent, awaiting response... 307 Temporary Redirect
          Location: https://get.netdata.cloud/kickstart.sh [following]
          --2024-09-18 04:17:46-- https://get.netdata.cloud/kickstart.sh
          Resolving get.netdata.cloud (get.netdata.cloud)... 2606:4700:20::681a:98d, 2606:4700:20::681a:88d, 2606:4700:20::ac43:48aa, ...
          Connecting to get.netdata.cloud (get.netdata.cloud)|2606:4700:20::681a:98d|:443... connected.
          HTTP request sent, awaiting response... 200 OK
          Length: 93642 (91K) [application/octet-stream]
          Saving to: ‘/tmp/netdata-kickstart.sh’

          /tmp/netdata-kickstart.sh 100%[=========================================================>] 91.45K --.-KB/s in 0.003s

          2024-09-18 04:17:46 (27.9 MB/s) - ‘/tmp/netdata-kickstart.sh’ saved [93642/93642]

          --- Using /tmp/netdata-kickstart-6QKZyR1c32 as a temporary directory. ---
          --- Checking for existing installations of Netdata... ---
          [/tmp/netdata-kickstart-6QKZyR1c32]# test -x /usr/libexec/netdata/netdata-uninstaller.sh
          FAILED

          --- Downloading netdata-uninstaller ... ---
          [/tmp/netdata-kickstart-6QKZyR1c32]# /usr/bin/curl --fail -q -sSL --connect-timeout 10 --retry 3 --output /tmp/netdata-kickstart-6QKZyR1c32/netdata-uninstaller.sh https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/netdata-uninstaller.sh
          OK

          [/tmp/netdata-kickstart-6QKZyR1c32]# /tmp/netdata-kickstart-6QKZyR1c32/netdata-uninstaller.sh --yes
          /tmp/netdata-kickstart-6QKZyR1c32/netdata-uninstaller.sh: 720: .: cannot open /etc/netdata/.environment: No such file

          Wed Sep 18 04:17:46 UTC 2024 : FATAL: netdata-uninstaller.sh: FAILED TO UNINSTALL NETDATA: Failed to completely remove Netdata from this system.
          FAILED

          WARNING Uninstaller failed. Some parts of Netdata may still be present on the system.

          Finished uninstalling the Netdata Agent.The following non-fatal warnings or errors were encountered:

          • Command "test -x /usr/libexec/netdata/netdata-uninstaller.sh" failed with exit code 1.
          • Command "/tmp/netdata-kickstart-6QKZyR1c32/netdata-uninstaller.sh --yes" failed with exit code 1.
          • Uninstaller failed. Some parts of Netdata may still be present on the system.

          [/root]# rm -rf /tmp/netdata-kickstart-6QKZyR1c32
          OK

          I was just about to go and submit an official bug report. but am happy to see you have already done that alexlii

          I hope this gets resolved soon as I remember having issues uninstalling this for many versions now

          portofacil I just did a reboot and netdata is still showing up as a running/active service

          This script is part of a tool I use on non-WO servers. I stripped the parts that don't relate to removing Netdata. Perhaps it can help you.

          #!/bin/bash
          
          # Function to print messages
          print_message() {
              echo "--------------------------------------------------"
              echo "$1"
              echo "--------------------------------------------------"
          }
          
          # Stop the Netdata service
          print_message "Stopping Netdata service"
          sudo systemctl stop netdata
          
          # Disable the Netdata service
          print_message "Disabling Netdata service"
          sudo systemctl disable netdata
          
          # Uninstall Netdata
          print_message "Uninstalling Netdata"
          sudo apt-get remove --purge -y netdata
          
          # Remove residual configuration files
          print_message "Removing residual configuration files"
          sudo apt-get autoremove --purge -y netdata
          
          # Remove Netdata directories and files
          print_message "Removing Netdata directories and files"
          sudo rm -rf /etc/netdata /var/lib/netdata /usr/lib/netdata /var/cache/netdata /var/log/netdata /usr/share/netdata
          
          # Remove Netdata user and group
          print_message "Removing Netdata user and group"
          sudo deluser --remove-home netdata
          sudo delgroup netdata
          
          # Clean up systemd service
          print_message "Cleaning up systemd service"
          sudo systemctl daemon-reload
          sudo systemctl reset-failed
          
          # Check for any remaining Netdata processes and kill them
          print_message "Checking for remaining Netdata processes"
          remaining_processes=$(ps aux | grep netdata | grep -v grep)
          
          if [ -n "$remaining_processes" ]; then
              print_message "Killing remaining Netdata processes"
              sudo killall netdata
          else
              print_message "No remaining Netdata processes found"
          fi
          
          print_message "Netdata uninstallation complete"
            5 days later

            portofacil I could just copy/paste these commands, right? instead of uploading a script and running it?

            Hosted by VirtuBox