---
title: "Find an Opsview collector machine.ref"
description: "The Opsview collector machine.ref is stored locally on each host and also in the database. You can find a machine.ref by viewing the local file or querying the opsview.collectors database table."
url: "https://docs.itrsgroup.com/docs/faq/opsview/4920973849245-opsview-find-an-opsview-collector-machine-ref/index.html"
---
The [machine.ref](https://docs.itrsgroup.com/docs/faq/opsview/4920382681757-opsview-machine-ref/index.html) is stored locally on each [Opsview host](https://docs.itrsgroup.com/docs/faq/opsview/4920387360029-opsview-opsview-host/index.html) in the `/opt/opsview/var/machine.ref` file.

In addition to the `/opt/opsview/var/machine.ref` file on each [collector](https://docs.itrsgroup.com/docs/faq/opsview/4919470073373-opsview-collector/index.html), collector machine.refs are stored in the database. This means you can find a collector machine.ref by querying the database.

## Find any Opsview host’s machine.ref

### Prerequisites

- None

### Process

1. Log in to the Opsview host as `root`.
2. Use `cat` to print the host’s machine.ref:

```
cat /opt/opsview/var/machine.ref ; echo
```

#### Command structure

The machine.ref file does not end in a line break, we use `echo` to add a line break after the machine.ref to make the output more readable.

## Find a collector’s machine.ref

### Prerequisites

- None

### Process

1. Log in to the orchestrator as `root`.
2. Query the `opsview.collectors` table using `cx`:

- Note: within the database the machine.ref is recorded as collector\_ref

```
/opt/opsview/coreutils/utils/cx opsview "SELECT collector_ref FROM collectors WHERE hostname = '<collector hostname>';"
```

#### Additional query options

You can query the `opsview.collectors` table using any of the other available fields. Use this query to get a full listing of available fields:

```
/opt/opsview/coreutils/utils/cx opsview "DESC collectors;"
```


