Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- discovery.file "integrations_snmp" {
- files = ["/etc/snmp.json"]
- }
- prometheus.exporter.snmp "integrations_snmp" {
- config_file = "/etc/snmp.yml"
- targets = discovery.file.integrations_snmp.targets
- }
- discovery.relabel "integrations_snmp" {
- targets = prometheus.exporter.snmp.integrations_snmp.targets
- rule {
- source_labels = ["job"]
- regex = "(^.*snmp)\\/(.*)"
- target_label = "job_snmp"
- }
- rule {
- source_labels = ["job"]
- regex = "(^.*snmp)\\/(.*)"
- target_label = "snmp_target"
- replacement = "$2"
- }
- rule {
- source_labels = ["instance"]
- target_label = "instance"
- replacement = "cisco_snmp_agent"
- }
- }
- prometheus.scrape "integrations_snmp" {
- scrape_timeout = "30s"
- targets = discovery.relabel.integrations_snmp.output
- forward_to = [prometheus.remote_write.integrations_snmp.receiver]
- job_name = "integrations/snmp"
- clustering {
- enabled = true
- }
- }
- prometheus.remote_write "integrations_snmp" {
- endpoint {
- url = "https://192.168.61.61/api/v1/push"
- queue_config { }
- metadata_config { }
- }
- }
- discovery.relabel "syslog" {
- targets = []
- rule {
- source_labels = ["__syslog_message_hostname"]
- target_label = "host"
- }
- rule {
- source_labels = ["__syslog_message_hostname"]
- target_label = "hostname"
- }
- rule {
- source_labels = ["__syslog_message_severity"]
- target_label = "level"
- }
- rule {
- source_labels = ["__syslog_message_app_name"]
- target_label = "application"
- }
- rule {
- source_labels = ["__syslog_message_facility"]
- target_label = "facility"
- }
- rule {
- source_labels = ["__syslog_connection_hostname"]
- target_label = "connection_hostname"
- }
- }
- loki.source.syslog "syslog" {
- listener {
- address = "0.0.0.0:601"
- protocol = "tcp"
- idle_timeout = "0s"
- use_rfc5424_message = true
- labels = { job = "syslog", component = "loki.source.syslog", protocol = "tcp" }
- max_message_length = 0
- }
- listener {
- address = "0.0.0.0:51893"
- protocol = "tcp"
- idle_timeout = "0s"
- use_rfc5424_message = true
- labels = { job = "syslog", component = "loki.source.syslog", protocol = "tcp" }
- max_message_length = 0
- }
- forward_to = [loki.write.syslog.receiver]
- relabel_rules = discovery.relabel.syslog.rules
- }
- loki.write "syslog" {
- endpoint {
- url = "http://192.168.61.61:3100/loki/api/v1/push"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement