Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zabbix_sender [8]: ERROR: [line 8] 'Key value' required #10

Closed
Rascree opened this issue Oct 28, 2023 · 28 comments
Closed

zabbix_sender [8]: ERROR: [line 8] 'Key value' required #10

Rascree opened this issue Oct 28, 2023 · 28 comments

Comments

@Rascree
Copy link

Rascree commented Oct 28, 2023

Hi!
I created the container on portainer for a qnap container station. I encountered the issue "zabbix_sender [8]: ERROR: [line 1] 'Hostname' required" which was already known. Since I used portainer to create the container end entered the ENV variables manuell, i have no idea where the compose.yml is stored. So i tried a different way to use a stack and directly copy&paste the content of the yml into the stack.
That seemed to work fine, but not i got the issue

zabbix_sender [8]: ERROR: [line 8] 'Key value' required

I'm not even sure what line 8 is, or what kind of key is requried. Maybe you have an idea.

Many thanks!

@pthoelken
Copy link
Owner

pthoelken commented Oct 29, 2023

Thanks for your report @Rascree - as I understand you correctly in a Portainer Environment it's doesn't run (your error comes up) and if you running these on your docker host like "docker-compose up" with your docker-compose.yml file it works well?

I need this informations to try to reproduce your case.

Maybe this help you to determine the file storage location of portainer stacks portainer/portainer#3522

@Rascree
Copy link
Author

Rascree commented Oct 29, 2023 via email

@pthoelken
Copy link
Owner

Deine Screenshots kann ich leider nicht sehen, da du vermutlich über eine E-Mail geantwortet hast.

Zu dem Problem, ich werde nächste Woche einmal versuchen das nachzustellen und dann schauen. Der Fehler selbst sagt vermutlich nur aus, dass ihm Variablen fehlen, bzw. die durch Portainer nicht sauber übergeben werden.

Ich schaue mir das kommende Woche an und melde mich dann direkt nochmal bei dir.

@pthoelken
Copy link
Owner

pthoelken commented Oct 29, 2023

Also ich erhalte keine Probleme, wenn ich folgendes mache:

  1. Öffne Portainer und wähle meine Dockerumgebung
  2. App Template > Custom Template
  3. Create Custom Template
  4. Webeditor > paste my docker-compose.yml file into it (from below for example)
  5. Create Template
  6. App Template > Custom Template > Choose my created template
  7. Deploy Stack
  8. Stacks > go to my deploed stack and check if the container is up and running

So in my caste after "deploy Stack" the container was up and running corrctly.

This was the docker-compose.yml which I use for:

version: '3.2'
services:
  fritzbox-zabbix-monitoring:
    image: pthoelken/fritzbox-zabbix-monitoring:latest
    restart: always
    environment:
      - ZABBIX_SERVER=192.168.178.X
      - FRITZBOX_HOSTNAME=fritz.box
      - FRITZBOX_IP=192.168.178.X
      - INTERVAL=30s
      - FRITZBOX_USER=zabbixmonitor
      - FRITZBOX_PASSWD=XXXXXXXXXXXXXXXXXXXX

What I see in your case is your hostname looks akward ... FRITZBOX_HOSTNAME must be the same in docker-compose as the same from Zabbix. The visiable name doesn't matter, but the hostname from zabbix host and from enviroment variables must be the same.

image

image

@Rascree
Copy link
Author

Rascree commented Oct 29, 2023 via email

@pthoelken
Copy link
Owner

Du musst erst auf der Zabbix Monitoring Seite den Host erstellen, welche so aussehen muss:

image

Es wird kein Interface benötigt, da hier mit einem Zabbix Sender im Container gearbeitet wird.

Dann erst den Container starten.

https://github.com/pthoelken/fritzbox-zabbix-monitoring/blob/main/templates/template_avm_fritzbox.xml - das Template funktioniert auf jeden Fall mit der Zabbix Version 7.

@Rascree
Copy link
Author

Rascree commented Oct 29, 2023 via email

@pthoelken
Copy link
Owner

Ja, das stimmt wohl. Ich arbeite derzeit mit den neuesten Alpha Versionen, da ich auch Module in Zabbix selbst entwickle. Daher verwende ich oftmals eine andere Version.

Aber das hochziehen auf eine neuere Zabbix Version ist nicht all zu tragisch. Viel verrät dir das Log, wenn Dienste nicht starten. Ich habe auch oftmals das Problem nach einem Update, dass ich den Service (systemctl restart zabbix-server etc...) zwei mal nach einander neustarten muss (ebenso die Datenbank) und anschließend hat sich alles gefangen. Gerade auch bei den Anzeigen, dass die Versionen nicht zueinander passen.

Aber probiere dich gerne aus und melde dich wieder, wenn es Schwierigkeiten gibt. Ich kann sonst die Tage auch gerne einmal ein Video von dem ganzen machen, wenn ich es zeitlich schaffe.

@Rascree
Copy link
Author

Rascree commented Nov 1, 2023 via email

@pthoelken
Copy link
Owner

Danke für deine Rückmeldung. Gehe mal bitte in die CLI deines laufenden Containers und führe das folgende aus:

php status.php

und poste das Ergebnis. Sensible Daten wie IP Adresse bitte verfälschen / schwärzen.

@Rascree
Copy link
Author

Rascree commented Nov 1, 2023 via email

@pthoelken
Copy link
Owner

Ist das bei dir aktiviert?
image

Sind die Einstellungen gesetzt?
image

@Rascree
Copy link
Author

Rascree commented Nov 1, 2023 via email

@Rascree
Copy link
Author

Rascree commented Nov 1, 2023 via email

@pthoelken
Copy link
Owner

Kannst du vielleicht hier in der Webseite antworten oder aber die vorherigen E-Mails bei einer Mail Antwort entfernen? Das macht das ganze hier sehr unübersichtlich.

Also verstehe ich richtig, es sieht genau so aus, wie bei mir auf den Bildern?

@Rascree
Copy link
Author

Rascree commented Nov 1, 2023

nicht 1:1, da ich für den zabbixmonitor den NAS und VPN nicht freigegeben habe. Ebenso Zugang aus dem Internet. Die Heimnetzfreigaben sind aber angehakt, d.h. Zugriff für Anwendungen und UPnP ist da.

@pthoelken
Copy link
Owner

Was für eine FritzBox hast du? Aktuell ergibt das für mich wenig sinn, dass einige Daten nicht sauber ankommen bei dir.

Also, dass du den Fehler hast, liegt daran, dass einige Daten nicht sauber abgerufen werden können. Wenn da etwas fehlt, kommen "komische" Fehlermeldungen im Zabbix-Sender. Also der Zabbix-Sender läuft korrekt, es liegt eher daran, dass die Fritte nicht korrekt die Daten in den Soap Client gibt.

@Rascree
Copy link
Author

Rascree commented Nov 1, 2023

Ich habe die Fritzbox 4040, 4060 und 7430. Ich habe es nacheinander über alle 3 boxen laufen lassen. Kontrolle über die Ereignismonitore, dass ich auch immer eine erfolgreiche Anmeldung hatte. Soweit passt das. Leider bekomme ich immernoch denselben Fehler bei allen Boxen. über "Key value"

@pthoelken
Copy link
Owner

Fungieren alle drei Fritzboxen als DSL Modem oder sind auch welche dabei, die nur als Switch / Access Point fungieren? Das würde erklären, wieso auf DSL (Layer1) teilweise keine Daten kommen, wenn dort nichts angeschlossen ist.

@Rascree
Copy link
Author

Rascree commented Nov 1, 2023

Es funktioniert keine davon als DSL Modem. Die sind alle nur als AP unterwegs.

@pthoelken
Copy link
Owner

Okay, dann werde ich vermutlich wissen woran es liegt. Gebe mir ein paar Tage zeit den Fehler zu beheben. Bin gerade noch an etwas anderem dran und die Zeit ist ein wenig eng aktuell :-D

@pthoelken
Copy link
Owner

pthoelken commented Nov 1, 2023

Teste es bitte nochmal @Rascree .

  1. Pull latest Image (docker-compose down && docker-compose pull - oder Portainer)
  2. Import latest Templates (delete the old template before from zabbix) from https://github.com/pthoelken/fritzbox-zabbix-monitoring/tree/9-fr-fetch-the-layer1-down-and-upstream/templates (I've added some new values)
  3. Added ENV ValueZABBIX_SENDER_DEBUG=Trueso your docker-compose.yml file (True if you want debug informations, false if you didn't want).

Wenn du das alles gemacht hast, gehe nochmal in den Container und führe php status.php aus und paste das Ergebnis hier.

@pthoelken pthoelken reopened this Nov 1, 2023
@Rascree
Copy link
Author

Rascree commented Nov 2, 2023

all done

/app # php status.php
fritz.box totalBytesSent 0
fritz.box totalBytesReceived 0
fritz.box layer1UpstreamMaxBitRate 0
fritz.box layer1DownstreamMaxBitRate 0
fritz.box physicalLinkStatus Up
fritz.box ipAddressFromRouter 192.168.11.135
fritz.box connectionStatus Unconfigured
fritz.box uptime 0
fritz.box externalIPAddress not configured (check ipAddressFromRouter value)
fritz.box softwareVersion 155.07.57
fritz.box associatedDeviceDiscovery {"data":[]}

Container log:
Response from "192.168.11.177:10051": "processed: 0; failed: 11; total: 11; seconds spent: 0.000098"
sent: 11; skipped: 0; total: 11

@pthoelken
Copy link
Owner

Das sieht doch schon mal gut aus.

Hast du ZABBIX_SENDER_DEBUG=True bei dir im docker-compose-File? Dann sollte man noch besser sehen, wieso es nicht gesendet wird.

Hast du das Template denn importiert?

@Rascree
Copy link
Author

Rascree commented Nov 2, 2023

Ja, hatte ich alles gemacht. Ich hatte noch vergessen das Template im Host selbst nochmal neu einzuspielen. Jetzt kommt was im zabbix an.

connectionStatus 17s Unconfigured   Application: status History  
  Fritz Box 4060 externalIPAddress 17s not configured (check ipAddressFromRouter value)   Application: status
  Fritz Box 4060 ipAddressFromRouter 17s 192.168.11.135    
  Fritz Box 4060 layer1DownstreamCurrentUtilization       Application: status
  Fritz Box 4060 layer1DownstreamMaxBitRate 17s 0 Bit   Application: status
  Fritz Box 4060 layer1UpstreamCurrentUtilization       Application: status
  Fritz Box 4060 layer1UpstreamMaxBitRate 17s 0 Bit   Application: status
  Fritz Box 4060 physicalLinkStatus 17s Up   Application: status
  Fritz Box 4060 softwareVersion 17s 155.07.57   Application: status
  Fritz Box 4060 totalBytesReceived 17s 0 Byte   Application: traffic
  Fritz Box 4060 totalBytesReceivedRate 16s 0 Byte/s   Application: traffic
  Fritz Box 4060 totalBytesSent 17s 0 Byte   Application: traffic
  Fritz Box 4060 totalBytesSentRate 14s 0 Byte/s   Application: traffic
  Fritz Box 4060 uptime 17s 0   Application: status

@pthoelken
Copy link
Owner

Das ist doch schön. Es ist aktuell noch normal, dass keine Werte bei "layer1UpstreamMaxBitRate" angezeigt werden. Hiermit würde ich den aktuellen Case erst einmal schließen.

@Rascree
Copy link
Author

Rascree commented Nov 2, 2023

prima. danke. ich nehme a für 3 boxen muss ich dann drei container bnutzen.

@pthoelken
Copy link
Owner

prima. danke. ich nehme a für 3 boxen muss ich dann drei container bnutzen.

Ja, genau. 3 Container und 3 Hosts in Zabbix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants