Files
librenms-librenms/includes/discovery/storage/primekey-sw-sql.inc.php
AdamB b27dfa5891 Add support for PrimeKey Software Appliance (#15059)
* Add PK-SOFTWARE-APPLIANCE-V2 MIB

* Add support for PrimeKey Software Appliance

* Move file to correct path

* Make the OS detection more specific

* Thanks vscode

* Sync filename with osname

* Not supported

* Track SQL database size as volume

* Two fixes
2023-07-07 23:35:53 -05:00

19 lines
693 B
PHP

<?php
// This isn't a volume, so we have to fake it a bit
if ($device['os'] === 'primekey-sw') {
$oids = snmp_get_multi_oid($device, ['pk-SAV2-internal-databaseAvailableStorage.0', 'pk-SAV2-internal-databaseTotalStorage.0'], '-OUQn', 'PK-SOFTWARE-APPLIANCE-V2');
$fstype = 'sql';
$descr = 'Internal Database';
$units = 1024;
$index = 0;
$free = $oids['.1.3.6.1.4.1.22408.1.4.1.3.1.2.0'];
$total = $oids['.1.3.6.1.4.1.22408.1.4.1.3.1.3.0'];
$used = $total - $free;
if (is_numeric($free) && is_numeric($total)) {
discover_storage($valid_storage, $device, $index, $fstype, 'primekey-sw-sql', $descr, $total, $units, $used);
}
unset($oids);
}