HV::Monitor

Provides a LibreNMS style JSON SNMP extend for monitoring HV info. Currently supported ones are as below.

Installation

FreeBSD...

pkg install p5-App-cpanminus p5-JSON p5-MIME-Base64 p5-Gzip-Faster
cpanm HV::Monitor

Debian...

apt-get install zlib1g-dev cpanminus libjson-perl
cpanm HV::Monitor

Usage

The cron+snmpd setup is needed as even if you use sudo to make sure snmpd can run it, this usual time it takes this to run will result in in a time out.

For cron...

*/5 * * * * /usr/local/bin/hv_monitor > /var/cache/hv_monitor.json -c 2> /dev/null

For snmpd...

extend hv-monitor /bin/cat /var/cache/hv_monitor.json

FLAGS

-b backend

The backend to use.

Defaults are as below.

| OS | Module | |---------|---------| | FreeBSD | CBSD | | Linux: | Libvirt |

-c

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

JSON Return

These are all relevant to .data in the JSON.

VM Info Hash

Interface Hash

The interface hash keys are as below.

Status integer mapping is as below. Not all HVs will support all of these.

| State | Int | Desc | |-------------|-----|-------------------------------------| | NOSTATE | 0 | no state | | RUNNING | 1 | is running / generic on | | BLOCKED | 2 | is blocked on resource | | PAUSED | 3 | is paused by user | | SHUTDOWN | 4 | is being shut down | | SHUTOFF | 5 | is shut off | | CRASHED | 6 | is crashed | | PMSUSPENDED | 7 | suspended by guest power management | | OFF | 8 | Generic off | | MAINTENANCE | 9 | Maintenance | | UNKNOWN | 10 | Unknown |

Disk Hash

Disk hash keys is as below.