| 1 | # Service Control |
| 2 | |
| 3 | :::tip |
| 4 | |
| 5 | **What You'll Learn** |
| 6 | |
| 7 | How to start, stop, restart, and reload the Netdata Agent across different operating systems and service management systems. |
| 8 | |
| 9 | ::: |
| 10 | |
| 11 | The Netdata Agent automatically starts at boot after installation. |
| 12 | |
| 13 | :::important |
| 14 | |
| 15 | **Important** |
| 16 | |
| 17 | In most cases, you need to **restart the Netdata service** to apply changes to configuration files. Health configuration files, which define alerts, are an exception. They can be [reloaded](#reload-health) **without restarting**. |
| 18 | |
| 19 | ::: |
| 20 | |
| 21 | :::warning |
| 22 | |
| 23 | **Service Restart Impact** |
| 24 | |
| 25 | Restarting the Netdata Agent will cause temporary gaps in your collected metrics. This occurs while the netdata process reinitializes its data collectors and database engine. |
| 26 | |
| 27 | ::: |
| 28 | |
| 29 | ## UNIX |
| 30 | |
| 31 | ### Using `systemctl`, `service`, or `init.d` |
| 32 | |
| 33 | | Action | Systemd | Non-systemd | |
| 34 | |---------|----------------------------------|----------------------------------------------------------------------| |
| 35 | | start | `sudo systemctl start netdata` | `sudo service netdata start` or `sudo /etc/init.d/netdata start` | |
| 36 | | stop | `sudo systemctl stop netdata` | `sudo service netdata stop` or `sudo /etc/init.d/netdata stop` | |
| 37 | | restart | `sudo systemctl restart netdata` | `sudo service netdata restart` or `sudo /etc/init.d/netdata restart` | |
| 38 | | status | `sudo systemctl status netdata` | `sudo service netdata status` or `sudo /etc/init.d/netdata status` | |
| 39 | |
| 40 | ### Check status |
| 41 | |
| 42 | Use the commands above to check whether the Netdata Agent service is running. |
| 43 | |
| 44 | You can also verify that the Agent is reachable by opening `http://NODE:19999` in a browser, or by running: |
| 45 | |
| 46 | ```bash |
| 47 | curl http://NODE:19999/api/v1/info |
| 48 | ``` |
| 49 | |
| 50 | Replace `NODE` with the IP address or hostname of your Agent. |
| 51 | |
| 52 | :::tip |
| 53 | |
| 54 | Use `sudo netdatacli ping` to check whether the Agent is ready. It outputs `pong` with exit code `0` when the Agent is ready, exit code `1` while still initializing, and exit code `255` if the Agent is unreachable. |
| 55 | |
| 56 | ::: |
| 57 | |
| 58 | ### Using `netdata` |
| 59 | |
| 60 | Use the `netdata` command, typically located at `/usr/sbin/netdata`, to start the Netdata daemon. |
| 61 | |
| 62 | ```bash |
| 63 | sudo netdata |
| 64 | ``` |
| 65 | |
| 66 | If you start the daemon this way, close it with `sudo killall netdata`. |
| 67 | |
| 68 | ### Using `netdatacli` |
| 69 | |
| 70 | The Netdata Agent also comes with a [CLI tool](/src/cli/README.md) capable of performing shutdowns. Start the Agent back up using your preferred method listed above. |
| 71 | |
| 72 | ```bash |
| 73 | sudo netdatacli shutdown-agent |
| 74 | ``` |
| 75 | |
| 76 | ### Reload health |
| 77 | |
| 78 | No need to restart the Netdata Agent after modifying health configuration files (alerts). Use `netdatacli` to avoid metric collection gaps. |
| 79 | |
| 80 | ```bash |
| 81 | sudo netdatacli reload-health |
| 82 | ``` |
| 83 | |
| 84 | ## Windows |
| 85 | |
| 86 | :::note |
| 87 | |
| 88 | You will need to run PowerShell as administrator. |
| 89 | |
| 90 | ::: |
| 91 | |
| 92 | ### Using Task Manager |
| 93 | |
| 94 | If you prefer to manage the Agent through the GUI, you can start-stop and restart the `Netdata` service from the "Services" tab of Task Manager. |
| 95 | |
| 96 | ### Using PowerShell Commands |
| 97 | |
| 98 | - To **check the status** of Netdata, run `Get-Service netdata`. |
| 99 | - To **start** Netdata, run `Start-Service netdata`. |
| 100 | - To **stop** Netdata, run `Stop-Service netdata`. |
| 101 | - To **restart** Netdata, run `Restart-Service netdata`. |
| 102 | |
| 103 | ## Quick Reference |
| 104 | |
| 105 | ### UNIX Commands Summary |
| 106 | |
| 107 | | Task | Systemd | Non-systemd | Direct Command | |
| 108 | |-------------------|----------------------------------|----------------------------------------------------------------------|--------------------------------------| |
| 109 | | **Start** | `sudo systemctl start netdata` | `sudo service netdata start` or `sudo /etc/init.d/netdata start` | `sudo netdata` | |
| 110 | | **Stop** | `sudo systemctl stop netdata` | `sudo service netdata stop` or `sudo /etc/init.d/netdata stop` | `sudo killall netdata` | |
| 111 | | **Restart** | `sudo systemctl restart netdata` | `sudo service netdata restart` or `sudo /etc/init.d/netdata restart` | Stop + Start | |
| 112 | | **Status** | `sudo systemctl status netdata` | `sudo service netdata status` or `sudo /etc/init.d/netdata status` | `curl http://NODE:19999/api/v1/info` | |
| 113 | | **Reload Health** | `sudo netdatacli reload-health` | `sudo netdatacli reload-health` | `sudo netdatacli reload-health` | |
| 114 | | **Shutdown** | `sudo netdatacli shutdown-agent` | `sudo netdatacli shutdown-agent` | `sudo netdatacli shutdown-agent` | |
| 115 | |
| 116 | ### Windows Commands Summary |
| 117 | |
| 118 | | Task | PowerShell Command | GUI Location | |
| 119 | |-------------|---------------------------|-----------------------------------| |
| 120 | | **Status** | `Get-Service netdata` | Task Manager > Services > Netdata | |
| 121 | | **Start** | `Start-Service netdata` | Task Manager > Services > Netdata | |
| 122 | | **Stop** | `Stop-Service netdata` | Task Manager > Services > Netdata | |
| 123 | | **Restart** | `Restart-Service netdata` | Task Manager > Services > Netdata | |