mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* breakout handling of suricata extend v. 1 returns * initial work for suricata 7.0.0 * add shared file for various Suricata related variables * update handling for new Suricata stuff * fix suricata rrd name bits * update suricata app page a bit * misc * add a new v2 suricata graph * more suricata v2 graphs * fix app data for suricata * more graph work * fix initial graphs * the page selector for suricata v2 * more cleanup for suricata stuff * add more graphs * add suricata_v2_pkt_drop.inc.php * add suricata_v2_error_delta.inc.php * add suricata app layer flows graph * add app layer tx * start work on bypassed * add flow bypass stuff * add suricata error stuff * add more graphs * more suricata v2 work * ... * add packets overview * cleanup suricata_packets_overview.inc.php * more work on the overview graphs * error delta is now per second * cleanup suricata_v2_app_layer_error_alloc.inc.php * add new flow proto stuff * add suricata_v2_flow_proto * add new overview graph * update v2 app layer flows graph * more v2 graph cleanup * suricata graph cleanup * suricata_dec_proto_overview now works * more graph work for suricata * more graph work * add another overview graph * snmp fix * add a new overview graph * add a new over view * more graph stuff * more memory graphs * tidy pages bit * more work on decoder stuff * more decoder work * decoder stuff done * cleanup suricata_packets_overview.inc.php * appl layer tx work * add app flow stuff * fix suricata_v2_decoder__event__ethernet.inc.php * fix suricata_v2_decoder__event__ipv4.inc.php * fix suricata_v2_decoder__event__ipv6.inc.php * add alloc error stuff * more error related work * more error stuff * start work on internal errors * add internal error graphs * parser error stuff done * more decoder work * decoder icmpv4 * more decoder work * ltnull done * mpls decoder stuff * nsh decoder work * decoder ppp done * more decoder work * more decoder work * more vlan work * vntag decoder stuff done * descr_len auto set for generic stats * ipv6 decoder stuff done * style fix * style fix * more style cleanup * more suricata graph work * fix require usage * tweak drop info a bit * add some checks for for with suricata 7.0.4 * more suricata tweaks * fix sagan instance handling * another minor fix * fix improper munging * rever something accidentally added to this repo * add linux_suricata-v2.snmprex * rename the metrics for instances from instance_ to instances_ * add linux_suricata-v2.json test data * style fix * minor munging tweak * style cleanup * some app data fixes * remove a typo from test data * add deleted_at and make sure discovered is numeric and not a string 1 * derp... json fix * remove something accidentally added * fix a small erorr in the test data * add a missing variable to the test data * try another tweak for suricata json test stuff * derp... fix a type in the suricata poller * revert a test data change * re-order some the metrics in the test * some more metric re-ordering * add a missing status * remove something that was accidentally added to this branch instead of another * strcmp cleanup * style fix
236 lines
13 KiB
PHP
236 lines
13 KiB
PHP
<?php
|
|
|
|
$name = 'suricata';
|
|
$unit_text = 'flows';
|
|
$colours = 'psychedelic';
|
|
$dostack = 0;
|
|
$printtotal = 0;
|
|
$addarea = 0;
|
|
$transparency = 15;
|
|
|
|
if (isset($vars['sinstance'])) {
|
|
$decoder__arp_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__arp']);
|
|
$decoder__chdlc_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__chdlc']);
|
|
$decoder__erspan_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__erspan']);
|
|
$decoder__esp_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__esp']);
|
|
$decoder__ethernet_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__ethernet']);
|
|
$decoder__geneve_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__geneve']);
|
|
$decoder__gre_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__gre']);
|
|
$decoder__icmpv4_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__icmpv4']);
|
|
$decoder__icmpv6_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__icmpv6']);
|
|
$decoder__ieee8021ah_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__ieee8021ah']);
|
|
$decoder__invalid_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__invalid']);
|
|
$decoder__ipv4_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__ipv4']);
|
|
$decoder__ipv6_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__ipv6']);
|
|
$decoder__ipv4_in_ipv6_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__ipv4_in_ipv6']);
|
|
$decoder__ipv6_in_ipv6_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__ipv6_in_ipv6']);
|
|
$decoder__mpls_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__mpls']);
|
|
$decoder__nsh_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__nsh']);
|
|
$decoder__null_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__null']);
|
|
$decoder__ppp_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__ppp']);
|
|
$decoder__pppoe_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__pppoe']);
|
|
$decoder__raw_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__raw']);
|
|
$decoder__sctp_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__sctp']);
|
|
$decoder__sll_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__sll']);
|
|
$decoder__tcp_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__tcp']);
|
|
$decoder__teredo_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__teredo']);
|
|
$decoder__too_many_layers_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__too_many_layers']);
|
|
$decoder__udp_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__udp']);
|
|
$decoder__vlan_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__vlan']);
|
|
$decoder__vlan_qinq_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__vlan_qinq']);
|
|
$decoder__vlan_qinqinq_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__vlan_qinqinq']);
|
|
$decoder__vntag_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__vntag']);
|
|
$decoder__vxlan_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'instance_' . $vars['sinstance'] . '___decoder__vxlan']);
|
|
} else {
|
|
$decoder__arp_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__arp']);
|
|
$decoder__chdlc_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__chdlc']);
|
|
$decoder__erspan_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__erspan']);
|
|
$decoder__esp_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__esp']);
|
|
$decoder__ethernet_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__ethernet']);
|
|
$decoder__geneve_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__geneve']);
|
|
$decoder__gre_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__gre']);
|
|
$decoder__icmpv4_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__icmpv4']);
|
|
$decoder__icmpv6_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__icmpv6']);
|
|
$decoder__ieee8021ah_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__ieee8021ah']);
|
|
$decoder__invalid_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__invalid']);
|
|
$decoder__ipv4_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__ipv4']);
|
|
$decoder__ipv6_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__ipv6']);
|
|
$decoder__ipv4_in_ipv6_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__ipv4_in_ipv6']);
|
|
$decoder__ipv6_in_ipv6_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__ipv6_in_ipv6']);
|
|
$decoder__mpls_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__mpls']);
|
|
$decoder__nsh_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__nsh']);
|
|
$decoder__null_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__null']);
|
|
$decoder__ppp_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__ppp']);
|
|
$decoder__pppoe_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__pppoe']);
|
|
$decoder__raw_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__raw']);
|
|
$decoder__sctp_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__sctp']);
|
|
$decoder__sll_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__sll']);
|
|
$decoder__tcp_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__tcp']);
|
|
$decoder__teredo_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__teredo']);
|
|
$decoder__too_many_layers_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__too_many_layers']);
|
|
$decoder__udp_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__udp']);
|
|
$decoder__vlan_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__vlan']);
|
|
$decoder__vlan_qinq_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__vlan_qinq']);
|
|
$decoder__vlan_qinqinq_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__vlan_qinqinq']);
|
|
$decoder__vntag_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__vntag']);
|
|
$decoder__vxlan_rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals___decoder__vxlan']);
|
|
}
|
|
|
|
$rrd_list = [];
|
|
if (Rrd::checkRrdExists($decoder__arp_rrd_filename)) {
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__arp_rrd_filename,
|
|
'descr' => 'ARP',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__chdlc_rrd_filename,
|
|
'descr' => 'CHDLC',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__erspan_rrd_filename,
|
|
'descr' => 'ERSPAN',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__esp_rrd_filename,
|
|
'descr' => 'ESP',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__ethernet_rrd_filename,
|
|
'descr' => 'Ethernet',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__geneve_rrd_filename,
|
|
'descr' => 'Geneve',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__gre_rrd_filename,
|
|
'descr' => 'GRE',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__icmpv4_rrd_filename,
|
|
'descr' => 'ICMPv4',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__icmpv6_rrd_filename,
|
|
'descr' => 'icmpv6',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__ieee8021ah_rrd_filename,
|
|
'descr' => 'IEEE 802.1ah',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__invalid_rrd_filename,
|
|
'descr' => 'Invalid',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__ipv4_rrd_filename,
|
|
'descr' => 'IPv4',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__ipv4_in_ipv6_rrd_filename,
|
|
'descr' => 'IPv4 in IPv6',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__ipv6_rrd_filename,
|
|
'descr' => 'IPv6',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__ipv6_in_ipv6_rrd_filename,
|
|
'descr' => 'IPv6 in IPv6',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__mpls_rrd_filename,
|
|
'descr' => 'MPLS',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__nsh_rrd_filename,
|
|
'descr' => 'NSH',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__null_rrd_filename,
|
|
'descr' => 'Null',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__ppp_rrd_filename,
|
|
'descr' => 'PPP',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__pppoe_rrd_filename,
|
|
'descr' => 'PPPoE',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__raw_rrd_filename,
|
|
'descr' => 'Raw',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__sctp_rrd_filename,
|
|
'descr' => 'SCTP',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__sll_rrd_filename,
|
|
'descr' => 'SLL',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__teredo_rrd_filename,
|
|
'descr' => 'Teredo',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__udp_rrd_filename,
|
|
'descr' => 'udp',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__vlan_rrd_filename,
|
|
'descr' => 'VLAN',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__vlan_qinq_rrd_filename,
|
|
'descr' => 'VLAN QinQ',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__vlan_qinqinq_rrd_filename,
|
|
'descr' => 'VLAN QinQinQ',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__vntag_rrd_filename,
|
|
'descr' => 'VN-Tag',
|
|
'ds' => 'data',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $decoder__vxlan_rrd_filename,
|
|
'descr' => 'VXLAN',
|
|
'ds' => 'data',
|
|
];
|
|
} else {
|
|
d_echo('RRD "' . $rrd_filename . '" not found');
|
|
}
|
|
|
|
require 'includes/html/graphs/generic_multi_line.inc.php';
|