Fix for Gaia Storage duplicated (#12824)

* Fix for Gaia Storage duplicated

We are getting duplicate storage.
Since Checkpoint Gaia is a Linux-based operating system, the file “./includes/discovery/storage/ucd-dsktable.inc.php” has already discovered the storage, so I think the file “./includes/discovery/storage/gaia.inc.php” is not necessary.

* Delete gaia.inc.php

* Add files via upload

* Add files via upload

* Fix for Gaia Storage duplicated
This commit is contained in:
Rafael Pardim
2021-05-06 03:46:11 -03:00
committed by GitHub
parent 1f10fecb33
commit 37ac9dffbe
4 changed files with 0 additions and 224 deletions

View File

@@ -1,39 +0,0 @@
<?php
/**
* gaia.inc.php
*
* LibreNMS storage discovery module for Check Point GAIA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* @link https://www.librenms.org
* @copyright 2017 Neil Lathwood
* @author Neil Lathwood <gh+n@laf.io>
*/
if ($device['os'] === 'gaia') {
$gaia_tmp = snmpwalk_cache_double_oid($device, 'multiDiskTable', [], 'CHECKPOINT-MIB');
$fstype = 'dsk';
foreach ($gaia_tmp as $index => $data) {
$descr = $data['multiDiskName'];
$units = 1024;
if (is_numeric($data['multiDiskSize']) && is_numeric($data['multiDiskUsed'])) {
$total = $data['multiDiskSize'];
$used = $data['multiDiskUsed'];
discover_storage($valid_storage, $device, $index, $fstype, 'gaia', $descr, $total, $units, $used);
}
}
unset($gaia_tmp);
}

View File

@@ -1,29 +0,0 @@
<?php
/**
* gaia.inc.php
*
* LibreNMS storage poller module for Check Point GAIA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* @link https://www.librenms.org
* @copyright 2017 Neil Lathwood
* @author Neil Lathwood <gh+n@laf.io>
*/
$gaia_data = snmp_get_multi_oid($device, "multiDiskSize.{$storage['storage_index']} multiDiskUsed.{$storage['storage_index']}", '-OUQst', 'CHECKPOINT-MIB');
$storage['size'] = $gaia_data["multiDiskSize.{$storage['storage_index']}"];
$storage['used'] = $gaia_data["multiDiskUsed.{$storage['storage_index']}"];
$storage['free'] = $storage['size'] - $storage['used'];
$storage['units'] = $storage['storage_units'];
unset($gaia_data);

View File

@@ -2404,45 +2404,6 @@
"storage": {
"discovery": {
"storage": [
{
"storage_mib": "gaia",
"storage_index": "1.0",
"storage_type": "dsk",
"storage_descr": "/",
"storage_size": 33283751936,
"storage_units": 1024,
"storage_used": 6296526848,
"storage_free": 0,
"storage_perc": 0,
"storage_perc_warn": 60,
"storage_deleted": 0
},
{
"storage_mib": "gaia",
"storage_index": "2.0",
"storage_type": "dsk",
"storage_descr": "/boot",
"storage_size": 302654464,
"storage_units": 1024,
"storage_used": 52742144,
"storage_free": 0,
"storage_perc": 0,
"storage_perc_warn": 60,
"storage_deleted": 0
},
{
"storage_mib": "gaia",
"storage_index": "3.0",
"storage_type": "dsk",
"storage_descr": "/var/log",
"storage_size": 62407045120,
"storage_units": 1024,
"storage_used": 5263020032,
"storage_free": 0,
"storage_perc": 0,
"storage_perc_warn": 60,
"storage_deleted": 0
},
{
"storage_mib": "hrstorage",
"storage_index": "31",
@@ -2642,45 +2603,6 @@
},
"poller": {
"storage": [
{
"storage_mib": "gaia",
"storage_index": "1.0",
"storage_type": "dsk",
"storage_descr": "/",
"storage_size": 33283751936,
"storage_units": 1024,
"storage_used": 6296526848,
"storage_free": 26987225088,
"storage_perc": 19,
"storage_perc_warn": 60,
"storage_deleted": 0
},
{
"storage_mib": "gaia",
"storage_index": "2.0",
"storage_type": "dsk",
"storage_descr": "/boot",
"storage_size": 302654464,
"storage_units": 1024,
"storage_used": 52742144,
"storage_free": 249912320,
"storage_perc": 17,
"storage_perc_warn": 60,
"storage_deleted": 0
},
{
"storage_mib": "gaia",
"storage_index": "3.0",
"storage_type": "dsk",
"storage_descr": "/var/log",
"storage_size": 62407045120,
"storage_units": 1024,
"storage_used": 5263020032,
"storage_free": 57144025088,
"storage_perc": 8,
"storage_perc_warn": 60,
"storage_deleted": 0
},
{
"storage_mib": "hrstorage",
"storage_index": "31",

View File

@@ -4876,45 +4876,6 @@
"storage": {
"discovery": {
"storage": [
{
"storage_mib": "gaia",
"storage_index": "1.0",
"storage_type": "dsk",
"storage_descr": "/",
"storage_size": 33820622848,
"storage_units": 1024,
"storage_used": 7641092096,
"storage_free": 0,
"storage_perc": 0,
"storage_perc_warn": 60,
"storage_deleted": 0
},
{
"storage_mib": "gaia",
"storage_index": "2.0",
"storage_type": "dsk",
"storage_descr": "/boot",
"storage_size": 302539776,
"storage_units": 1024,
"storage_used": 67352576,
"storage_free": 0,
"storage_perc": 0,
"storage_perc_warn": 60,
"storage_deleted": 0
},
{
"storage_mib": "gaia",
"storage_index": "3.0",
"storage_type": "dsk",
"storage_descr": "/var/log",
"storage_size": 156017602560,
"storage_units": 1024,
"storage_used": 8670523392,
"storage_free": 0,
"storage_perc": 0,
"storage_perc_warn": 60,
"storage_deleted": 0
},
{
"storage_mib": "hrstorage",
"storage_index": "31",
@@ -4958,45 +4919,6 @@
},
"poller": {
"storage": [
{
"storage_mib": "gaia",
"storage_index": "1.0",
"storage_type": "dsk",
"storage_descr": "/",
"storage_size": 33820622848,
"storage_units": 1024,
"storage_used": 7641092096,
"storage_free": 26179530752,
"storage_perc": 23,
"storage_perc_warn": 60,
"storage_deleted": 0
},
{
"storage_mib": "gaia",
"storage_index": "2.0",
"storage_type": "dsk",
"storage_descr": "/boot",
"storage_size": 302539776,
"storage_units": 1024,
"storage_used": 67352576,
"storage_free": 235187200,
"storage_perc": 22,
"storage_perc_warn": 60,
"storage_deleted": 0
},
{
"storage_mib": "gaia",
"storage_index": "3.0",
"storage_type": "dsk",
"storage_descr": "/var/log",
"storage_size": 156017602560,
"storage_units": 1024,
"storage_used": 8670523392,
"storage_free": 147347079168,
"storage_perc": 6,
"storage_perc_warn": 60,
"storage_deleted": 0
},
{
"storage_mib": "hrstorage",
"storage_index": "31",