PHPackages                             mmd/mc-monitor - 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. mmd/mc-monitor

ActiveSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

mmd/mc-monitor
==============

Service for monitoring minecraft servers

123PHP

Since Apr 2Pushed 10y agoCompare

[ Source](https://github.com/MmdBundles/McMonitorBundle)[ Packagist](https://packagist.org/packages/mmd/mc-monitor)[ RSS](/packages/mmd-mc-monitor/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Minecraft Servers Monitor
=========================

[](#minecraft-servers-monitor)

Create your own service that makes regular requests to minecraft servers and sends the information to a webhook (your site).

This will prevent your site being blocked when making requests to servers.

Install
-------

[](#install)

- Install the bundle and its dependecies

    ```
    composer require \
        'mmd/mc-monitor:dev-master' \
        'sensio/buzz-bundle:dev-master' \
        'neitanod/forceutf8:dev-master' \
        'xpaw/php-minecraft-query:dev-master'
    ```
- Include bundle in `app/AppKernel.php`

    ```
    $bundles = array(
        ...
        new Mmd\Bundle\McMonitorBundle\MmdMcMonitorBundle(),
    );
    ```
- Include routing in `app/config/routing.yml`

    ```
    mmd_mc_monitor:
        resource: "@MmdMcMonitorBundle/Resources/config/routing.yml"
        prefix:   /mc-monitor
    ```
- Add parameters to `app/config/parameters.yml`

    ```
    # The secret used in API requests
    mmd.mc_monitor.secret: "my-secret"

    # The url to your site (with server list) where monitoring will send servers status updates
    mmd.mc_monitor.webhook: "https://my-site.com/monitoring-updates"
    ```
- Create database tables

    ```
    php app/console doctrine:schema:update --force
    ```

Configure
---------

[](#configure)

- Set crontab to execute command that checks servers status and send information to the webhook

    ```
    cd /path/to/project/root/
    sudo -u www-data php app/console mmd:mc-monitor:check 3
    ```

You can specify how many servers to check at once.

The servers will be ordered ascending by last checked time.

Run command as apache user `www-data` to prevent `Unable to write in the cache directory` error. In this case the cron must be set as root user for the `sudo` command to work in background.

Usage
-----

[](#usage)

- Add server ip to monitoring

    ```
    # Request
    GET /mc-monitor/api/v1//add/

    ```

    ```
    # Response
    {"status":true, "message": "Server added"}
    # or
    {"status":false, "message": "Invalid ip"}

    ```
- In your application, you must handle monitoring server updates requests to the url set in the `mmd.mc_monitor.webhook` parameter

The monitoring will do requests in the following format

```
POST https://site.com/secret-url-for-mc-monitor/
{
    secret: "",
    servers: {
        "": {
            status: true, /* true=online, false=offline */
            data: {
                'hostname': 'Awesome minecraft server motd',
                'numplayers': 7,
                'maxplayers': 20,
                'version': '1.8'
            }
        },
        "": {...},
        ...
    }
}

```

- Remove a server from monitoring

There is no way to remove a server from monitoring directly. This is done for cases when someone knows your secret, he will not be able to remove all servers from monitoring.

A server can be removed from monitoring by sending a json response to the API, when it will make a request to specified webhook url, in the following format:

```
{
    "remove": [
        "127.0.0.1:25565",
        "192.168.1.100",
        ""
    ]
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/38a70f8442abb39ae85497a26dd42dd1695ea737a8c9e75bae4be610a8539389?d=identicon)[moldcraft](/maintainers/moldcraft)

### Embed Badge

![Health badge](/badges/mmd-mc-monitor/health.svg)

```
[![Health](https://phpackages.com/badges/mmd-mc-monitor/health.svg)](https://phpackages.com/packages/mmd-mc-monitor)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
