Open siuwwong5 opened 4 years ago
[root@coshk3cvdv00294 zabbix_provisioner]# cat config.yaml # URL to the Status/Rules page rulesUrl: http://coshk3cvdv00294:9090/rules
# Polling interval in seconds rulesPollingInterval: 3600
# Full URL to your Zabbix API zabbixApiUrl: http://coszbxdev.iris.cl.sh.cos/api_jsonrpc.php
# If your Zabbix server use internal certificates, you can provide a CA bundle for your company (or leave it blank) zabbixApiCAFile:
# This can also be set via the environment variable ZABBIX_API_USER zabbixApiUser:
# This can also be set via the environment variable ZABBIX_API_PASSWORD zabbixApiPassword:
# Zabbix items key prefix, keys will be zabbixKeyPrefix.alertname zabbixKeyPrefix: prometheus
# List of host configuration zabbixHosts: # Name of the host in zabbix
I'm getting the same problem: the pod works fine with any errors, but no rules or items are loaded to zabbix.
cat /prometheus/alert.rules
The provisioner logs: time="2020-06-30T10:54:52Z" level=info msg="loading configuration at '/etc/provisioner/config.yaml'" time="2020-06-30T10:54:52Z" level=info msg="configuration loaded" time="2020-06-30T10:54:53Z" level=info msg="GetHostGroupsByState = State: Equal, Name: kubernetes" time="2020-06-30T10:54:53Z" level=info msg="GetHostGroupsByState = State: Equal, Name: prometheus" time="2020-06-30T10:54:53Z" level=info msg="GetHostByState = State: Equal, Name: PrometheusDev" time="2020-06-30T10:54:53Z" level=info msg="Updating host: PrometheusDev"
The used config file: apiVersion: v1 kind: ConfigMap metadata: name: alertmanager-zabbix-provisioner-config namespace: monitoring data: config.yaml: |+ rulesUrl: http://dev-prometheus.com/rules rulesPollingTime: 3600 zabbixApiUrl: http://dev-zabbix.com/zabbix/api_jsonrpc.php zabbixKeyPrefix: prometheus zabbixHosts:
Need your help Gael, pls.
The config file is idented.
after i start the provisioner, i found these logs. and cannot found item created. please help.
time="2020-04-21T07:25:10Z" level=info msg="loading configuration at '/etc/provisioner/config.yaml'" time="2020-04-21T07:25:10Z" level=info msg="configuration loaded" time="2020-04-21T07:25:10Z" level=info msg="GetHostGroupsByState = State: Equal, Name: prometheus" time="2020-04-21T07:25:10Z" level=info msg="GetHostByState = State: Equal, Name: prometheus" time="2020-04-21T07:25:10Z" level=info msg="Updating host: prometheus"
[root@coshk3cvdv00294 zabbix_provisioner]# cat ../alertmanager/data/alert.rules groups:
name: testing rules:
alert: ContainerKilled expr: sum(container_memory_rss{name=~".+"}) by (image, instance) < 1 for: 1s labels: severity: warning annotations: zabbix: "prometheus" summary: "Container killed (instance {{ $labels.image }})" description: "A container has disappeared\n VALUE = {{ $value }}\n LABELS: {{ $labels.image }}"
alert: InfluxdbDown expr: absent(container_last_seen{name='influxdb'}) for: 3m labels: severity: page annotations: zabbix: "prometheus" summary: "InfluxdbDown" description: "InfluxdbDown."
alert: GrafanaDown expr: absent(container_last_seen{name='grafana'}) for: 3m labels: severity: page annotations: zabbix: "prometheus" summary: "GrafanaDown" description: "GrafanaDown."
alert: CadvisorDown expr: up{job="cadvisor"} == 0 for: 10s labels: severity: page annotations: zabbix: "prometheus" summary: "Cadvisor Down (instance {{ $labels.instance }})" description: "A cadvisor has down\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"