Apply fixes from StyleCI (#15698)

Co-authored-by: StyleCI Bot <bot@styleci.io>
This commit is contained in:
Jellyfrog 2024-01-05 05:39:12 +01:00 committed by GitHub
parent 58becd9ea2
commit 071ca9bc2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
615 changed files with 4562 additions and 4554 deletions

View File

@ -121,7 +121,7 @@ class AlertRules
$details = gzcompress(json_encode($details), 9);
dbUpdate(['details' => $details], 'alert_log', 'id = ?', [$alert_log['id']]);
} else {
$extra = gzcompress(json_encode(['contacts' => AlertUtil::getContacts($qry), 'rule'=>$qry]), 9);
$extra = gzcompress(json_encode(['contacts' => AlertUtil::getContacts($qry), 'rule' => $qry]), 9);
if (dbInsert(['state' => AlertState::ACTIVE, 'device_id' => $device_id, 'rule_id' => $rule['id'], 'details' => $extra], 'alert_log')) {
if (is_null($current_state)) {
dbInsert(['state' => AlertState::ACTIVE, 'device_id' => $device_id, 'rule_id' => $rule['id'], 'open' => 1, 'alerted' => 0], 'alerts');

View File

@ -72,7 +72,7 @@ class Gitlab extends Transport
'title' => 'Project ID',
'name' => 'gitlab-id',
'descr' => 'GitLab Project ID',
'type'=> 'text',
'type' => 'text',
],
[
'title' => 'Personal Access Token',

View File

@ -62,21 +62,21 @@ class Hue extends Transport
public static function configTemplate(): array
{
return [
'config'=>[
'config' => [
[
'title'=> 'Host',
'title' => 'Host',
'name' => 'hue-host',
'descr' => 'Hue Host',
'type' => 'text',
],
[
'title'=> 'Hue User',
'title' => 'Hue User',
'name' => 'hue-user',
'descr' => 'Phillips Hue Host',
'type' => 'text',
],
[
'title'=> 'Duration',
'title' => 'Duration',
'name' => 'hue-duration',
'descr' => 'Phillips Hue Duration',
'type' => 'select',

View File

@ -138,6 +138,7 @@ class SSOAuthorizer extends MysqlAuthorizer
}
}
}
// No match, proxy is untrusted
return false;
} catch (InvalidIpException $e) {
@ -145,6 +146,7 @@ class SSOAuthorizer extends MysqlAuthorizer
return false;
}
}
// Not enabled, trust everything
return true;
}

View File

@ -554,7 +554,7 @@ class IRCBot
}
if ($this->ssl && $this->config['irc_disable_ssl_check']) {
$ssl_context_params = ['ssl'=>['allow_self_signed'=> true, 'verify_peer' => false, 'verify_peer_name' => false]];
$ssl_context_params = ['ssl' => ['allow_self_signed' => true, 'verify_peer' => false, 'verify_peer_name' => false]];
$ssl_context = stream_context_create($ssl_context_params);
$this->socket['irc'] = stream_socket_client($server . ':' . $this->port, $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $ssl_context);
} else {

View File

@ -173,6 +173,7 @@ class Isis implements Module
if (count($data) !== $adjacencies->where('isisISAdjState', 'up')->count()) {
echo 'New Adjacencies, running discovery';
// don't enable, might be a bad heuristic
return $this->fillNew($adjacencies, $this->discoverIsIsMib($os));
}

View File

@ -97,7 +97,7 @@ class Comware extends OS implements MempoolsDiscovery, ProcessorDiscovery
$mempools->push((new Mempool([
'mempool_index' => $index,
'mempool_type' => 'comware',
'mempool_class' =>'system',
'mempool_class' => 'system',
'mempool_descr' => $entity_name[$index],
'mempool_precision' => 1,
'mempool_perc_oid' => ".1.3.6.1.4.1.25506.2.6.1.1.1.1.8.$index",

View File

@ -68,7 +68,7 @@ trait YamlMempoolsDiscovery
$mempool = (new Mempool([
'mempool_index' => isset($yaml['index']) ? YamlDiscovery::replaceValues('index', $index, $count, $yaml, $snmp_data) : $index,
'mempool_type' => $yaml['type'] ?? $this->getName(),
'mempool_class' =>$yaml['class'] ?? 'system',
'mempool_class' => $yaml['class'] ?? 'system',
'mempool_precision' => $yaml['precision'] ?? 1,
'mempool_descr' => isset($yaml['descr']) ? ucwords(YamlDiscovery::replaceValues('descr', $index, $count, $yaml, $snmp_data)) : 'Memory',
'mempool_used_oid' => $this->getOid('used', $index, $yaml),

View File

@ -203,7 +203,7 @@ class ConnectivityHelper
private function savePingStats(FpingResponse $ping_response): void
{
$perf = $ping_response->toModel();
$perf->debug = ['poller_name'=>Config::get('distributed_poller_name')];
$perf->debug = ['poller_name' => Config::get('distributed_poller_name')];
if (! $ping_response->success() && Config::get('debug.run_trace', false)) {
$perf->debug = array_merge($perf->debug, $this->traceroute());
}

View File

@ -44,6 +44,7 @@ class RRDRecursiveFilterIterator extends \RecursiveFilterIterator
// We want to search into directories
return true;
}
// Matches files with .rrd in the filename.
// We are only searching rrd folder, but there could be other files and we don't want to cause a stink.
return strpos($filename, '.rrd') !== false;

View File

@ -37,7 +37,7 @@ class InventoryController extends TableController
return [
'device' => 'nullable|int',
'descr' => 'nullable|string',
'model'=> 'nullable|string',
'model' => 'nullable|string',
'serial' => 'nullable|string',
];
}

View File

@ -466,6 +466,7 @@ class Device extends BaseModel
if (empty($ip)) {
return null;
}
// @ suppresses warning, inet_ntop() returns false if it fails
return @inet_ntop($ip) ?: null;
}

View File

@ -35,6 +35,7 @@ class PortGroup extends BaseModel
if ($user->hasGlobalRead()) {
return $query;
}
// maybe filtered in future
return $query;
}

View File

@ -18,7 +18,7 @@ class DeviceGroupFactory extends Factory
return [
'name' => $this->faker->domainWord(),
'desc' => $this->faker->text(255),
'type' =>'static',
'type' => 'static',
];
}
}

View File

@ -648,6 +648,7 @@ function ResolveGlues($tables, $target, $x = 0, $hist = [], $last = [])
}
}
}
//You should never get here.
return false;
}

View File

@ -15,7 +15,7 @@ if ($device['os_group'] == 'cisco') {
$module = 'Cisco-CBQOS';
$component = new LibreNMS\Component();
$components = $component->getComponents($device['device_id'], ['type'=>$module]);
$components = $component->getComponents($device['device_id'], ['type' => $module]);
// We only care about our device id.
$components = $components[$device['device_id']];

View File

@ -59,7 +59,7 @@ if ($device['os_group'] == 'cisco') {
$module = 'Cisco-OTV';
$component = new LibreNMS\Component();
$components = $component->getComponents($device['device_id'], ['type'=>$module]);
$components = $component->getComponents($device['device_id'], ['type' => $module]);
// We only care about our device id.
$components = $components[$device['device_id']];

View File

@ -43,7 +43,7 @@ if ($device['os_group'] == 'cisco') {
* Get module's components for a device
*/
$component = new LibreNMS\Component();
$components = $component->getComponents($device['device_id'], ['type'=>$module]);
$components = $component->getComponents($device['device_id'], ['type' => $module]);
$components = $components[$device['device_id']];
/*

View File

@ -13,7 +13,7 @@
$comp_module = 'Cisco-CIMC';
$component = new LibreNMS\Component();
$components = $component->getComponents($device['device_id'], ['type'=>$comp_module]);
$components = $component->getComponents($device['device_id'], ['type' => $comp_module]);
// We only care about our device id.
$components = $components[$device['device_id']];

View File

@ -14,7 +14,7 @@
$module = 'ntp';
$component = new LibreNMS\Component();
$components = $component->getComponents($device['device_id'], ['type'=>$module]);
$components = $component->getComponents($device['device_id'], ['type' => $module]);
// We only care about our device id.
$components = $components[$device['device_id']];

View File

@ -16,7 +16,7 @@ use LibreNMS\Util\IP;
$module = 'ntp';
$component = new LibreNMS\Component();
$components = $component->getComponents($device['device_id'], ['type'=>$module]);
$components = $component->getComponents($device['device_id'], ['type' => $module]);
// We only care about our device id.
$components = $components[$device['device_id']];

View File

@ -1,6 +1,6 @@
<?php
$int_desc = snmpwalk_group($device, 'ifMainDesc', 'ARICENT-CFA-MIB');
foreach ($port_stats as $index=>$port) {
foreach ($port_stats as $index => $port) {
$port_stats[$index]['ifAlias'] = $int_desc[$index]['ifMainDesc'];
}

View File

@ -142,7 +142,7 @@ function device_discovery_trigger($id)
$message = 'Error rediscovering device';
}
return ['status'=> $update, 'message' => $message];
return ['status' => $update, 'message' => $message];
}
function delete_device($id)

View File

@ -75,7 +75,7 @@ function meta_graph_local($host, $plugin, $plugin_instance, $type, $type_instanc
continue;
}
$sources[] = ['name'=>$inst, 'file'=>$file];
$sources[] = ['name' => $inst, 'file' => $file];
}
// return collectd_draw_meta_stack($opts, $sources);

View File

@ -1694,7 +1694,7 @@ function meta_graph_files_count($host, $plugin, $plugin_instance, $type, $type_i
continue;
}
$sources[] = ['name'=>$inst, 'file'=>$file];
$sources[] = ['name' => $inst, 'file' => $file];
}
return collectd_draw_meta_stack($opts, $sources);
@ -1729,7 +1729,7 @@ function meta_graph_files_size($host, $plugin, $plugin_instance, $type, $type_in
continue;
}
$sources[] = ['name'=>$inst, 'file'=>$file];
$sources[] = ['name' => $inst, 'file' => $file];
}
return collectd_draw_meta_stack($opts, $sources);
@ -1769,7 +1769,7 @@ function meta_graph_cpu($host, $plugin, $plugin_instance, $type, $type_instances
continue;
}
$sources[] = ['name'=>$inst, 'file'=>$file];
$sources[] = ['name' => $inst, 'file' => $file];
}
return collectd_draw_meta_stack($opts, $sources);
@ -1807,7 +1807,7 @@ function meta_graph_memory($host, $plugin, $plugin_instance, $type, $type_instan
continue;
}
$sources[] = ['name'=>$inst, 'file'=>$file];
$sources[] = ['name' => $inst, 'file' => $file];
}
return collectd_draw_meta_stack($opts, $sources);
@ -1844,7 +1844,7 @@ function meta_graph_vs_threads($host, $plugin, $plugin_instance, $type, $type_in
continue;
}
$sources[] = ['name'=>$inst, 'file'=>$file];
$sources[] = ['name' => $inst, 'file' => $file];
}
return collectd_draw_meta_line($opts, $sources);
@ -1881,7 +1881,7 @@ function meta_graph_vs_memory($host, $plugin, $plugin_instance, $type, $type_ins
continue;
}
$sources[] = ['name'=>$inst, 'file'=>$file];
$sources[] = ['name' => $inst, 'file' => $file];
}
return collectd_draw_meta_line($opts, $sources);
@ -1910,7 +1910,7 @@ function meta_graph_if_rx_errors($host, $plugin, $plugin_instance, $type, $type_
continue;
}
$sources[] = ['name'=>$inst, 'file'=>$file];
$sources[] = ['name' => $inst, 'file' => $file];
}
return collectd_draw_meta_stack($opts, $sources);
@ -1939,7 +1939,7 @@ function meta_graph_mysql_commands($host, $plugin, $plugin_instance, $type, $typ
continue;
}
$sources[] = ['name'=>$inst, 'file'=>$file];
$sources[] = ['name' => $inst, 'file' => $file];
}
return collectd_draw_meta_stack($opts, $sources);
@ -1968,7 +1968,7 @@ function meta_graph_nfs_procedure($host, $plugin, $plugin_instance, $type, $type
continue;
}
$sources[] = ['name'=>$inst, 'file'=>$file];
$sources[] = ['name' => $inst, 'file' => $file];
}
return collectd_draw_meta_stack($opts, $sources);
@ -2006,7 +2006,7 @@ function meta_graph_ps_state($host, $plugin, $plugin_instance, $type, $type_inst
continue;
}
$sources[] = ['name'=>$inst, 'file'=>$file];
$sources[] = ['name' => $inst, 'file' => $file];
}
return collectd_draw_meta_stack($opts, $sources);
@ -2042,7 +2042,7 @@ function meta_graph_swap($host, $plugin, $plugin_instance, $type, $type_instance
continue;
}
$sources[] = ['name'=>$inst, 'file'=>$file];
$sources[] = ['name' => $inst, 'file' => $file];
}
return collectd_draw_meta_stack($opts, $sources);
@ -2086,7 +2086,7 @@ function meta_graph_apache_scoreboard($host, $plugin, $plugin_instance, $type, $
continue;
}
$sources[] = ['name'=>$inst, 'file'=>$file, 'ds'=>'value'];
$sources[] = ['name' => $inst, 'file' => $file, 'ds' => 'value'];
}
return collectd_draw_meta_stack($opts, $sources);
@ -2131,7 +2131,7 @@ function meta_graph_tcp_connections($host, $plugin, $plugin_instance, $type, $ty
continue;
}
$sources[] = ['name'=>$inst, 'file'=>$file, 'ds'=>'value'];
$sources[] = ['name' => $inst, 'file' => $file, 'ds' => 'value'];
}
return collectd_draw_meta_stack($opts, $sources);

View File

@ -50,17 +50,17 @@ foreach (['stype', 'device_id', 'service_id'] as $varname) {
if (is_numeric($service_id) && $service_id > 0) {
// Need to edit.
if (is_numeric(edit_service($update, $service_id))) {
$status = ['status' =>0, 'message' => 'Modified Service: <i>' . $service_id . ': ' . $stype . '</i>'];
$status = ['status' => 0, 'message' => 'Modified Service: <i>' . $service_id . ': ' . $stype . '</i>'];
} else {
$status = ['status' =>1, 'message' => 'ERROR: Failed to modify service: <i>' . $service_id . '</i>'];
$status = ['status' => 1, 'message' => 'ERROR: Failed to modify service: <i>' . $service_id . '</i>'];
}
} else {
// Need to add.
$service_id = add_service($device_id, $stype, $desc, $ip, $param, $ignore, $disabled, 0, $name);
if ($service_id == false) {
$status = ['status' =>1, 'message' => 'ERROR: Failed to add Service: <i>' . $stype . '</i>'];
$status = ['status' => 1, 'message' => 'ERROR: Failed to add Service: <i>' . $stype . '</i>'];
} else {
$status = ['status' =>0, 'message' => 'Added Service: <i>' . $service_id . ': ' . $stype . '</i>'];
$status = ['status' => 0, 'message' => 'Added Service: <i>' . $service_id . ': ' . $stype . '</i>'];
}
}
header('Content-Type: application/json');

View File

@ -38,5 +38,5 @@ if (! is_numeric($vars['transport_id'])) {
exit(json_encode([
'status' => $status,
'message'=> $message,
'message' => $message,
]));

View File

@ -23,11 +23,11 @@
* @author Tony Murray <murraytony@gmail.com>
*/
if (! Auth::user()->hasGlobalAdmin()) {
$status = ['status' =>1, 'message' => 'ERROR: You need to be admin to delete poller entries'];
$status = ['status' => 1, 'message' => 'ERROR: You need to be admin to delete poller entries'];
} else {
$id = $vars['id'];
if (! is_numeric($id)) {
$status = ['status' =>1, 'message' => 'No poller has been selected'];
$status = ['status' => 1, 'message' => 'No poller has been selected'];
} else {
$poller_name = dbFetchCell('SELECT `poller_name` FROM `pollers` WHERE `id`=?', [$id]);
if (dbDelete('poller_cluster', 'id=?', [$id]) && dbDelete('poller_cluster_stats', 'parent_poller=?', [$id])) {

View File

@ -23,11 +23,11 @@
* @author Tony Murray <murraytony@gmail.com>
*/
if (! Auth::user()->hasGlobalAdmin()) {
$status = ['status' =>1, 'message' => 'ERROR: You need to be admin to delete poller entries'];
$status = ['status' => 1, 'message' => 'ERROR: You need to be admin to delete poller entries'];
} else {
$id = $vars['id'];
if (! is_numeric($id)) {
$status = ['status' =>1, 'message' => 'No poller has been selected'];
$status = ['status' => 1, 'message' => 'No poller has been selected'];
} else {
$poller_name = dbFetchCell('SELECT `poller_name` FROM `pollers` WHERE `id`=?', [$id]);
if (dbDelete('pollers', 'id=?', [$id])) {

View File

@ -12,15 +12,15 @@
*/
if (! Auth::user()->hasGlobalAdmin()) {
$status = ['status' =>1, 'message' => 'ERROR: You need to be admin to delete services'];
$status = ['status' => 1, 'message' => 'ERROR: You need to be admin to delete services'];
} else {
if (! is_numeric($vars['service_id'])) {
$status = ['status' =>1, 'message' => 'No Service has been selected'];
$status = ['status' => 1, 'message' => 'No Service has been selected'];
} else {
if (delete_service($vars['service_id'])) {
$status = ['status' =>0, 'message' => 'Service: <i>' . $vars['service_id'] . ', has been deleted.</i>'];
$status = ['status' => 0, 'message' => 'Service: <i>' . $vars['service_id'] . ', has been deleted.</i>'];
} else {
$status = ['status' =>1, 'message' => 'Service: <i>' . $vars['service_id'] . ', has NOT been deleted.</i>'];
$status = ['status' => 1, 'message' => 'Service: <i>' . $vars['service_id'] . ', has NOT been deleted.</i>'];
}
}
}

View File

@ -39,5 +39,5 @@ if (! is_numeric($vars['group_id'])) {
exit(json_encode([
'status' => $status,
'message'=> $message,
'message' => $message,
]));

View File

@ -37,7 +37,7 @@ if (! is_numeric($device_id)) {
} elseif (! is_numeric($data)) {
$message = 'Missing value';
} else {
if (dbUpdate(['mempool_perc_warn'=>$data], 'mempools', '`mempool_id`=? AND `device_id`=?', [$mempool_id, $device_id]) >= 0) {
if (dbUpdate(['mempool_perc_warn' => $data], 'mempools', '`mempool_id`=? AND `device_id`=?', [$mempool_id, $device_id]) >= 0) {
$message = 'Memory information updated';
$status = 'ok';
} else {

View File

@ -37,7 +37,7 @@ if (in_array($_REQUEST['action'], ['stick', 'unstick', 'create']) && ! Auth::use
}
if ($_REQUEST['action'] == 'read' && isset($_REQUEST['notification_id'])) {
if (dbInsert(['notifications_id'=>$_REQUEST['notification_id'], 'user_id'=>Auth::id(), 'key'=>'read', 'value'=>1], 'notifications_attribs')) {
if (dbInsert(['notifications_id' => $_REQUEST['notification_id'], 'user_id' => Auth::id(), 'key' => 'read', 'value' => 1], 'notifications_attribs')) {
exit(json_encode([
'status' => 'ok',
'message' => 'Set as Read',
@ -61,7 +61,7 @@ if ($_REQUEST['action'] == 'read' && isset($_REQUEST['notification_id'])) {
'message' => 'All notifications set as read',
]));
} elseif ($_REQUEST['action'] == 'stick' && isset($_REQUEST['notification_id'])) {
if (dbInsert(['notifications_id'=>$_REQUEST['notification_id'], 'user_id'=>Auth::id(), 'key'=>'sticky', 'value'=>1], 'notifications_attribs')) {
if (dbInsert(['notifications_id' => $_REQUEST['notification_id'], 'user_id' => Auth::id(), 'key' => 'sticky', 'value' => 1], 'notifications_attribs')) {
exit(json_encode([
'status' => 'ok',
'message' => 'Set as Sticky',
@ -75,7 +75,7 @@ if ($_REQUEST['action'] == 'read' && isset($_REQUEST['notification_id'])) {
]));
}
} elseif ($_REQUEST['action'] == 'create' && (! empty($_REQUEST['title']) && ! empty($_REQUEST['body']))) {
if (dbInsert(['title'=>$_REQUEST['title'], 'body'=>$_REQUEST['body'], 'checksum'=>hash('sha512', Auth::id() . '.LOCAL.' . $_REQUEST['title']), 'source'=>Auth::id()], 'notifications')) {
if (dbInsert(['title' => $_REQUEST['title'], 'body' => $_REQUEST['body'], 'checksum' => hash('sha512', Auth::id() . '.LOCAL.' . $_REQUEST['title']), 'source' => Auth::id()], 'notifications')) {
exit(json_encode([
'status' => 'ok',
'message' => 'Created',

View File

@ -37,7 +37,7 @@ if (! is_numeric($device_id)) {
} elseif (! is_numeric($data)) {
$message = 'Missing value';
} else {
if (dbUpdate(['processor_perc_warn'=>$data], 'processors', '`processor_id`=? AND `device_id`=?', [$processor_id, $device_id]) >= 0) {
if (dbUpdate(['processor_perc_warn' => $data], 'processors', '`processor_id`=? AND `device_id`=?', [$processor_id, $device_id]) >= 0) {
$message = 'Processor information updated';
$status = 'ok';
} else {

View File

@ -35,7 +35,7 @@ if (! is_numeric($device_id)) {
} elseif (! is_numeric($routing_id)) {
$message = 'Missing routing id';
} else {
if (dbUpdate(['bgpPeerDescr'=>$data], 'bgpPeers', '`bgpPeer_id`=? AND `device_id`=?', [$routing_id, $device_id]) >= 0) {
if (dbUpdate(['bgpPeerDescr' => $data], 'bgpPeers', '`bgpPeer_id`=? AND `device_id`=?', [$routing_id, $device_id]) >= 0) {
$message = 'Routing information updated';
$status = 'ok';
} else {

View File

@ -37,7 +37,7 @@ if (! is_numeric($device_id)) {
} elseif (! is_numeric($data)) {
$message = 'Missing value';
} else {
if (dbUpdate(['storage_perc_warn'=>$data], 'storage', '`storage_id`=? AND `device_id`=?', [$storage_id, $device_id]) >= 0) {
if (dbUpdate(['storage_perc_warn' => $data], 'storage', '`storage_id`=? AND `device_id`=?', [$storage_id, $device_id]) >= 0) {
$message = 'Storage information updated';
$status = 'ok';
} else {

View File

@ -26,7 +26,7 @@ if (! empty($ifName) && is_numeric($port_id)) {
$descr = 'repoll';
// Set to repoll so we avoid using ifDescr on port poll
}
if (dbUpdate(['ifAlias'=>$descr], 'ports', '`port_id`=?', [$port_id]) > 0) {
if (dbUpdate(['ifAlias' => $descr], 'ports', '`port_id`=?', [$port_id]) > 0) {
$device = device_by_id_cache($device_id);
if ($descr === 'repoll') {
del_dev_attrib($device, 'ifName:' . $ifName);

View File

@ -10,7 +10,7 @@ $rrd_filename = Rrd::name($device['hostname'], ['app', 'asterisk', 'iax2', $app-
$astiax2_access_array = [
'iax2peers' => 'Total Peers',
'iax2online' => 'Online',
'iax2offline'=> 'Offline',
'iax2offline' => 'Offline',
'iax2unmonitored' => 'Unmonitored',
];

View File

@ -9,7 +9,7 @@ $rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-access', $app
$fr_access_array = [
'requests' => 'Requests',
'accepts' => 'Accepts',
'rejects'=> 'Rejects',
'rejects' => 'Rejects',
'challenges' => 'Challenges',
];
$colours = 'mixed';

View File

@ -9,7 +9,7 @@ $rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-proxy_access'
$fr_proxy_access_array = [
'requests' => 'Requests',
'accepts' => 'Accepts',
'rejects'=> 'Rejects',
'rejects' => 'Rejects',
'challenges' => 'Challenges',
];
$colours = 'mixed';

View File

@ -27,10 +27,10 @@ if (sizeof($packages) > 0) {
print_optionbar_start();
if (isset($vars['package'])) {
echo generate_link('General', $link_array, ['app'=>'cape', 'stddev'=>$vars['stddev'], 'bypkg'=>$vars['bypkg'], 'bytimeslot'=>$vars['bytimeslot'], 'statsavg'=>$vars['statsavg'], 'runstats'=>$vars['runstats']]);
echo generate_link('General', $link_array, ['app' => 'cape', 'stddev' => $vars['stddev'], 'bypkg' => $vars['bypkg'], 'bytimeslot' => $vars['bytimeslot'], 'statsavg' => $vars['statsavg'], 'runstats' => $vars['runstats']]);
} else {
$label = '<span class="pagemenu-selected">General</span>';
echo generate_link($label, $link_array, ['app'=>'cape', 'stddev'=>$vars['stddev'], 'bypkg'=>$vars['bypkg'], 'bytimeslot'=>$vars['bytimeslot'], 'statsavg'=>$vars['statsavg'], 'runstats'=>$vars['runstats']]);
echo generate_link($label, $link_array, ['app' => 'cape', 'stddev' => $vars['stddev'], 'bypkg' => $vars['bypkg'], 'bytimeslot' => $vars['bytimeslot'], 'statsavg' => $vars['statsavg'], 'runstats' => $vars['runstats']]);
}
echo ' | <b>Packages:</b> ';
@ -50,7 +50,7 @@ if (sizeof($packages) > 0) {
$append = ', ';
}
echo generate_link($label, $link_array, ['app'=>'cape', 'stddev'=>$vars['stddev'], 'bypkg'=>$vars['bypkg'], 'bytimeslot'=>$vars['bytimeslot'], 'package'=>$package, 'statsavg'=>$vars['statsavg'], 'runstats'=>$vars['runstats']]) . $append;
echo generate_link($label, $link_array, ['app' => 'cape', 'stddev' => $vars['stddev'], 'bypkg' => $vars['bypkg'], 'bytimeslot' => $vars['bytimeslot'], 'package' => $package, 'statsavg' => $vars['statsavg'], 'runstats' => $vars['runstats']]) . $append;
}
echo "<br>\n";
@ -58,12 +58,12 @@ if (sizeof($packages) > 0) {
echo '<b>Run Stats Averages:</b> ';
if ($vars['statsavg'] == 'on') {
$label = '<span class="pagemenu-selected">On</span>';
echo generate_link($label, $link_array, ['app'=>'cape', 'bytimeslot'=>$vars['bytimeslot'], 'bypkg'=>$vars['bypkg'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>'on', 'runstats'=>$vars['runstats']]) . ', ' .
generate_link('Off', $link_array, ['app'=>'cape', 'bytimeslot'=>$vars['bytimeslot'], 'bypkg'=>$vars['bypkg'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>'off', 'runstats'=>$vars['runstats']]);
echo generate_link($label, $link_array, ['app' => 'cape', 'bytimeslot' => $vars['bytimeslot'], 'bypkg' => $vars['bypkg'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => 'on', 'runstats' => $vars['runstats']]) . ', ' .
generate_link('Off', $link_array, ['app' => 'cape', 'bytimeslot' => $vars['bytimeslot'], 'bypkg' => $vars['bypkg'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => 'off', 'runstats' => $vars['runstats']]);
} else {
$label = '<span class="pagemenu-selected">Off</span>';
echo generate_link('On', $link_array, ['app'=>'cape', 'bytimeslot'=>$vars['bytimeslot'], 'bypkg'=>$vars['bypkg'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>'on', 'runstats'=>$vars['runstats']]) . ', ' .
generate_link($label, $link_array, ['app'=>'cape', 'bytimeslot'=>$vars['bytimeslot'], 'bypkg'=>$vars['bypkg'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>'off', 'runstats'=>$vars['runstats']]);
echo generate_link('On', $link_array, ['app' => 'cape', 'bytimeslot' => $vars['bytimeslot'], 'bypkg' => $vars['bypkg'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => 'on', 'runstats' => $vars['runstats']]) . ', ' .
generate_link($label, $link_array, ['app' => 'cape', 'bytimeslot' => $vars['bytimeslot'], 'bypkg' => $vars['bypkg'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => 'off', 'runstats' => $vars['runstats']]);
}
echo ' | ';
@ -71,12 +71,12 @@ if (sizeof($packages) > 0) {
echo '<b>By Time Slot:</b> ';
if ($vars['bytimeslot'] == 'on') {
$label = '<span class="pagemenu-selected">On</span>';
echo generate_link($label, $link_array, ['app'=>'cape', 'bytimeslot'=>'on', 'bypkg'=>$vars['bypkg'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>$vars['runstats']]) . ', ' .
generate_link('Off', $link_array, ['app'=>'cape', 'bytimeslot'=>'off', 'bypkg'=>$vars['bypkg'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>$vars['runstats']]);
echo generate_link($label, $link_array, ['app' => 'cape', 'bytimeslot' => 'on', 'bypkg' => $vars['bypkg'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => $vars['runstats']]) . ', ' .
generate_link('Off', $link_array, ['app' => 'cape', 'bytimeslot' => 'off', 'bypkg' => $vars['bypkg'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => $vars['runstats']]);
} else {
$label = '<span class="pagemenu-selected">Off</span>';
echo generate_link('On', $link_array, ['app'=>'cape', 'bytimeslot'=>'on', 'bypkg'=>$vars['bypkg'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>$vars['runstats']]) . ', ' .
generate_link($label, $link_array, ['app'=>'cape', 'bytimeslot'=>'off', 'bypkg'=>$vars['bypkg'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>$vars['runstats']]);
echo generate_link('On', $link_array, ['app' => 'cape', 'bytimeslot' => 'on', 'bypkg' => $vars['bypkg'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => $vars['runstats']]) . ', ' .
generate_link($label, $link_array, ['app' => 'cape', 'bytimeslot' => 'off', 'bypkg' => $vars['bypkg'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => $vars['runstats']]);
}
if (! isset($vars['package'])) {
@ -84,12 +84,12 @@ if (sizeof($packages) > 0) {
echo '<b>By Package:</b> ';
if ($vars['bypkg'] == 'on') {
$label = '<span class="pagemenu-selected">On</span>';
echo generate_link($label, $link_array, ['app'=>'cape', 'bypkg'=>'on', 'bytimeslot'=>$vars['bytimeslot'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>$vars['runstats']]) . ', ' .
generate_link('Off', $link_array, ['app'=>'cape', 'bypkg'=>'off', 'bytimeslot'=>$vars['bytimeslot'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>$vars['runstats']]);
echo generate_link($label, $link_array, ['app' => 'cape', 'bypkg' => 'on', 'bytimeslot' => $vars['bytimeslot'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => $vars['runstats']]) . ', ' .
generate_link('Off', $link_array, ['app' => 'cape', 'bypkg' => 'off', 'bytimeslot' => $vars['bytimeslot'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => $vars['runstats']]);
} else {
$label = '<span class="pagemenu-selected">Off</span>';
echo generate_link('On', $link_array, ['app'=>'cape', 'bypkg'=>'on', 'bytimeslot'=>$vars['bytimeslot'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>$vars['runstats']]) . ', ' .
generate_link($label, $link_array, ['app'=>'cape', 'bypkg'=>'off', 'bytimeslot'=>$vars['bytimeslot'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>$vars['runstats']]);
echo generate_link('On', $link_array, ['app' => 'cape', 'bypkg' => 'on', 'bytimeslot' => $vars['bytimeslot'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => $vars['runstats']]) . ', ' .
generate_link($label, $link_array, ['app' => 'cape', 'bypkg' => 'off', 'bytimeslot' => $vars['bytimeslot'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => $vars['runstats']]);
}
}
@ -98,12 +98,12 @@ if (sizeof($packages) > 0) {
echo '<b>Standard Deviation:</b> ';
if ($vars['stddev'] == 'on') {
$label = '<span class="pagemenu-selected">On</span>';
echo generate_link($label, $link_array, ['app'=>'cape', 'stddev'=>'on', 'bypkg'=>$vars['bypkg'], 'bytimeslot'=>$vars['bytimeslot'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>$vars['runstats']]) . ', ' .
generate_link('Off', $link_array, ['app'=>'cape', 'stddev'=>'off', 'bypkg'=>$vars['bypkg'], 'bytimeslot'=>$vars['bytimeslot'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>$vars['runstats']]);
echo generate_link($label, $link_array, ['app' => 'cape', 'stddev' => 'on', 'bypkg' => $vars['bypkg'], 'bytimeslot' => $vars['bytimeslot'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => $vars['runstats']]) . ', ' .
generate_link('Off', $link_array, ['app' => 'cape', 'stddev' => 'off', 'bypkg' => $vars['bypkg'], 'bytimeslot' => $vars['bytimeslot'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => $vars['runstats']]);
} else {
$label = '<span class="pagemenu-selected">Off</span>';
echo generate_link('On', $link_array, ['app'=>'cape', 'stddev'=>'on', 'bypkg'=>$vars['bypkg'], 'bytimeslot'=>$vars['bytimeslot'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>$vars['runstats']]) . ', ' .
generate_link($label, $link_array, ['app'=>'cape', 'stddev'=>'off', 'bypkg'=>$vars['bypkg'], 'bytimeslot'=>$vars['bytimeslot'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>$vars['runstats']]);
echo generate_link('On', $link_array, ['app' => 'cape', 'stddev' => 'on', 'bypkg' => $vars['bypkg'], 'bytimeslot' => $vars['bytimeslot'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => $vars['runstats']]) . ', ' .
generate_link($label, $link_array, ['app' => 'cape', 'stddev' => 'off', 'bypkg' => $vars['bypkg'], 'bytimeslot' => $vars['bytimeslot'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => $vars['runstats']]);
}
if (! isset($vars['package'])) {
@ -111,12 +111,12 @@ if (sizeof($packages) > 0) {
echo '<b>Run Statuses Averages:</b> ';
if ($vars['runstats'] == 'on') {
$label = '<span class="pagemenu-selected">On</span>';
echo generate_link($label, $link_array, ['app'=>'cape', 'bypkg'=>$vars['bypkg'], 'bytimeslot'=>$vars['bytimeslot'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>'on']) . ', ' .
generate_link('Off', $link_array, ['app'=>'cape', 'bypkg'=>$vars['bypkg'], 'bytimeslot'=>$vars['bytimeslot'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>'off']);
echo generate_link($label, $link_array, ['app' => 'cape', 'bypkg' => $vars['bypkg'], 'bytimeslot' => $vars['bytimeslot'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => 'on']) . ', ' .
generate_link('Off', $link_array, ['app' => 'cape', 'bypkg' => $vars['bypkg'], 'bytimeslot' => $vars['bytimeslot'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => 'off']);
} else {
$label = '<span class="pagemenu-selected">Off</span>';
echo generate_link('On', $link_array, ['app'=>'cape', 'bypkg'=>$vars['bypkg'], 'bytimeslot'=>$vars['bytimeslot'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>'on']) . ', ' .
generate_link($label, $link_array, ['app'=>'cape', 'bypkg'=>$vars['bypkg'], 'bytimeslot'=>$vars['bytimeslot'], 'stddev'=>$vars['stddev'], 'package'=>$vars['package'], 'statsavg'=>$vars['statsavg'], 'runstats'=>'off']);
echo generate_link('On', $link_array, ['app' => 'cape', 'bypkg' => $vars['bypkg'], 'bytimeslot' => $vars['bytimeslot'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => 'on']) . ', ' .
generate_link($label, $link_array, ['app' => 'cape', 'bypkg' => $vars['bypkg'], 'bytimeslot' => $vars['bytimeslot'], 'stddev' => $vars['stddev'], 'package' => $vars['package'], 'statsavg' => $vars['statsavg'], 'runstats' => 'off']);
}
}

View File

@ -25,7 +25,7 @@ foreach ($app->data['VMs'] as $vm) {
$label = '<span class="pagemenu-selected">' . $vm . '</span>';
}
$vm_links[] = generate_link($label, $link_array, ['vm'=>$vm]);
$vm_links[] = generate_link($label, $link_array, ['vm' => $vm]);
}
echo implode(', ', $vm_links);
@ -39,22 +39,22 @@ echo '<br><b>Pages: </b>';
if ($vars['vmpage'] == 'general') {
$page_links[] = '<span class="pagemenu-selected">General</span>';
} else {
$page_links[] = generate_link('General', $link_array, ['vm' => $vars['vm'], 'vmpage'=>'general']);
$page_links[] = generate_link('General', $link_array, ['vm' => $vars['vm'], 'vmpage' => 'general']);
}
if ($vars['vmpage'] == 'disk') {
$page_links[] = '<span class="pagemenu-selected">Disk</span>';
} else {
$page_links[] = generate_link('Disk', $link_array, ['vm' => $vars['vm'], 'vmpage'=>'disk']);
$page_links[] = generate_link('Disk', $link_array, ['vm' => $vars['vm'], 'vmpage' => 'disk']);
}
if ($vars['vmpage'] == 'network') {
$page_links[] = '<span class="pagemenu-selected">Network</span>';
} else {
$page_links[] = generate_link('Network', $link_array, ['vm' => $vars['vm'], 'vmpage'=>'network']);
$page_links[] = generate_link('Network', $link_array, ['vm' => $vars['vm'], 'vmpage' => 'network']);
}
if ($vars['vmpage'] == 'Snapshots') {
$page_links[] = '<span class="pagemenu-selected">Network</span>';
} else {
$page_links[] = generate_link('Snapshots', $link_array, ['vm' => $vars['vm'], 'vmpage'=>'snapshots']);
$page_links[] = generate_link('Snapshots', $link_array, ['vm' => $vars['vm'], 'vmpage' => 'snapshots']);
}
echo implode(', ', $page_links);
@ -70,7 +70,7 @@ if (isset($vars['vm'])) {
if ($vars['vmdisk'] == $disk) {
$disk_links[] = $label;
} else {
$disk_links[] = generate_link($label, $link_array, ['vm' => $vars['vm'], 'vmdisk'=>$disk]);
$disk_links[] = generate_link($label, $link_array, ['vm' => $vars['vm'], 'vmdisk' => $disk]);
}
}
echo implode(', ', $disk_links);
@ -83,7 +83,7 @@ if (isset($vars['vm'])) {
if ($vars['vmif'] == $vmif) {
$if_links[] = '<span class="pagemenu-selected">' . $vmif . '</span>';
} else {
$if_links[] = generate_link($label, $link_array, ['vm' => $vars['vm'], 'vmif'=>$vmif]);
$if_links[] = generate_link($label, $link_array, ['vm' => $vars['vm'], 'vmif' => $vmif]);
}
}
echo implode(', ', $if_links);
@ -97,7 +97,7 @@ if (isset($vars['vmif']) and isset($vars['vm'])) {
'<b>MAC:</b> ' . $mac;
if (isset($port) && isset($mac) && $mac != '') {
echo ' (' .
generate_device_link(['device_id'=>$port->device_id]) .
generate_device_link(['device_id' => $port->device_id]) .
', ' .
generate_port_link([
'label' => $port->label,

View File

@ -39,7 +39,7 @@ if (isset($vars['log_set']) && isset($sets[$vars['log_set']])) {
? '<span class="pagemenu-selected">' . $log_file . '</span>'
: $log_file;
echo generate_link($label, $link_array, ['log_set' => $vars['log_set'], 'log_file'=>$log_file]) . "\n";
echo generate_link($label, $link_array, ['log_set' => $vars['log_set'], 'log_file' => $log_file]) . "\n";
if ($index < (count($log_files) - 1)) {
echo ', ';

View File

@ -51,20 +51,20 @@ if (isset($vars['set'])) {
if ($graph_set == 'cluster') {
$graphs = [
'opensearch_c_nodes'=>'Nodes',
'opensearch_c_data_nodes'=>'Data Nodes',
'opensearch_c_all_shards'=>'Combined Shard Stats',
'opensearch_c_pending_tasks'=>'Pending Tasks',
'opensearch_c_in_fl_fetch'=>'In Flight Fetches',
'opensearch_status'=>'Status: 0=Green, 1=Yellow, 2=Red, 3=Unknown',
'opensearch_c_task_max_in_time'=>'Tasks Max Time In Milliseconds',
'opensearch_c_act_shards_perc'=>'Active Shards Percentage',
'opensearch_c_act_pri_shards'=>'Active Primary Shards',
'opensearch_c_act_shards'=>'Active Shards',
'opensearch_c_rel_shards'=>'Relocating Shards',
'opensearch_c_init_shards'=>'Initializing Shards',
'opensearch_c_delayed_shards'=>'Delayed Shards',
'opensearch_c_unass_shards'=>'Unassigned Shards',
'opensearch_c_nodes' => 'Nodes',
'opensearch_c_data_nodes' => 'Data Nodes',
'opensearch_c_all_shards' => 'Combined Shard Stats',
'opensearch_c_pending_tasks' => 'Pending Tasks',
'opensearch_c_in_fl_fetch' => 'In Flight Fetches',
'opensearch_status' => 'Status: 0=Green, 1=Yellow, 2=Red, 3=Unknown',
'opensearch_c_task_max_in_time' => 'Tasks Max Time In Milliseconds',
'opensearch_c_act_shards_perc' => 'Active Shards Percentage',
'opensearch_c_act_pri_shards' => 'Active Primary Shards',
'opensearch_c_act_shards' => 'Active Shards',
'opensearch_c_rel_shards' => 'Relocating Shards',
'opensearch_c_init_shards' => 'Initializing Shards',
'opensearch_c_delayed_shards' => 'Delayed Shards',
'opensearch_c_unass_shards' => 'Unassigned Shards',
];
} elseif ($graph_set == 'translog') {
$graphs = [
@ -175,7 +175,7 @@ if ($graph_set == 'cluster') {
];
} elseif ($graph_set == 'time') {
$graphs = [
'opensearch_c_task_max_in_time'=>'Tasks Max Time',
'opensearch_c_task_max_in_time' => 'Tasks Max Time',
'opensearch_time_all' => 'Combined',
'opensearch_ti_time' => 'Index Time',
'opensearch_ti_del_time' => 'Delete Time',
@ -213,20 +213,20 @@ if ($graph_set == 'cluster') {
];
} else {
$graphs = [
'opensearch_c_nodes'=>'Nodes',
'opensearch_c_data_nodes'=>'Data Nodes',
'opensearch_c_all_shards'=>'Combined Shard Stats',
'opensearch_c_pending_tasks'=>'Pending Tasks',
'opensearch_c_in_fl_fetch'=>'In Flight Fetches',
'opensearch_status'=>'Status: 0=Green, 1=Yellow, 2=Red, 3=Unknown',
'opensearch_c_task_max_in_time'=>'Tasks Max Time In Milliseconds',
'opensearch_c_act_shards_perc'=>'Active Shards Percentage',
'opensearch_c_act_pri_shards'=>'Active Primary Shards',
'opensearch_c_act_shards'=>'Active Shards',
'opensearch_c_rel_shards'=>'Relocating Shards',
'opensearch_c_init_shards'=>'Initializing Shards',
'opensearch_c_delayed_shards'=>'Delayed Shards',
'opensearch_c_unass_shards'=>'Unassigned Shards',
'opensearch_c_nodes' => 'Nodes',
'opensearch_c_data_nodes' => 'Data Nodes',
'opensearch_c_all_shards' => 'Combined Shard Stats',
'opensearch_c_pending_tasks' => 'Pending Tasks',
'opensearch_c_in_fl_fetch' => 'In Flight Fetches',
'opensearch_status' => 'Status: 0=Green, 1=Yellow, 2=Red, 3=Unknown',
'opensearch_c_task_max_in_time' => 'Tasks Max Time In Milliseconds',
'opensearch_c_act_shards_perc' => 'Active Shards Percentage',
'opensearch_c_act_pri_shards' => 'Active Primary Shards',
'opensearch_c_act_shards' => 'Active Shards',
'opensearch_c_rel_shards' => 'Relocating Shards',
'opensearch_c_init_shards' => 'Initializing Shards',
'opensearch_c_delayed_shards' => 'Delayed Shards',
'opensearch_c_unass_shards' => 'Unassigned Shards',
];
}

View File

@ -34,10 +34,10 @@ if (! isset($vars['port'])) {
];
} else {
$graphs = [
'portactivity_totals'=>'Total Connections',
'portactivity_total_details'=>'Total Connections Details',
'portactivity_to'=>'Connections To Server',
'portactivity_from'=>'Connections From Server',
'portactivity_totals' => 'Total Connections',
'portactivity_total_details' => 'Total Connections Details',
'portactivity_to' => 'Connections To Server',
'portactivity_from' => 'Connections From Server',
];
}

View File

@ -14,43 +14,43 @@ if (! isset($vars['privoxyPage'])) {
print_optionbar_start();
$link_tmp = generate_link('General', $link_array, ['app'=>'privoxy', 'privoxyPage'=>'general']);
$link_tmp = generate_link('General', $link_array, ['app' => 'privoxy', 'privoxyPage' => 'general']);
if ($vars['privoxyPage'] == 'general') {
$link_tmp = '<span class="pagemenu-selected">' . $link_tmp . '</span>';
}
echo $link_tmp . ' | ';
$link_tmp = generate_link('Blocks', $link_array, ['app'=>'privoxy', 'privoxyPage'=>'blocks']);
$link_tmp = generate_link('Blocks', $link_array, ['app' => 'privoxy', 'privoxyPage' => 'blocks']);
if ($vars['privoxyPage'] == 'blocks') {
$link_tmp = '<span class="pagemenu-selected">' . $link_tmp . '</span>';
}
echo $link_tmp . ' | ';
$link_tmp = generate_link('Connections', $link_array, ['app'=>'privoxy', 'privoxyPage'=>'conn']);
$link_tmp = generate_link('Connections', $link_array, ['app' => 'privoxy', 'privoxyPage' => 'conn']);
if ($vars['privoxyPage'] == 'conn') {
$link_tmp = '<span class="pagemenu-selected">' . $link_tmp . '</span>';
}
echo $link_tmp . ' | ';
$link_tmp = generate_link('Domains', $link_array, ['app'=>'privoxy', 'privoxyPage'=>'domains']);
$link_tmp = generate_link('Domains', $link_array, ['app' => 'privoxy', 'privoxyPage' => 'domains']);
if ($vars['privoxyPage'] == 'domains') {
$link_tmp = '<span class="pagemenu-selected">' . $link_tmp . '</span>';
}
echo $link_tmp . ' | ';
$link_tmp = generate_link('HTTP Req Type', $link_array, ['app'=>'privoxy', 'privoxyPage'=>'http_type']);
$link_tmp = generate_link('HTTP Req Type', $link_array, ['app' => 'privoxy', 'privoxyPage' => 'http_type']);
if ($vars['privoxyPage'] == 'http_type') {
$link_tmp = '<span class="pagemenu-selected">' . $link_tmp . '</span>';
}
echo $link_tmp . ' | ';
$link_tmp = generate_link('HTTP Response Codes', $link_array, ['app'=>'privoxy', 'privoxyPage'=>'http_resp']);
$link_tmp = generate_link('HTTP Response Codes', $link_array, ['app' => 'privoxy', 'privoxyPage' => 'http_resp']);
if ($vars['privoxyPage'] == 'http_resp') {
$link_tmp = '<span class="pagemenu-selected">' . $link_tmp . '</span>';
}
echo $link_tmp . ' | ';
$link_tmp = generate_link('HTTP Version', $link_array, ['app'=>'privoxy', 'privoxyPage'=>'http_ver']);
$link_tmp = generate_link('HTTP Version', $link_array, ['app' => 'privoxy', 'privoxyPage' => 'http_ver']);
if ($vars['privoxyPage'] == 'http_ver') {
$link_tmp = '<span class="pagemenu-selected">' . $link_tmp . '</span>';
}
@ -63,10 +63,10 @@ if ($vars['privoxyPage'] == 'general') {
'privoxy_client_requests' => 'Client Requests',
'privoxy_blocks' => 'Blocked Requests',
'privoxy_block_percent' => 'Blocked Requests, Percent',
'privoxy_crunches'=>'Crunches',
'privoxy_unique_domains'=>'Unique Domains',
'privoxy_unique_bdomains'=>'Unique Domains Blocked',
'privoxy_ubd_per'=>'Unique Domains Blocked, Percent',
'privoxy_crunches' => 'Crunches',
'privoxy_unique_domains' => 'Unique Domains',
'privoxy_unique_bdomains' => 'Unique Domains Blocked',
'privoxy_ubd_per' => 'Unique Domains Blocked, Percent',
'privoxy_bytes_to_client' => 'Bytes Sent To Clients',
'privoxy_imp_accounted' => 'Improperly Accounted',
];
@ -82,7 +82,7 @@ if ($vars['privoxyPage'] == 'general') {
$graphs = [
'privoxy_blocks' => 'Blocked Requests',
'privoxy_block_percent' => 'Blocked Requests, Percent',
'privoxy_crunches'=>'Crunches',
'privoxy_crunches' => 'Crunches',
'privoxy_unique_bdomains' => 'Unique Domains, Blocked',
'privoxy_unique_bdomains_np' => 'Unique Domains Without Port, Blocked',
];

View File

@ -28,21 +28,21 @@ foreach ($sagan_instances as $index => $sinstance) {
print_optionbar_end();
$graphs = [
'sagan_bytes'=>'Bytes',
'sagan_eps'=>'Events Per Second',
'sagan_total'=>'Recieved Log Entries',
'sagan_drop'=>'Drop',
'sagan_drop_percent'=>'Drop Percent',
'sagan_f_total'=>'Flows Total',
'sagan_f_dropped'=>'Flows Dropped',
'sagan_f_drop_percent'=>'Flows Dropped Percent',
'sagan_ignore'=>'Ignore',
'sagan_bytes_ignored'=>'Bytes Ignored',
'sagan_match'=>'Match',
'sagan_max_bytes_log_line'=>'Max Bytes Log Line',
'sagan_threshold'=>'Threshold',
'sagan_uptime'=>'Uptime',
'sagan_alert'=>'Alert: 0=OK, 1=WARNING, 2=CRITICAL, 3+UNKNOWN',
'sagan_bytes' => 'Bytes',
'sagan_eps' => 'Events Per Second',
'sagan_total' => 'Recieved Log Entries',
'sagan_drop' => 'Drop',
'sagan_drop_percent' => 'Drop Percent',
'sagan_f_total' => 'Flows Total',
'sagan_f_dropped' => 'Flows Dropped',
'sagan_f_drop_percent' => 'Flows Dropped Percent',
'sagan_ignore' => 'Ignore',
'sagan_bytes_ignored' => 'Bytes Ignored',
'sagan_match' => 'Match',
'sagan_max_bytes_log_line' => 'Max Bytes Log Line',
'sagan_threshold' => 'Threshold',
'sagan_uptime' => 'Uptime',
'sagan_alert' => 'Alert: 0=OK, 1=WARNING, 2=CRITICAL, 3+UNKNOWN',
];
foreach ($graphs as $key => $text) {

View File

@ -28,7 +28,7 @@ foreach ($app_data['disks'] as $label => $disk_data) {
}
}
array_push($drives, generate_link($label, $link_array, ['disk'=>$disk]) . $health_status);
array_push($drives, generate_link($label, $link_array, ['disk' => $disk]) . $health_status);
}
printf('%s | drives: %s', generate_link('All Drives', $link_array), implode(', ', $drives));
@ -75,7 +75,7 @@ if (isset($vars['disk'])) {
'smart_temp' => 'Temperature',
'smart_ssd' => 'SSD-specific',
'smart_other' => 'Other',
'smart_tests_status'=> 'S.M.A.R.T self-tests results',
'smart_tests_status' => 'S.M.A.R.T self-tests results',
'smart_tests_ran' => 'S.M.A.R.T self-tests run count',
'smart_runtime' => 'Power On Hours',
];

View File

@ -15,8 +15,8 @@ $link_array = [
];
$graphs = [
'sneck_results'=>'Results',
'sneck_time'=>'Time Difference',
'sneck_results' => 'Results',
'sneck_time' => 'Time Difference',
];
foreach ($graphs as $key => $text) {

View File

@ -28,17 +28,17 @@ foreach ($suricata_instances as $index => $sinstance) {
print_optionbar_end();
$graphs = [
'suricata_packets'=>'Packets',
'suricata_bytes'=>'Bytes',
'suricata_nasty_delta'=>'Drops or Errors Delta',
'suricata_nasty_percent'=>'Drops or Errors Percent',
'suricata_dec_proto'=>'Decoder Protocols',
'suricata_flow_proto'=>'Flow Protocols',
'suricata_app_flows'=>'App Layer Flows',
'suricata_app_tx'=>'App Layer TX',
'suricata_mem_use'=>'Memory Usage',
'suricata_uptime'=>'Uptime',
'suricata_alert'=>'Alert Status',
'suricata_packets' => 'Packets',
'suricata_bytes' => 'Bytes',
'suricata_nasty_delta' => 'Drops or Errors Delta',
'suricata_nasty_percent' => 'Drops or Errors Percent',
'suricata_dec_proto' => 'Decoder Protocols',
'suricata_flow_proto' => 'Flow Protocols',
'suricata_app_flows' => 'App Layer Flows',
'suricata_app_tx' => 'App Layer TX',
'suricata_mem_use' => 'Memory Usage',
'suricata_uptime' => 'Uptime',
'suricata_alert' => 'Alert Status',
];
foreach ($graphs as $key => $text) {

View File

@ -10,7 +10,7 @@ $link_array = [
print_optionbar_start();
echo generate_link('ARC', $link_array);
echo ' | ' . generate_link('L2', $link_array, ['zfs_page'=>'l2']);
echo ' | ' . generate_link('L2', $link_array, ['zfs_page' => 'l2']);
echo ' | Pools: ';
$pools = $app->data['pools'] ?? [];
@ -31,9 +31,9 @@ print_optionbar_end();
if (isset($vars['pool'])) {
$graphs = [
'zfs_pool_space'=>'Pool Space',
'zfs_pool_cap'=>'Pool Capacity',
'zfs_pool_frag'=>'Pool Fragmentation',
'zfs_pool_space' => 'Pool Space',
'zfs_pool_cap' => 'Pool Capacity',
'zfs_pool_frag' => 'Pool Fragmentation',
];
} elseif (isset($vars['zfs_page']) && $vars['zfs_page'] == 'l2') {
$graphs = [

View File

@ -69,7 +69,7 @@ if (! Auth::user()->hasGlobalAdmin()) {
} else {
}
echo generate_link($text, $link_array, ['section'=>$type]);
echo generate_link($text, $link_array, ['section' => $type]);
if ($vars['section'] == $type) {
echo '</span>';

View File

@ -36,7 +36,7 @@ use App\Models\Storage;
$qfp = 0;
if ($device['os_group'] == 'cisco') {
$component = new LibreNMS\Component();
$components = $component->getComponents($device['device_id'], ['type'=> 'cisco-qfp']);
$components = $component->getComponents($device['device_id'], ['type' => 'cisco-qfp']);
$components = $components[$device['device_id']];
$qfp = isset($components) ? count($components) : 0;
}

View File

@ -44,19 +44,19 @@ echo '
$option_default = $vars['stattype'] ?? \LibreNMS\Config::get('nfsen_stats_default');
$stat_types = [
'record'=>'Flow Records',
'ip'=>'Any IP Address',
'srcip'=>'SRC IP Address',
'dstip'=>'DST IP Address',
'port'=>'Any Port',
'srcport'=>'SRC Port',
'dstport'=>'DST Port',
'srctos'=>'SRC TOS',
'dsttos'=>'DST TOS',
'tos'=>'TOS',
'as'=>'AS',
'srcas'=>'SRC AS',
'dstas'=>'DST AS',
'record' => 'Flow Records',
'ip' => 'Any IP Address',
'srcip' => 'SRC IP Address',
'dstip' => 'DST IP Address',
'port' => 'Any Port',
'srcport' => 'SRC Port',
'dstport' => 'DST Port',
'srctos' => 'SRC TOS',
'dsttos' => 'DST TOS',
'tos' => 'TOS',
'as' => 'AS',
'srcas' => 'SRC AS',
'dstas' => 'DST AS',
];
// puts together the drop down options
@ -82,12 +82,12 @@ if (isset($vars['statorder'])) {
// WARNING: order is relevant as it has to match the
// check later in the process part of this page.
$order_types = [
'flows'=>1,
'packets'=>1,
'bytes'=>1,
'pps'=>1,
'bps'=>1,
'bpp'=>1,
'flows' => 1,
'packets' => 1,
'bytes' => 1,
'pps' => 1,
'bps' => 1,
'bpp' => 1,
];
// puts together the drop down options

View File

@ -77,7 +77,7 @@ foreach ($datas as $texttype) {
if ($active_metric == $metric) {
$navbar .= '<span class="pagemenu-selected">';
}
$navbar .= generate_link($type_text[$metric], $link_array, ['metric'=> $metric, 'view' => $vars['view']]);
$navbar .= generate_link($type_text[$metric], $link_array, ['metric' => $metric, 'view' => $vars['view']]);
if ($active_metric == $metric) {
$navbar .= '</span>';
}
@ -90,7 +90,7 @@ if ($vars['view'] == 'graphs') {
$displayoptions = '<span class="pagemenu-selected">';
}
$displayoptions .= generate_link('Graphs', $link_array, ['metric'=> $active_metric, 'view' => 'graphs']);
$displayoptions .= generate_link('Graphs', $link_array, ['metric' => $active_metric, 'view' => 'graphs']);
if ($vars['view'] == 'graphs') {
$displayoptions .= '</span>';
@ -102,7 +102,7 @@ if ($vars['view'] != 'graphs') {
$displayoptions .= '<span class="pagemenu-selected">';
}
$displayoptions .= generate_link('No Graphs', $link_array, ['metric'=> $active_metric, 'view' => 'detail']);
$displayoptions .= generate_link('No Graphs', $link_array, ['metric' => $active_metric, 'view' => 'detail']);
if ($vars['view'] != 'graphs') {
$displayoptions .= '</span>';

View File

@ -42,7 +42,7 @@ foreach ($valid_wireless_types as $type => $details) {
$linkoptions .= '<span class="pagemenu-selected">';
}
$linkoptions .= generate_link(__("wireless.$type.short"), $link_array, ['metric'=> $type, 'view' => $vars['view']]);
$linkoptions .= generate_link(__("wireless.$type.short"), $link_array, ['metric' => $type, 'view' => $vars['view']]);
if ($class == $type) {
$linkoptions .= '</span>';
@ -56,7 +56,7 @@ $displayoptions = '';
if ($vars['view'] == 'graphs') {
$displayoptions .= '<span class="pagemenu-selected">';
}
$displayoptions .= generate_link('Graphs', $link_array, ['metric'=> $class, 'view' => 'graphs']);
$displayoptions .= generate_link('Graphs', $link_array, ['metric' => $class, 'view' => 'graphs']);
if ($vars['view'] == 'graphs') {
$displayoptions .= '</span>';
}
@ -67,7 +67,7 @@ if ($vars['view'] != 'graphs') {
$displayoptions .= '<span class="pagemenu-selected">';
}
$displayoptions .= generate_link('No Graphs', $link_array, ['metric'=> $class, 'view' => 'nographs']);
$displayoptions .= generate_link('No Graphs', $link_array, ['metric' => $class, 'view' => 'nographs']);
if ($vars['view'] != 'graphs') {
$displayoptions .= '</span>';

View File

@ -164,7 +164,7 @@ foreach (dbFetchRows($sql, $param) as $bill) {
'bill_type' => $type,
'bill_allowed' => $allowed,
'total_data_in' => $in,
'total_data_out'=> $out,
'total_data_out' => $out,
'total_data' => $total_data,
'rate_95th' => $rate_95th,
'used' => $used,

View File

@ -48,5 +48,5 @@ foreach (dbFetchRows($sql, $param) as $drive) {
'mempool_perc_warn' => $perc_warn, ];
}
$output = ['current'=>$current, 'rowCount'=>$rowCount, 'rows'=>$response, 'total'=>$total];
$output = ['current' => $current, 'rowCount' => $rowCount, 'rows' => $response, 'total' => $total];
echo json_encode($output, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);

View File

@ -48,5 +48,5 @@ foreach (dbFetchRows($sql, $param) as $drive) {
'processor_perc_warn' => $perc_warn, ];
}
$output = ['current'=>$current, 'rowCount'=>$rowCount, 'rows'=>$response, 'total'=>$total];
$output = ['current' => $current, 'rowCount' => $rowCount, 'rows' => $response, 'total' => $total];
echo json_encode($output, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);

View File

@ -57,5 +57,5 @@ foreach (dbFetchRows($sql, $param) as $routing) {
'bgpPeerDescr' => $routing['bgpPeerDescr'], ];
}
$output = ['current'=>$current, 'rowCount'=>$rowCount, 'rows'=>$response, 'total'=>$total];
$output = ['current' => $current, 'rowCount' => $rowCount, 'rows' => $response, 'total' => $total];
echo json_encode($output, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);

View File

@ -52,5 +52,5 @@ foreach (dbFetchRows($sql, $param) as $drive) {
];
}
$output = ['current'=>$current, 'rowCount'=>$rowCount, 'rows'=>$response, 'total'=>$total];
$output = ['current' => $current, 'rowCount' => $rowCount, 'rows' => $response, 'total' => $total];
echo json_encode($output, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);

View File

@ -672,7 +672,7 @@ $fields = [
'txt' => $nottxt,
'uri' => $noturi,
'dname' => $notdname,
'nxdomain'=> $notnxdomain,
'nxdomain' => $notnxdomain,
'axfr' => $notaxfr,
'ixfr' => $notixfr,
'opt' => $notopt,

View File

@ -28,7 +28,7 @@ $set_rrd_def = RrdDefinition::make()
->addDataset('min_size', 'GAUGE')
->addDataset('size', 'GAUGE');
$app_data = ['sets'=>[], 'no_minus_d'=>$data['no_minus_d']];
$app_data = ['sets' => [], 'no_minus_d' => $data['no_minus_d']];
$rrd_name = ['app', $name, $app->app_id];
$fields = [

View File

@ -72,7 +72,7 @@ $fields = [
'senders' => $senders,
'sendinghd' => $sendinghd,
'recipients' => $recipients,
'recipienthd'=> $recipienthd,
'recipienthd' => $recipienthd,
'deferralcr' => $deferralcr,
'deferralhid' => $deferralhid,
'chr' => $chr,

View File

@ -19,7 +19,7 @@ try {
}
// grab the alert here as it is the global one
$metrics = ['alert'=>$sagan['alert']];
$metrics = ['alert' => $sagan['alert']];
$rrd_def = RrdDefinition::make()
->addDataset('after', 'GAUGE', 0)

View File

@ -14,7 +14,7 @@ try {
}
// grab the alert here as it is the global one
$metrics = ['alert'=>$suricata['alert']];
$metrics = ['alert' => $suricata['alert']];
$rrd_def = RrdDefinition::make()
->addDataset('af_dcerpc_tcp', 'DERIVE', 0)

View File

@ -12,7 +12,7 @@
*/
$component = new LibreNMS\Component();
$components = $component->getComponents($device['device_id'], ['type'=>'Cisco-CIMC']);
$components = $component->getComponents($device['device_id'], ['type' => 'Cisco-CIMC']);
// We only care about our device id.
$components = $components[$device['device_id']];

View File

@ -1,6 +1,6 @@
<?php
$int_desc = snmpwalk_group($device, 'ifMainDesc', 'ARICENT-CFA-MIB');
foreach ($port_stats as $index=>$port) {
foreach ($port_stats as $index => $port) {
$port_stats[$index]['ifAlias'] = $int_desc[$index]['ifMainDesc'];
}

View File

@ -47,7 +47,7 @@ $required = [
// Media Types as per PACKETLOGIC-CHANNEL-MIB
$mediaType = [
0 => ['ifDuplex' => null, 'ifSpeed' => 0, 'label'=> 'linkdown'],
0 => ['ifDuplex' => null, 'ifSpeed' => 0, 'label' => 'linkdown'],
1 => ['ifDuplex' => 'halfDuplex', 'ifSpeed' => '10000000', 'label' => 'hd10'],
2 => ['ifDuplex' => 'fullDuplex', 'ifSpeed' => '10000000', 'label' => 'fd10'],
3 => ['ifDuplex' => 'halfDuplex', 'ifSpeed' => '100000000', 'label' => 'hd100'],

View File

@ -297,7 +297,7 @@ function parse_entity_state($state, $value)
return $data[$state][$value];
}
return ['text'=>'na', 'color'=>'default'];
return ['text' => 'na', 'color' => 'default'];
}
function parse_entity_state_alarm($bits)

View File

@ -320,7 +320,7 @@ function check_service($command)
}
// We have a DS. Add an entry to the array.
d_echo('Perf Data - DS: ' . $ds . ', Value: ' . $value . ', UOM: ' . $uom . "\n");
$metrics[$ds] = ['value'=>$value, 'uom'=>$uom];
$metrics[$ds] = ['value' => $value, 'uom' => $uom];
} else {
// No DS. Don't add an entry to the array.
d_echo("Perf Data - None.\n");

View File

@ -816,6 +816,7 @@ function removeComments(&$output)
}
}
}
/* transfer the new array back to the original array */
return $new_array;
}

View File

@ -46,7 +46,7 @@ class BasicApiTest extends DBTestCase
->assertJson([
'status' => 'ok',
'devices' => [$device->toArray()],
'count'=> 1,
'count' => 1,
]);
}
}

View File

@ -72,74 +72,74 @@ class SyslogTest extends TestCase
// ---- IOS ----
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-02-28 00:23:34||%CARD-SEVERITY-MSG:SLOT %FACILITY-SEVERITY-MNEMONIC: Message-text||',
['device_id'=>1, 'program'=>'%CARD-SEVERITY-MSG:SLOT %FACILITY-SEVERITY-MNEMONIC', 'msg'=>'Message-text']
['device_id' => 1, 'program' => '%CARD-SEVERITY-MSG:SLOT %FACILITY-SEVERITY-MNEMONIC', 'msg' => 'Message-text']
);
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-02-28 00:23:34||%FACILITY-SUBFACILITY-SEVERITY-MNEMONIC: Message-text||',
['device_id'=>1, 'program'=>'%FACILITY-SUBFACILITY-SEVERITY-MNEMONIC', 'msg'=>'Message-text']
['device_id' => 1, 'program' => '%FACILITY-SUBFACILITY-SEVERITY-MNEMONIC', 'msg' => 'Message-text']
);
$this->checkSyslog(
'1.1.1.1||local7||info||info||be||2016-03-09 03:58:25||Mar 9 11:58:24.145 UTC: %SEC-6-IPACCESSLOGS: list MNGMNT denied 120.62.186.12 1 packet ||]',
['device_id'=>1, 'program'=>'%SEC-6-IPACCESSLOGS', 'msg'=>'list MNGMNT denied 120.62.186.12 1 packet']
['device_id' => 1, 'program' => '%SEC-6-IPACCESSLOGS', 'msg' => 'list MNGMNT denied 120.62.186.12 1 packet']
);
$this->checkSyslog(
'1.1.1.1||local7||info||info||be||2016-04-27 021:12:28||Apr 27 21:12:28: %SYS-5-CONFIG_I: Configured from console by vty0||',
['device_id'=>1, 'program'=>'%SYS-5-CONFIG_I', 'msg'=>'Configured from console by vty0']
['device_id' => 1, 'program' => '%SYS-5-CONFIG_I', 'msg' => 'Configured from console by vty0']
);
$this->checkSyslog(
'1.1.1.1||local7||info||info||be||2016-04-27 021:12:28||Mar 8 20:14:08.762: %FACILITY-SUBFACILITY-SEVERITY-MNEMONIC: Message-text||000956',
['device_id'=>1, 'program'=>'%FACILITY-SUBFACILITY-SEVERITY-MNEMONIC', 'msg'=>'Message-text']
['device_id' => 1, 'program' => '%FACILITY-SUBFACILITY-SEVERITY-MNEMONIC', 'msg' => 'Message-text']
);
// ---- CatOS ----
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-02-28 00:23:34||%IP-3-UDP_SOCKOVFL:UDP socket overflow||',
['device_id'=>1, 'program'=>'%IP-3-UDP_SOCKOVFL', 'msg'=>'UDP socket overflow']
['device_id' => 1, 'program' => '%IP-3-UDP_SOCKOVFL', 'msg' => 'UDP socket overflow']
);
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-02-28 00:23:34||DTP-1-ILGLCFG: Illegal config (on, isl--on,dot1q) on Port [mod/port]||',
['device_id'=>1, 'program'=>'DTP-1-ILGLCFG', 'msg'=>'Illegal config (on, isl--on,dot1q) on Port [mod/port]']
['device_id' => 1, 'program' => 'DTP-1-ILGLCFG', 'msg' => 'Illegal config (on, isl--on,dot1q) on Port [mod/port]']
);
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-02-28 00:23:34||Cannot enable text mode config if ACL config is cleared from nvram||',
['device_id'=>1, 'program'=>'', 'msg'=>'Cannot enable text mode config if ACL config is cleared from nvram']
['device_id' => 1, 'program' => '', 'msg' => 'Cannot enable text mode config if ACL config is cleared from nvram']
);
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-02-28 00:23:34||%PAGP-5-PORTFROMSTP / %PAGP-5-PORTTOSTP||',
['device_id'=>1, 'program'=>'%PAGP-5-PORTFROMSTP / %PAGP-5-PORTTOSTP']
['device_id' => 1, 'program' => '%PAGP-5-PORTFROMSTP / %PAGP-5-PORTTOSTP']
);
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-02-28 00:23:34||%SYS-3-EOBC_CHANNELREINIT||',
['device_id'=>1, 'program'=>'%SYS-3-EOBC_CHANNELREINIT']
['device_id' => 1, 'program' => '%SYS-3-EOBC_CHANNELREINIT']
);
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-02-28 00:23:34||%SYS-4-MODHPRESET:||',
['device_id'=>1, 'program'=>'%SYS-4-MODHPRESET', 'msg'=>'']
['device_id' => 1, 'program' => '%SYS-4-MODHPRESET', 'msg' => '']
);
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-02-28 00:23:34||InbandPingProcessFailure:Module x not responding over inband||',
['device_id'=>1, 'program'=>'INBANDPINGPROCESSFAILURE', 'msg'=>'Module x not responding over inband']
['device_id' => 1, 'program' => 'INBANDPINGPROCESSFAILURE', 'msg' => 'Module x not responding over inband']
);
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-02-28 00:23:34||RxSBIF_SEQ_NUM_ERROR:slot=x||',
['device_id'=>1, 'program'=>'RXSBIF_SEQ_NUM_ERROR', 'msg'=>'slot=x']
['device_id' => 1, 'program' => 'RXSBIF_SEQ_NUM_ERROR', 'msg' => 'slot=x']
);
// With program from syslog
$this->checkSyslog(
'1.1.1.1||local7||notice||notice||bd||2016-04-04 15:18:43||Apr 4 13:18:42.670: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/32, changed state to up||345735',
['device_id'=>1, 'program'=>'%LINEPROTO-5-UPDOWN', 'msg'=>'Line protocol on Interface GigabitEthernet0/32, changed state to up']
['device_id' => 1, 'program' => '%LINEPROTO-5-UPDOWN', 'msg' => 'Line protocol on Interface GigabitEthernet0/32, changed state to up']
);
// Incorrect time
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-04-06 15:20:35||*Apr 4 21:26:41.778 UTC: %LWAPP-3-REPLAY_ERR: 1 wcm: Received replay error on slot 1, WLAN ID 1, count 1 from AP xxxx.xxxx.xxxx||',
['device_id'=>1, 'program'=>'%LWAPP-3-REPLAY_ERR', 'msg'=>'1 wcm: Received replay error on slot 1, WLAN ID 1, count 1 from AP xxxx.xxxx.xxxx']
['device_id' => 1, 'program' => '%LWAPP-3-REPLAY_ERR', 'msg' => '1 wcm: Received replay error on slot 1, WLAN ID 1, count 1 from AP xxxx.xxxx.xxxx']
);
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-04-06 15:20:35||.Apr 4 21:26:41.778 UTC: %LWAPP-3-REPLAY_ERR: 1 wcm: Received replay error on slot 1, WLAN ID 1, count 1 from AP xxxx.xxxx.xxxx||',
['device_id'=>1, 'program'=>'%LWAPP-3-REPLAY_ERR', 'msg'=>'1 wcm: Received replay error on slot 1, WLAN ID 1, count 1 from AP xxxx.xxxx.xxxx']
['device_id' => 1, 'program' => '%LWAPP-3-REPLAY_ERR', 'msg' => '1 wcm: Received replay error on slot 1, WLAN ID 1, count 1 from AP xxxx.xxxx.xxxx']
);
}
@ -152,45 +152,45 @@ class SyslogTest extends TestCase
// ---- PAM ----
$this->checkSyslog(
'1.1.1.1||authpriv||info||info||56||2016-02-28 00:23:34||pam_unix(cron:session): session opened for user librenms by (uid=0)||CRON',
['device_id'=>1, 'program'=>'CRON', 'msg'=>'pam_unix(cron:session): session opened for user librenms by (uid=0)']
['device_id' => 1, 'program' => 'CRON', 'msg' => 'pam_unix(cron:session): session opened for user librenms by (uid=0)']
);
$this->checkSyslog(
'1.1.1.1||authpriv||info||info||55||2016-02-28 00:23:34||pam_unix(sudo:session): session opened for user librenms by root (uid=0)||sudo',
['device_id'=>1, 'program'=>'SUDO', 'msg'=>'pam_unix(sudo:session): session opened for user librenms by root (uid=0)']
['device_id' => 1, 'program' => 'SUDO', 'msg' => 'pam_unix(sudo:session): session opened for user librenms by root (uid=0)']
);
$this->checkSyslog(
'1.1.1.1||auth||info||info||0e||2016-02-28 00:23:34||pam_krb5(sshd:auth): authentication failure; logname=root uid=0 euid=0 tty=ssh ruser= rhost=123.213.132.231||sshd',
['device_id'=>1, 'program'=>'SSHD', 'msg'=>'pam_krb5(sshd:auth): authentication failure; logname=root uid=0 euid=0 tty=ssh ruser= rhost=123.213.132.231']
['device_id' => 1, 'program' => 'SSHD', 'msg' => 'pam_krb5(sshd:auth): authentication failure; logname=root uid=0 euid=0 tty=ssh ruser= rhost=123.213.132.231']
);
$this->checkSyslog(
'1.1.1.1||auth||info||info||0e||2016-02-28 00:23:34||pam_krb5[sshd:auth]: authentication failure; logname=root uid=0 euid=0 tty=ssh ruser= rhost=123.213.132.231||sshd',
['device_id'=>1, 'program'=>'SSHD', 'msg'=>'pam_krb5[sshd:auth]: authentication failure; logname=root uid=0 euid=0 tty=ssh ruser= rhost=123.213.132.231']
['device_id' => 1, 'program' => 'SSHD', 'msg' => 'pam_krb5[sshd:auth]: authentication failure; logname=root uid=0 euid=0 tty=ssh ruser= rhost=123.213.132.231']
);
// ---- Postfix ----
$this->checkSyslog(
'1.1.1.1||mail||info||info||16||2016-02-28 00:23:34||5C62E329EF: to=<admin@example.com>, relay=mail.example.com[127.0.0.1]:25, delay=0.11, delays=0.04/0.01/0/0.06, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 5362E6A670E)||postfix/smtp',
['device_id'=>1, 'program'=>'POSTFIX/SMTP', 'msg'=>'5C62E329EF: to=<admin@example.com>, relay=mail.example.com[127.0.0.1]:25, delay=0.11, delays=0.04/0.01/0/0.06, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 5362E6A670E)']
['device_id' => 1, 'program' => 'POSTFIX/SMTP', 'msg' => '5C62E329EF: to=<admin@example.com>, relay=mail.example.com[127.0.0.1]:25, delay=0.11, delays=0.04/0.01/0/0.06, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 5362E6A670E)']
);
$this->checkSyslog(
'1.1.1.1||mail||info||info||16||2016-02-28 00:23:34||D7256400EF: from=<librenms@librenms.example.com>, size=882, nrcpt=1 (queue active)||postfix/qmgr',
['device_id'=>1, 'program'=>'POSTFIX/QMGR', 'msg'=>'D7256400EF: from=<librenms@librenms.example.com>, size=882, nrcpt=1 (queue active)']
['device_id' => 1, 'program' => 'POSTFIX/QMGR', 'msg' => 'D7256400EF: from=<librenms@librenms.example.com>, size=882, nrcpt=1 (queue active)']
);
// ---- No program ----
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-02-28 00:23:34||some random message||',
['device_id'=>1, 'program'=>'USER', 'msg'=>'some random message']
['device_id' => 1, 'program' => 'USER', 'msg' => 'some random message']
);
// ---- Other ----
$this->checkSyslog(
'1.1.1.1||cron||info||info||4e||2016-02-28 00:23:34||(librenms) CMD ( /opt/librenms/alerts.php >> /var/log/librenms_alert.log 2>&1)||CRON',
['device_id'=>1, 'program'=>'CRON', 'msg'=>'(librenms) CMD ( /opt/librenms/alerts.php >> /var/log/librenms_alert.log 2>&1)']
['device_id' => 1, 'program' => 'CRON', 'msg' => '(librenms) CMD ( /opt/librenms/alerts.php >> /var/log/librenms_alert.log 2>&1)']
);
$this->checkSyslog(
'1.1.1.1||authpriv||notice||notice||55||2016-02-28 00:23:34|| root : TTY=pts/1 ; PWD=/opt/librenms ; USER=librenms ; COMMAND=/usr/bin/git status||sudo',
['device_id'=>1, 'program'=>'SUDO', 'msg'=>'root : TTY=pts/1 ; PWD=/opt/librenms ; USER=librenms ; COMMAND=/usr/bin/git status']
['device_id' => 1, 'program' => 'SUDO', 'msg' => 'root : TTY=pts/1 ; PWD=/opt/librenms ; USER=librenms ; COMMAND=/usr/bin/git status']
);
}
@ -203,29 +203,29 @@ class SyslogTest extends TestCase
// ---- 2900/2910/3800/5400 ----
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-02-28 00:23:34||chassis: Slot A Ready||00422',
['device_id'=>1, 'program'=>'CHASSIS', 'msg'=>'Slot A Ready [00422]']
['device_id' => 1, 'program' => 'CHASSIS', 'msg' => 'Slot A Ready [00422]']
);
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-02-28 00:23:34||ports: port 21 is now on-line||00076',
['device_id'=>1, 'program'=>'PORTS', 'msg'=>'port 21 is now on-line [00076]']
['device_id' => 1, 'program' => 'PORTS', 'msg' => 'port 21 is now on-line [00076]']
);
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-02-28 00:23:34||ports: port 21 is now off-line||00077',
['device_id'=>1, 'program'=>'PORTS', 'msg'=>'port 21 is now off-line [00077]']
['device_id' => 1, 'program' => 'PORTS', 'msg' => 'port 21 is now off-line [00077]']
);
$this->checkSyslog(
'1.1.1.1||user||warning||warning||0c||2016-02-28 00:23:34||FFI: port 21-High collision or drop rate. See help.||00331',
['device_id'=>1, 'program'=>'FFI', 'msg'=>'port 21-High collision or drop rate. See help. [00331]']
['device_id' => 1, 'program' => 'FFI', 'msg' => 'port 21-High collision or drop rate. See help. [00331]']
);
// ---- 2610 ----
$this->checkSyslog(
'1.1.1.1||user||warning||warning||0c||2016-02-28 00:23:34||port 21-Excessive undersized/giant packets. See help.||FFI',
['device_id'=>1, 'program'=>'FFI', 'msg'=>'port 21-Excessive undersized/giant packets. See help.']
['device_id' => 1, 'program' => 'FFI', 'msg' => 'port 21-Excessive undersized/giant packets. See help.']
);
$this->checkSyslog(
'1.1.1.1||user||info||info||0e||2016-02-28 00:23:34||updated time by -4 seconds||SNTP',
['device_id'=>1, 'program'=>'SNTP', 'msg'=>'updated time by -4 seconds']
['device_id' => 1, 'program' => 'SNTP', 'msg' => 'updated time by -4 seconds']
);
}
@ -238,7 +238,7 @@ class SyslogTest extends TestCase
// ---- USG60W ----
$this->checkSyslog(
'1.1.1.1||local1||info||info||8e||2017-06-14 17:51:25||0" dst="0.0.0.0:0" msg="DHCP server assigned 195.159.132.109 to Chromecast(6C:AD:F8:B1:10:1D)" note="DHCP ACK" user="unknown" devID="a0e4cb7d7f52" cat="DHCP"||src="0.0.0.0',
['device_id'=>1, 'program'=>'DHCP', 'msg'=>'src="0.0.0.0:0" dst="0.0.0.0:0" msg="DHCP server assigned 195.159.132.109 to Chromecast(6C:AD:F8:B1:10:1D)" note="DHCP ACK" user="unknown" devID="a0e4cb7d7f52" cat="DHCP"']
['device_id' => 1, 'program' => 'DHCP', 'msg' => 'src="0.0.0.0:0" dst="0.0.0.0:0" msg="DHCP server assigned 195.159.132.109 to Chromecast(6C:AD:F8:B1:10:1D)" note="DHCP ACK" user="unknown" devID="a0e4cb7d7f52" cat="DHCP"']
);
}
}