PHPackages                             luna/vnstat - 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. luna/vnstat

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

luna/vnstat
===========

PHP wrapper for the command line app 'vnstat'

1.1.1(9y ago)4211MITPHPPHP &gt;=5.6

Since Dec 10Pushed 9y ago1 watchersCompare

[ Source](https://github.com/DuckThom/php-vnstat)[ Packagist](https://packagist.org/packages/luna/vnstat)[ RSS](/packages/luna-vnstat/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (7)Used By (0)

php-vnstat
==========

[](#php-vnstat)

vnstat json output parser for PHP

[![StyleCI](https://camo.githubusercontent.com/459be89e711af8e7ea58ab96281328119837944af34d852c98113f8ade397977/68747470733a2f2f7374796c6563692e696f2f7265706f732f37353938323135362f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/75982156)[![License](https://camo.githubusercontent.com/652bdd4ecca5c82cd385ee2f8c3c93c860e05b2fb004192151e8928364e14aa9/68747470733a2f2f706f7365722e707567782e6f72672f6c756e612f766e737461742f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/luna/vnstat)[![Total Downloads](https://camo.githubusercontent.com/20d39a40d16ba0997c288ba681d5ad3a31c8fc4b74368c98de60bff8e9086812/68747470733a2f2f706f7365722e707567782e6f72672f6c756e612f766e737461742f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/luna/vnstat)

Usage
-----

[](#usage)

```
use Luna\Vnstat\Vnstat;

class YourClass extends Awesomeness implements Ideas
{
  protected $interface = 'eth0';

  public function runWithStaticMethod()
  {
    $jsonObject = Vnstat::get($this->interface);
  }

  public function runWithNewInstance()
  {
    $vnstat = new Vnstat($this->interface);
    $vnstat->run();

    $rawJson = $vnstat->getJson();
    $response = $vnstat->getResponse();
  }
}
```

Methods
-------

[](#methods)

```
public function Vnstat::__construct(string $interface): void
```

```
public function Vnstat::get(string $interface): \Luna\Vnstat\VnstatResponse
```

```
public function Vnstat::getResponse(): \Luna\Vnstat\VnstatResponse
```

```
public function Vnstat::setExecutablePath(string $executable): $this
```

```
public function Vnstat::getExecutablePath(): string
```

```
public function Vnstat::setJson(string $json): $this
```

```
public function Vnstat::getJson(): string
```

Errors/Exceptions
-----------------

[](#errorsexceptions)

Throws `Luna\Vnstat\Exceptions\InvalidJsonException` if the string returned by `Vnstat::getJson()` was an invalid json string.

Throws `Luna\Vnstat\Exceptions\ExecutableNotFoundException` if `which vnstat` failed.

Throws `\Symfony\Component\Process\Exception\ProcessFailedException` if `vnstat --query --json -i $interface` failed.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

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 ~2 days

Total

6

Last Release

3476d ago

Major Versions

0.1 → 1.0.02016-12-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ddadef23323577f14410aec0aaa922c47b6bb4ba8a7c14fa0a57443e364a705?d=identicon)[DuckThom](/maintainers/DuckThom)

---

Top Contributors

[![DuckThom](https://avatars.githubusercontent.com/u/6512901?v=4)](https://github.com/DuckThom "DuckThom (23 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/luna-vnstat/health.svg)

```
[![Health](https://phpackages.com/badges/luna-vnstat/health.svg)](https://phpackages.com/packages/luna-vnstat)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.1k91.3M282](/packages/laravel-horizon)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751284.3k37](/packages/civicrm-civicrm-core)[illuminate/process

The Illuminate Process package.

44813.9k97](/packages/illuminate-process)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9417.2k55](/packages/open-dxp-opendxp)[japanese-date/japanese-date

日本の暦、祝日を取り扱うライブラリ

169.9k](/packages/japanese-date-japanese-date)

PHPackages © 2026

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