PHPackages                             anexia/neos-monitoring - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. anexia/neos-monitoring

ActiveNeos-plugin[Logging &amp; Monitoring](/categories/logging)

anexia/neos-monitoring
======================

A neos plugin to monitor runtime versions, composer package versions and composer package licenses

1.0.1(7y ago)077MITPHPPHP &gt;=7.0

Since Oct 1Pushed 5y ago2 watchersCompare

[ Source](https://github.com/anexia-it/anexia-monitoring-neos)[ Packagist](https://packagist.org/packages/anexia/neos-monitoring)[ RSS](/packages/anexia-neos-monitoring/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Anexia Monitoring
=================

[](#anexia-monitoring)

A Neos plugin used to monitor updates for active composer packages. It can be also used to check if the website is alive and working correctly.

Installation and configuration
------------------------------

[](#installation-and-configuration)

Install the module via composer, therefore adapt the `require` part of your `composer.json`:

```
"require": {
    "anexia/neos-monitoring": "1.0.1"
}

```

In your site package `/app/Packages/Sites/[SITE_NAME]/Configuration/Settings.yaml` add the following:

```
Anexia:
  Neos:
    Monitoring:
      queryParameter: 'access_token'
      accessToken: 'YOUR_CUSTOM_ACCESS_TOKEN'
      status:
        checks:
          class: Anexia\Neos\Monitoring\Check\DatabaseCheck

```

Now run

```
composer update [-o]

```

To enable the plugin, run

```
php ./flow neos.flow:package:rescan
php ./flow package:activate Anexia.Neos.Monitoring

```

Usage
-----

[](#usage)

The package registers some custom REST endpoints which can be used for monitoring. Make sure that the **Anexia.Neos.Monitoring.accessToken** is defined, since this is used for authorization. The endpoints will return a 503 HTTP\_STATUS code if the token is not configured, 403 HTTP\_STATUS code if its missing or a 401 HTTP\_STATUS code if its invalid. If everything is ok, a 200 HTTP\_STATUS code will be returned.

#### Version monitoring of core and composer packages

[](#version-monitoring-of-core-and-composer-packages)

Returns all a list with platform and composer package information.

**URL:** `/anxapi/v1/modules?access_token=custom_access_token`

Response headers:

```
Status Code: 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Allow: GET
Content-Type: application/json

```

Response body:

```
{
   "runtime":{
      "platform":"php",
      "platform_version":"7.0.0",
      "framework":"neos",
      "framework_installed_version":"3.0.0",
      "framework_newest_version":"5.0.0"
   },
   "modules":[
      {
         "name":"package-1",
         "installed_version":"3.1.10",
         "installed_version_licences":[
            "BSD-2-Clause"
         ],
         "newest_version":"3.3.2",
         "newest_version_licences":[
            "BSD-3-Clause"
         ]
      },
      {
         "name":"package-2",
         "installed_version":"1.4",
         "installed_version_licences":[
            "MIT"
         ],
         "newest_version":"1.4",
         "newest_version_licences":[
            "MIT"
         ]
      },
      ...
   ]
}

```

#### Live monitoring

[](#live-monitoring)

This endpoint can be used to verify if the application is alive and working correctly. It checks if the database connection is working. It allows to register custom checks by simply adding classes to the config.

**URL:** `/anxapi/v1/up?access_token=custom_access_token`

Response headers:

```
Status Code: 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Credentials: true
Content-Type: text/plain

```

Response body:

```
OK

```

**Custom up check failure (without custom error message):**

Response headers (custom check failed without additional error message):

```
Status Code: 500 Internal Server Error
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Allow: GET
Content-Type: text/plain

```

Response body (containing default error message):

```
CLASS didn't pass the check.

```

**Custom up check failure (with custom error message):**

Response headers (custom check failed without additional error message):

```
Status Code: 500 Internal Server Error
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Credentials: true
Content-Type: text/plain

```

Response body (containing custom error message):

```
This is an example for a custom db check error message!

```

**Custom live monitoring hooks:**

The `anexia/neos-monitoring` only checks the DB connection. To add further up checks a customized class can be defined. This class must implement the `Anexia\Neos\Monitoring\Check\CheckInterface`.

Add a new class to the project source code tree as `/app/Packages/Sites/[SITE_NAME]/Classes/Check/CustomCheck.php`, e.g.:

```
