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

@ -1,54 +1,39 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage poller
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
echo("Juniper Firewall Counters");
$fws = array();
$fws = [];
$fws = snmpwalk_cache_threepart_oid($device, "jnxFWCounterDisplayType", $fws, "JUNIPER-FIREWALL-MIB");
if (count($fws))
{
$oid = 'jnxFWCounterDisplayType';
if (count($fws)) {
$oid = 'jnxFWCounterDisplayType';
}
/*
else
{
$fws = snmpwalk_cache_twopart_oid($device, "jnxFWType", $fws, "JUNIPER-FIREWALL-MIB");
if (count($fws))
{
$oid = 'jnxFWType';
}
}
*/
$array = array();
$array = [];
foreach ($fws as $filter => $counters)
{
foreach ($counters AS $counter => $types)
{
foreach($types as $type => $data)
{
$array[$filter][$counter][$type] = 1;
foreach ($fws as $filter => $counters) {
foreach ($counters as $counter => $types) {
foreach ($types as $type => $data) {
$array[$filter][$counter][$type] = 1;
}
}
}
}
echo("\n");
if (count($array))
{
set_entity_attrib('device', $device['device_id'], 'juniper-firewall-mib', json_encode($array));
if (!safe_empty($array)) {
// FIXME. Adama, this array is very big for attrib table
set_entity_attrib('device', $device['device_id'], 'juniper-firewall-mib', str_compress(safe_json_encode($array)));
}
unset($fws, $filter, $counters, $counter, $data);