> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/p/php-server-monitor.md).

# PHP Server Monitor

PHP Server Monitor checks the availability of servers and websites. OctoXLabs reads its MySQL database to add the monitored servers as devices and the monitor users as users.

## Use cases

* List servers that PHP Server Monitor watches.

```
Adapters = php-server-monitor
```

* Find servers last checked more than 7 days ago.

```
Adapters = php-server-monitor AND NOT LastSeen last now-7d/d
```

## Before you begin

### Network

| Source              | Destination                        | Port                | Protocol |
| ------------------- | ---------------------------------- | ------------------- | -------- |
| OctoXLabs connector | MySQL server of PHP Server Monitor | 3306 (configurable) | MySQL    |

### Required permissions

| Scope or role | Permission                                | Needed for               |
| ------------- | ----------------------------------------- | ------------------------ |
| MySQL user    | SELECT on the PHP Server Monitor database | Servers and users tables |

## Create credentials in PHP Server Monitor

{% stepper %}
{% step %}

### Create a MySQL user

Create a MySQL user for OctoXLabs and grant it SELECT on the PHP Server Monitor database.
{% endstep %}

{% step %}

### Find the table names

Check the database for the exact names of the servers and users tables, for example `monitor_servers` and `monitor_users`.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter          | Required | Type    | Default | Description                                               |
| ------------------ | -------- | ------- | ------- | --------------------------------------------------------- |
| IP                 | Yes      | String  |         | IP address of the MySQL server.                           |
| Port               | No       | Integer | 3306    | MySQL port.                                               |
| Domain             | No       | String  |         | Domain FQDN. If set, the login becomes `domain\username`. |
| Database           | Yes      | String  |         | Name of the PHP Server Monitor database.                  |
| Username           | Yes      | String  |         | MySQL user.                                               |
| Password           | Yes      | String  |         | Password of the user.                                     |
| Servers Table Name | Yes      | String  |         | Table with the monitored servers.                         |
| Users Table Name   | Yes      | String  |         | Table with user accounts.                                 |
| Query Timeout      | No       | Integer | 60      | Seconds before a query is stopped.                        |

## Troubleshooting

| Error message           | Cause           | Fix                                                 |
| ----------------------- | --------------- | --------------------------------------------------- |
| Curser Failed Execute : | A query failed. | Check the table names and that the user has SELECT. |

## Change history

{% hint style="info" %}
Available starting from version 6.6.0.
{% endhint %}
