NAME

oslv_monitor - LibreNMS style JSON SNMP extend for OS level virtualization monitoring

VERSION

Same as OSLV::Monitor.

SYNOPSIS

oslv_monitor [-c] [-l] [-f <config file>] [-b <base dir>] [-q] [-t <time divider>] [--backend <backend>]

oslv_monitor -h|--help

oslv_monitor -v|--version

DESCRIPTION

For cron...

*/5 * * * * /usr/local/bin/oslv_monitor -q

For snmpd...

extend oslv_monitor /bin/cat /var/cache/oslv_monitor/snmp

Debugging info can be printed via OSLV_MONITOR_DEBUG=1.

FLAGS

-b <base dir>

The dir to write the cache and output files to.

Default :: /var/cache/oslv_monitor

--backend <backend>

The backend to use. Overrides the one set in the config file.

Default :: FreeBSD on FreeBSD, cgroups on Linux

-c

Print the output gzip compressed and base64 encoded so it can be transmitted via SNMP with out issue.

$base_dir/snmp is always written compressed regardless of this.

-f <file>

The config file to use.

Default :: /usr/local/etc/oslv_monitor.json

-h, --help

Print the help and exit.

-l

Lock $base_dir/lock while running so overlapping runs, such as one taking longer than the cron interval, do not clobber each other's cache. If another run holds the lock, it exits 1 right away without writing the output files, so the output of the previous run is kept. As the rates are computed over the time since the previous run, a skipped run does not throw them off.

-q

Do not print the results.

-t <time divider>

What to use for the time divider. Overrides the one set in the config file.

-v, --version

Print the version and exit.

CONFIG FILE

The following keys are used in the JSON config file.

- include :: A array of regular expressions to include.
    Default :: ["^.+$"]

- exclude :: A array of regular expressions to exlclude.
    Default :: undef

- backend :: Override the the backend and automatically choose it.

- time_divider :: Override the time_divider value. The default value varies
    per backend and if it is needed.

Time divider notes.

- cgroups :: While the default for usec to sec conversion should be 1000000,
          some settings report the value in nanoseconds, requiring 1000000000.
    Default :: 1000000

- FreeBSD :: not used

By Defaults the backends are as below.

FreeBSD: FreeBSD
Linux: cgroups

Default would be like this.

{
    "include": ["^.+$"]
}