ileonard
Goto Top

Pfblocker in telegraf und Grafana

Hallo zusammen,
ich habe in Grafana folgendes Dashboard laufen: https://grafana.com/grafana/dashboards/12023 ich nehme das zum monitoring meiner Pfsense Firewall, ich habe mir dazu das telegraf package installiert welches die Daten dann auf meinen InfluxDB Server schickt, von dem wird dann auch das grafana Dashboard bedient, soweit so gut, das läuft.
Ich nutze in pfsense auch den pfblocker, allerdings werden mir von dem in grafana keine infos angeziegt, wie man auch im Bild erkennen kann. Ich habe dann mal geschaut was das sein kann und habe folgendes gefunden: https://gist.github.com/Tokugero/f013c0a97dc1982074b94d05b7bb8d1e

habe dann den Telegrgraf geupdated wie in der obigen anleitung und wie in step vier den config editor über winscp geupdated und das hier eigefügt:

[[inputs.logparser]]
  files = ["/var/log/pfblockerng/dnsbl.log"]  
  from_beginning=true
  [inputs.logparser.grok]
    measurement = "dnsbl_log"  
    patterns = ["^%{WORD:BlockType}-%{WORD:BlockSubType},%{SYSLOGTIMESTAMP:timestamp:ts-syslog},%{IPORHOST:destination:tag},%{IPORHOST:source:tag},%{GREEDYDATA:call},%{WORD:BlockMethod},%{WORD:BlockList},%{IPORHOST:tld:tag},%{WORD:DefinedList:tag},%{GREEDYDATA:hitormiss}"]  
    timezone = "Local"  
    [inputs.logparser.tags]
      value = "1"  

das configeditor file telegraf sieht bei mir nun so aus, habe einfach mal den relevaten ausschnitt reingetan, falls ihr mehr sehen möchtet gerne :)

	}

	if (empty($telegraf_conf['interval'])) {  
		$telegraf_conf['interval'] = 10;  
	}

	$shortname = '';  
	if ($telegraf_conf['shortname'] == 'on') {  
		$shortname = "\thostname = \"" . $config['system']['hostname'] . "\"";  
	}

	$ca_pem_file = "/usr/local/etc/telegraf.ca";  
	$a_ca = $config['ca'];  
	if (!is_array($a_ca)) {
		$a_ca=array();
	}
	if (count($a_ca)) {
		$ca_pem = '';  
		foreach ($a_ca as $ca) {
			$ca_pem .= base64_decode($ca['crt']) . "\n";  
		}
		file_put_contents($ca_pem_file, $ca_pem);
	}

	/* generate telegraf.conf */
	$cfg = <<< EOD
# This file is automatically generated by pfSense #
[agent]
	interval = "{$telegraf_conf['interval']}s"  
	round_interval = true
{$shortname}

[[inputs.cpu]]
	percpu = true
	totalcpu = true
	fielddrop = ["time_*"]  

[[inputs.disk]]
	ignore_fs = ["tmpfs", "devtmpfs"]  

[[inputs.diskio]]

[[inputs.kernel]]

[[inputs.mem]]

[[inputs.net]]

[[inputs.processes]]

[[inputs.swap]]

[[inputs.system]]

[[inputs.pf]]

[[inputs.logparser]]
  files = ["/var/log/pfblockerng/dnsbl.log"]  
  from_beginning=true
  [inputs.logparser.grok]
    measurement = "dnsbl_log"  
    patterns = ["^%{WORD:BlockType}-%{WORD:BlockSubType},%{SYSLOGTIMESTAMP:timestamp:ts-syslog},%{IPORHOST:destination:tag},%{IPORHOST:source:tag},%{GREEDYDATA:call},%{WORD:BlockMethod},%{WORD:BlockList},%{IPORHOST:tld:tag},%{WORD:DefinedList:tag},%{GREEDYDATA:hitormiss}"]  
    timezone = "Local"  
    [inputs.logparser.tags]
      value = "1"  

EOD;

	/* HAProxy Monitor Configuration */
	if ($telegraf_conf["haproxy_enable"]) {  

kann mir hier jemand weiterhelfen?

Grüße Leonard
screenshot 2021-08-01 at 18-01-38 pfsense system dashboard - grafana

Content-Key: 1111741424

Url: https://administrator.de/contentid/1111741424

Printed on: April 26, 2024 at 06:04 o'clock

Member: ILeonard
ILeonard Aug 02, 2021 at 11:43:44 (UTC)
Goto Top
Hat niemand eine Idee? 😅