PHPackages                             kwkm/mklivestatus-client - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kwkm/mklivestatus-client

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kwkm/mklivestatus-client
========================

mkLiveStatus Client

v1.0.1(10y ago)021MITPHP

Since Jan 19Pushed 10y ago1 watchersCompare

[ Source](https://github.com/kwkm/MkLiveStatusClient)[ Packagist](https://packagist.org/packages/kwkm/mklivestatus-client)[ Docs](https://github.com/kwkm/MkLiveStatusClient)[ RSS](/packages/kwkm-mklivestatus-client/feed)WikiDiscussions master Synced 4w ago

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

mkLivestatus Client
===================

[](#mklivestatus-client)

[![License](https://camo.githubusercontent.com/dd2bae1f6a3a80203d7ec2384eb2f50a427843946168371aa8ba50f76a4dfe62/68747470733a2f2f706f7365722e707567782e6f72672f7061737365742f7061737365742f6c6963656e73652e737667)](https://packagist.org/packages/passet/passet)[![Build Status](https://camo.githubusercontent.com/211cca63293dee344affebba8582ee9fc7d8cada68b7092e28b9bd8f9f410160/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b776b6d2f4d6b4c697665537461747573436c69656e742f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kwkm/MkLiveStatusClient/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/5ce6ac7340d9f341f4dd6f87484b39d41d2c0eff809762e3d9062bbf5081f8d2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b776b6d2f4d6b4c697665537461747573436c69656e742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kwkm/MkLiveStatusClient/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/82bb202fbd0f082af8e88260b8a5fee7bbc3d07bbe155afea6695b654bff7aad/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b776b6d2f4d6b4c697665537461747573436c69656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kwkm/MkLiveStatusClient/?branch=master)

Client Setting.
---------------

[](#client-setting)

### In the case of localhost.

[](#in-the-case-of-localhost)

```
use Kwkm\MkLiveStatusClient as mk;

require __DIR__ . '/vendor/autoload.php';

$config = new mk\Configuration(
    array(
        'socketType' => 'unix',
        'socketPath' => '/var/run/nagios/rw/live',
    )
);

$client = new mk\Client($config);

$parser = new mk\Parser();
```

### In the case of remote network.

[](#in-the-case-of-remote-network)

```
use Kwkm\MkLiveStatusClient as mk;

require __DIR__ . '/vendor/autoload.php';

$config = new mk\Configuration(
    array(
        'socketType' => 'tcp',
        'socketAddress' => '192.168.0.100',
        'socketPort' => 6557,
    )
);

$client = new mk\Client($config);

$parser = new mk\Parser();
```

Example - LqlBuilder
--------------------

[](#example---lqlbuilder)

### Retrieve all contacts.

[](#retrieve-all-contacts)

```
$lql = new mk\LqlBuilder(mk\Table::CONTACTS);

$result = $parser->get($client->execute($lql));
```

### Retrieves just the columns name and alias.

[](#retrieves-just-the-columns-name-and-alias)

```
$lql = new mk\LqlBuilder(mk\Table::CONTACTS);
$lql->columns(array('name', 'alias'));

$result = $parser->get($client->execute($lql));
```

### Gets all services with the current state 2 (critical).

[](#gets-all-services-with-the-current-state-2-critical)

```
$lql = new mk\LqlBuilder(mk\Table::SERVICES);
$lql->columns(array('host_name', 'description', 'state'))
    ->filterEqual('state', '2');

$result = $parser->get($client->execute($lql));
```

### Gets all critical services which are currently within their notification period.

[](#gets-all-critical-services-which-are-currently-within-their-notification-period)

```
$lql = new mk\LqlBuilder(mk\Table::SERVICES);
$lql->columns(array('host_name', 'description', 'state'))
    ->filterEqual('state', '2')
    ->filterEqual('in_notification_period', '1');

$result = $parser->get($client->execute($lql));
```

### Matching lists.

[](#matching-lists)

```
$lql = new mk\LqlBuilder(mk\Table::SERVICES);
$lql->columns(array('host_name', 'description', 'state', 'contacts'))
    ->filterGreaterEqual('contacts', 'harri');

$result = $parser->get($client->execute($lql));
```

### Gets all hosts that do not have parents.

[](#gets-all-hosts-that-do-not-have-parents)

```
$lql = new mk\LqlBuilder(mk\Table::HOSTS);
$lql->column('name')
    ->filterEqual('parents', '');

$result = $parser->get($client->execute($lql));
```

### Matching attribute lists

[](#matching-attribute-lists)

#### Find all hosts with modified attributes.

[](#find-all-hosts-with-modified-attributes)

```
$lql = new mk\LqlBuilder(mk\Table::HOSTS);
$lql->columns(array('host_name', 'modified_attributes_list'))
    ->filterNotEqual('modified_attributes', '0');

$result = $parser->get($client->execute($lql));
```

#### Find hosts where notification have been actively disabled.

[](#find-hosts-where-notification-have-been-actively-disabled)

```
$lql = new mk\LqlBuilder(mk\Table::HOSTS);
$lql->columns(array('host_name', 'modified_attributes_list'))
    ->filterMatch('modified_attributes', 'notifications_enabled')
    ->filterEqual('notifications_enabled', '0');

$result = $parser->get($client->execute($lql));
```

#### Find hosts where active or passive checks have been tweaked.

[](#find-hosts-where-active-or-passive-checks-have-been-tweaked)

```
$lql = new mk\LqlBuilder(mk\Table::HOSTS);
$lql->columns(array('host_name', 'modified_attributes_list'))
    ->filterSet('modified_attributes ~~ active_checks_enabled,passive_checks_enabled');

$result = $parser->get($client->execute($lql));
```

### Combining Filters with And, Or and Negate.

[](#combining-filters-with-and-or-and-negate)

#### Selects all services which are in state 1 or in state 3.

[](#selects-all-services-which-are-in-state-1-or-in-state-3)

```
$lql = new mk\LqlBuilder(mk\Table::SERVICES);
$lql->filterEqual('state', '1')
    ->filterEqual('state', '3')
    ->filterOr(2);

$result = $parser->get($client->execute($lql));
```

#### Shows all non-OK services which are within a scheduled downtime or which are on a host with a scheduled downtime.

[](#shows-all-non-ok-services-which-are-within-a-scheduled-downtime-or-which-are-on-a-host-with-a-scheduled-downtime)

```
$lql = new mk\LqlBuilder(mk\Table::SERVICES);
$lql->filterGreater('scheduled_downtime_depth', '0')
    ->filterGreater('host_scheduled_downtime_depth', '0')
    ->filterOr(2);

$result = $parser->get($client->execute($lql));
```

#### All services that are either critical and acknowledged or OK.

[](#all-services-that-are-either-critical-and-acknowledged-or-ok)

```
$lql = new mk\LqlBuilder(mk\Table::SERVICES);
$lql->filterEqual('state', '2')
    ->filterEqual('acknowledged', '1')
    ->filterAnd(2)
    ->filterEqual('state', '0')
    ->filterOr(2);

$result = $parser->get($client->execute($lql));
```

#### Displays all hosts that have neither an a nor an o in their name.

[](#displays-all-hosts-that-have-neither-an-a-nor-an-o-in-their-name)

```
$lql = new mk\LqlBuilder(mk\Table::HOSTS);
$lql->filterMatch('name', 'a')
    ->filterMatch('name', 'o')
    ->filterOr(2)
    ->filterNegate();

$result = $parser->get($client->execute($lql));
```

### Stats and Counts.

[](#stats-and-counts)

#### The numbers of services which are OK, WARN, CRIT or UNKNOWN.

[](#the-numbers-of-services-which-are-ok-warn-crit-or-unknown)

```
$lql = new mk\LqlBuilder(mk\Table::SERVICES);
$lql->statsEqual('state', '0')
    ->statsEqual('state', '1')
    ->statsEqual('state', '2')
    ->statsEqual('state', '3');

$result = $parser->decode($client->execute($lql));
```

#### The output to services to which the contact harri.

[](#the-output-to-services-to-which-the-contact-harri)

```
$lql = new mk\LqlBuilder(mk\Table::SERVICES);
$lql->statsEqual('state', '0')
    ->statsEqual('state', '1')
    ->statsEqual('state', '2')
    ->statsEqual('state', '3')
    ->filterGreaterEqual('contacts', 'harri');

$result = $parser->decode($client->execute($lql));
```

#### Combining with and/or.

[](#combining-with-andor)

```
$lql = new mk\LqlBuilder(mk\Table::SERVICES);
$lql->filterGreaterEqual('host_groups', 'windows')
    ->filterEqual('scheduled_downtime_depth', '0')
    ->filterEqual('host_scheduled_downtime_depth', '0')
    ->filterEqual('in_notification_period', '1')
    ->statsEqual('last_hard_state', '0')
    ->statsEqual('last_hard_state', '1')
    ->statsEqual('acknowledged', '0')
    ->statsAnd(2)
    ->statsEqual('last_hard_state', '1')
    ->statsEqual('acknowledged', '1')
    ->statsAnd(2)
    ->statsEqual('last_hard_state', '2')
    ->statsEqual('acknowledged', '0')
    ->statsAnd(2)
    ->statsEqual('last_hard_state', '2')
    ->statsEqual('acknowledged', '1')
    ->statsAnd(2)
    ->statsEqual('last_hard_state', '3')
    ->statsEqual('acknowledged', '0')
    ->statsAnd(2)
    ->statsEqual('last_hard_state', '3')
    ->statsEqual('acknowledged', '1')
    ->statsAnd(2);

$result = $parser->decode($client->execute($lql));
```

#### The number of services in the various states for each host in the host group windows.

[](#the-number-of-services-in-the-various-states-for-each-host-in-the-host-group-windows)

```
$lql = new mk\LqlBuilder(mk\Table::SERVICES);
$lql->filterGreaterEqual('host_groups', 'windows')
    ->statsEqual('state', '0')
    ->statsEqual('state', '1')
    ->statsEqual('state', '2')
    ->statsEqual('state', '3')
    ->column('host_name');

$result = $parser->decode($client->execute($lql));
```

#### Counts the total number of services grouped by the check command.

[](#counts-the-total-number-of-services-grouped-by-the-check-command)

```
$lql = new mk\LqlBuilder(mk\Table::SERVICES);
$lql->statsNotEqual('state', '9999')
    ->column('check_command');

$result = $parser->decode($client->execute($lql));
```

#### Counting the total number of services grouped by their states.

[](#counting-the-total-number-of-services-grouped-by-their-states)

```
$lql = new mk\LqlBuilder(mk\Table::SERVICES);
$lql->statsNotEqual('state', '9999')
    ->column('state');

$result = $parser->decode($client->execute($lql));
```

### Sum, Minimum, Maximum, Average, Standard Deviation.

[](#sum-minimum-maximum-average-standard-deviation)

#### Minimum, maximum and average check execution time of all service checks in state OK.

[](#minimum-maximum-and-average-check-execution-time-of-all-service-checks-in-state-ok)

```
$lql = new mk\LqlBuilder(mk\Table::SERVICES);
$lql->filterEqual('state', '0')
    ->statsMin('execution_time')
    ->statsMax('execution_time')
    ->statsAvg('execution_time');

$result = $parser->decode($client->execute($lql));
```

#### Grouping host\_name.

[](#grouping-host_name)

```
$lql = new mk\LqlBuilder(mk\Table::SERVICES);
$lql->filterEqual('state', '0')
    ->statsMin('execution_time')
    ->statsMax('execution_time')
    ->statsAvg('execution_time')
    ->column('host_name');

$result = $parser->decode($client->execute($lql));
```

Example - Lql
-------------

[](#example---lql)

```
$column = new mk\Column(
    array(
        'host_name',
        'description',
        'state',
    )
);

$filter = new mk\Filter();
$filter->equal('state', '2')
       ->equal('acknowledged', '1')
       ->operatorAnd(2)
       ->equal('state', '0')
       ->operatorOr(2);

$lql = new mk\Lql(mk\Table::SERVICES);
$lql->column($column)->filter($filter);

$result = $parser->get($client->execute($lql));
```

```
$column = new mk\Column(
    array(
        'host_name',
    )
);

$stats = new mk\Stats();
$stats->equal('state', '0')
      ->equal('state', '1')
      ->equal('state', '2')
      ->equal('state', '3');

$lql = new mk\Lql(mk\Table::SERVICES);
$lql->stats($stats)->column($column);

$result = $parser->decode($client->execute($lql));
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

3814d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ac837c1580c8bd46b4b0d46443b68cdde6f3484f8d985b049186657cf44a9c7?d=identicon)[kwkm](/maintainers/kwkm)

---

Top Contributors

[![kwkm](https://avatars.githubusercontent.com/u/93046?v=4)](https://github.com/kwkm "kwkm (43 commits)")

---

Tags

nagiosmklivestatus

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kwkm-mklivestatus-client/health.svg)

```
[![Health](https://phpackages.com/badges/kwkm-mklivestatus-client/health.svg)](https://phpackages.com/packages/kwkm-mklivestatus-client)
```

###  Alternatives

[cytopia/check_drupal

This nagios plugin will check if your drupal site has issues (security updates, updates\[optional\], outstanding db updates, other problems).

294.1k](/packages/cytopia-check-drupal)[cytopia/check_git

Nagios plugin to verify a git repository.

105.2k](/packages/cytopia-check-git)[cytopia/check_php

Nagios or Icinga plugin to check for php startup errors.

101.5k](/packages/cytopia-check-php)

PHPackages © 2026

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