# sgmon

> A small monitor based on libstatgrab.

Latest version **1.0.1** (published 2016-11-20) · GPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install sgmon
pnpm add sgmon
yarn add sgmon
bun add sgmon
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-11-20 |
| First published | 2016-11-20 |
| Weekly downloads | 0 |
| License | GPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | Stitch Cula |
| Maintainers | stitchcula |
| Keywords | monitor, performs, statgrab |

## Links

- npm: https://www.npmjs.com/package/sgmon
- Repository: https://github.com/stitchcula/sgmon
- Homepage: https://github.com/stitchcula/sgmon#readme
- Issues: https://github.com/stitchcula/sgmon/issues
- npm.io page: https://npm.io/package/sgmon

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-11-20
- 1.0.0 — 2016-11-20

## README

# sgmon
A small and easy-to-use module(cross out, it's mon) to grab system statistics through libstatgrab. Statistics include CPU, processes, load, memory, swap, network I/O, disk I/O (and file system information). It could be used for monitoring the system for alerting or graphing purposes.

Now support linux only.

## Installation
```
npm install sgmon
```
Uuuuum, it needs `node-gyp` to build. Failing to install automaticly, maybe you should:
```
npm install node-gyp -g
```
## Usage
```js
var sgmon = require('sgmon')

console.log(sgmon.grab())
// grab system statistics, and return a object

sgmon.nap(function (err, stats) {
  if(err)
    console.log(err)
  console.log(stats)
}, 3000) 
// sgmon.nap(callback[,delay])
// grab and invoke callback every delay(ms, defaults 3000)
```
The return likes:
```js
{ host_info: { hostname: 'booooom', uptime: 6858472 },
  load_stats: { min1: 0.07, min5: 0.03, min15: 0.05 },
  cpu: 
    { idle: 99.03449934457036,
      system: 0.942248478804679,
      user: 0.5937322369309994 },
  mem: { total: 1039847424, used: 613339136, free: 426508288 },
  swap: { total: 0, used: 0, free: 0 },
  disk: 
    [ { name: 'xvda', read: 182, write: 44 },
      { name: 'xvda1', read: 182, write: 44 }...so on.
```
## Else...
I can't make libstatgrab staticly, and just link the dynamic library at `./addon/lib/libstatgrab.so`.
So, it brings some problems...
Compatibility? Security?


If this dynamic library don't work, you can try to install `libstatgrab-dev` by package manager and copy `libstatgrab.so` to `./addon/lib/`.


The libstatgrab: [http://www.i-scream.org/libstatgrab/](http://www.i-scream.org/libstatgrab/)

## License
GPL-2.0

---
_Source: https://npm.io/package/sgmon · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
