Commit version 24.12.13800

This commit is contained in:
2025-01-06 17:35:06 -05:00
parent b7f6a79c2c
commit 55d9218816
6133 changed files with 4239740 additions and 1374287 deletions

View File

@ -4,52 +4,35 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage poller
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
* @package observium
* @subpackage poller
* @copyright (C) Adam Armstrong
*
*/
/// FIXME. Rewrite (clean), clean stale entries (after disable)
// Pre-polling checks
if (!$config['enable_ospf']) {
// OSPF not enabled
return;
// OSPF not enabled
return;
}
$ospf_stats = [
'instances' => 0,
'ports' => 0,
'areas' => 0,
'neighbours' => 0
];
// This module not have discovery (only mibs discovery)
$mib_exist = FALSE;
foreach ([ 'OSPF-MIB', 'OSPFV3-MIB' ] as $mib) {
if (is_device_mib($device, $mib)) {
$ospf_enabled = FALSE; // TRUE, when ospf enabled
foreach (['OSPF-MIB', 'OSPFV3-MIB'] as $mib) {
if (is_device_mib($device, $mib)) {
$ospf_enabled = FALSE; // TRUE, when ospf enabled
include $config['install_dir'] . '/includes/polling/ospf/'.strtolower($mib).'.inc.php';
}
include $config['install_dir'] . '/includes/polling/ospf/' . strtolower($mib) . '.inc.php';
}
}
if (!$mib_exist) {
// OSPF MIBs excluded
unset($mib_exist, $ospf_enabled, $ospf_stats);
return;
if (!$ospf_enabled) {
// OSPF MIBs excluded
unset($mib_exist, $ospf_enabled, $ospf_stats);
return;
}
// Create device-wide statistics RRD
rrdtool_update_ng($device, 'ospf-statistics', [
'instances' => $ospf_stats['instances'],
'areas' => $ospf_stats['areas'],
'ports' => $ospf_stats['ports'],
'neighbours' => $ospf_stats['neighbours'],
]);
$graphs['ospf_neighbours'] = TRUE;
$graphs['ospf_areas'] = TRUE;
$graphs['ospf_ports'] = TRUE;
// EOF