---
title: "Hard restart all components on an Opsview host"
description: "Hard restarting all Opsview components on a host involves stopping services, killing processes, and removing leftover .pid and .lock files. This procedure ensures a clean restart of components to resolve startup issues caused by improper shutdowns."
url: "https://docs.itrsgroup.com/docs/faq/opsview/4920949961501-opsview-hard-restart-all-components-on-an-opsview-host/index.html"
---
If an [Opsview host](https://docs.itrsgroup.com/docs/faq/opsview/4920387360029-opsview-opsview-host/index.html) shuts down before all its Opsview [components](https://docs.itrsgroup.com/docs/faq/opsview/4996994078365-opsview-component/index.html) stop, old `.pid` and `.lock` files might prevent the components starting properly. Follow these steps to cleanly restart all Opsview components on an Opsview host, including tidying up left-over `.pid` and `.lock` files.

## Prerequisites

- None

#### Monitoring outage likely

Restarting the Opsview components on an Opsview host will likely cause a monitoring outage. The severity and extent of such an outage will vary depending on the host and its role in your Opsview environment.

### Process

1. Log in to the Opsview host as `root`.
2. Stop the Opsview components using `opsview-monit`:

```
/opt/opsview/watchdog/bin/opsview-monit stop all
```

Wait for all the components to stop. All components should be **Not monitored** when you check the `opsview-monit` summary:

```
/opt/opsview/watchdog/bin/opsview-monit summary -B
```

Depending on the speed of your system, stopping all the components may take a few minutes.

3. Stop the `opsview-agent` / `infrastructure-agent` and `opsview-watchdog` services using `systemctl`:

```
systemctl stop [opsview-agent or infrastructure-agent] opsview-watchdog
```

4. Kill any remaining `opsview` user processes using `pkill`:

```
pkill -u opsview
```

5. Check that there are no remaining processes running under the `opsview` user:

```
ps -fu opsview
```

If there are any such processes, kill them with `kill`:

- a common process not to stop, which needs to be killed is the `epmd -daemon`

```
kill -9 <pid>
```

6. Delete any Opsview `.pid` and `.lock` files using `find`:

```
find /opt/opsview -name *.pid -delete
find /opt/opsview -name *.lock -delete
```

7. Start the `opsview-agent` / `infrastructure-agent` and `opsview-watchdog` services using `systemctl`:

```
systemctl start [opsview-agent or infrastructure-agent]  opsview-watchdog
```

8. Start the Opsview components using `opsview-monit`- the initial opsview-monit command is necessary to initialise opsview-monit first

```
/opt/opsview/watchdog/bin/opsview-monit
/opt/opsview/watchdog/bin/opsview-monit start all
```

Depending on the speed of your system, starting all the components may take a few minutes.

Monitor with:

`watch /opt/opsview/watchdog/bin/opsview-monit summary -B

 - exit the commandwith CTRL+C`


