forked from librenms/librenms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Suricata monitoring (librenms#13942)
* add poller * add a generic alert graph * add support for .total * add the initial work on the suricata app page * add applayer flow sources * more rrd work and add more fields * add a missing graph to the suricata page * add suricata to the apps page * all working now for suricata * add some suricata alert examples * all done with the php * update the application docs for Suricata * add another note about Suricata stats in the docs * add the test file * add the test JSON * remove a unneeded newline from the appication docs * correct the type uptime type * packets graph should by packets/sec * minor formatting cleanup * one more minor formatting cleanup * shot in the dark to see if something fixes the angry linter * fix snmpsim file * add metrics * add values to the metrics * add a missing comma to the json * add a missing line to snmprec and cleanup json a bit * a few more minor changes to see if this makes it happy... regened via scripts/json-app-tool.php * see if this will make it happy * add suricata to app discovery and hope that fixes it... take a shot in the dark as to why the linter errors strangely on two of the files * fix json * add a missing ] to the json * rename two graphs so it does not trigger one alert and add a missing metric * whoops, *_alertString is not a metric
- Loading branch information
Showing
20 changed files
with
2,402 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
$name = 'suricata'; | ||
$app_id = $app['app_id']; | ||
$unit_text = 'status'; | ||
$colours = 'psychedelic'; | ||
$dostack = 0; | ||
$printtotal = 0; | ||
$addarea = 0; | ||
$transparency = 15; | ||
|
||
if (isset($vars['instance'])) { | ||
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app['app_id'], $vars['instance']]); | ||
} else { | ||
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app['app_id']]); | ||
} | ||
|
||
$rrd_list = []; | ||
if (Rrd::checkRrdExists($rrd_filename)) { | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'Alert Status', | ||
'ds' => 'alert', | ||
]; | ||
} else { | ||
d_echo('RRD "' . $rrd_filename . '" not found'); | ||
} | ||
|
||
require 'includes/html/graphs/generic_multi_line.inc.php'; |
154 changes: 154 additions & 0 deletions
154
includes/html/graphs/application/suricata_app_flows.inc.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
<?php | ||
|
||
$name = 'suricata'; | ||
$app_id = $app['app_id']; | ||
$unit_text = 'flows/sec'; | ||
$colours = 'psychedelic'; | ||
$dostack = 0; | ||
$printtotal = 0; | ||
$addarea = 0; | ||
$transparency = 15; | ||
|
||
if (isset($vars['instance'])) { | ||
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app['app_id'], $vars['instance']]); | ||
} else { | ||
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app['app_id']]); | ||
} | ||
|
||
$rrd_list = []; | ||
if (Rrd::checkRrdExists($rrd_filename)) { | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'DCERPC TCP', | ||
'ds' => 'af_dcerpc_tcp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'DCERPC UDP', | ||
'ds' => 'af_dcerpc_udp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'DHCP', | ||
'ds' => 'af_dhcp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'DNS TCP', | ||
'ds' => 'af_dns_tcp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'DNS UDP', | ||
'ds' => 'af_dns_udp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'Failed TCP', | ||
'ds' => 'af_failed_tcp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'Failed UDP', | ||
'ds' => 'af_failed_udp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'FTP', | ||
'ds' => 'af_ftp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'FTP-DATA', | ||
'ds' => 'af_ftp_data', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'HTTP', | ||
'ds' => 'af_http', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'IKEv2', | ||
'ds' => 'af_ikev2', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'IMAP', | ||
'ds' => 'af_imap', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'Krb5 TCP', | ||
'ds' => 'af_krb5_tcp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'Krb5 UDP', | ||
'ds' => 'af_krb5_udp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'MQTT', | ||
'ds' => 'af_mqtt', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'NFS TCP', | ||
'ds' => 'af_nfs_tcp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'NFS UDP', | ||
'ds' => 'af_nfs_udp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'RDP', | ||
'ds' => 'af_rdp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'RFB', | ||
'ds' => 'af_rfb', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'SIP', | ||
'ds' => 'af_sip', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'SMB', | ||
'ds' => 'af_smb', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'SMTP', | ||
'ds' => 'af_smtp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'SNMP', | ||
'ds' => 'af_snmp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'ssh', | ||
'ds' => 'af_ssh', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'TFTP', | ||
'ds' => 'af_tftp', | ||
]; | ||
$rrd_list[] = [ | ||
'filename' => $rrd_filename, | ||
'descr' => 'TLS', | ||
'ds' => 'af_tls', | ||
]; | ||
} else { | ||
d_echo('RRD "' . $rrd_filename . '" not found'); | ||
} | ||
|
||
require 'includes/html/graphs/generic_multi_line.inc.php'; |
Oops, something went wrong.