Ad Widget

Collapse

How to know if zabbix server "booted" completely.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prefect
    Junior Member
    • Dec 2009
    • 8

    #1

    How to know if zabbix server "booted" completely.

    Hi everybody, thanks for your time!

    Situation: I assembled a VM using Zabbix Docker containers. I start a handful of them, one is the server. Now starting the zabbix service does not give me any idea, when it is finally up, i.e. when did it complete the deployment or update of the SQL data(-model) and is fully ready.
    Problem: if I just launch the containers in order and it is a first time boot, the gui falls over, because it does not find its data.
    Workaround: I introduced a 90sec delay after starting the server. Now this is a rather crude work-around, wasting a lot of time, when developing my VM on.

    I'd love to have some condition that hints me on "server is ready". I have a few guesses, but I do not know how to test this ... reliably:

    - a line in a log-file, which log would it be and which line?
    - does zabbix open the 10051 (or whatever is configured) only *after* setting the model, then I could wait for this?!
    - anything

    Your hint would help me optimising the playbook.

    Thanks in advance!
  • gofree
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2017
    • 400

    #2
    Hi

    try "docker log" when starting the container to see whats going on

    https://docs.docker.com/engine/refer...mandline/logs/


    Code:
    docker logs -f CONTAINER
    not sure about your setup of DB - once schema has been established ( schema is imported ) its not imported again on new start - so I guess you should have some kind of persistent storage for DB and only the mysql process is running in container , if its not persistent its kinda "worthless" because you might loose the data ( eg. whole zabbix configuration is istored in DB )

    once the DB is present generally and available web frontend or zabbix server dont care when they connect to it , also when the db starts later they will manage connect to it - I suspect you have the DB recreated every time you start container (?)

    furthemore depends on your configuration you can check if your zabbix server is alive by checking the port - depends how you configured your docker container ( how ports are exposed ) for zabbix server - default is 10051 > telnet IP 10051



    to check the zabbix server itself:

    1. if the zabbix server looses connection to DB it sends emails to Zabbix admins ( so if docker container will not be able to reach DB you'll now as the DB needs to be persistent )
    2. you can monitor the port 10051( or any other ) indication that the server is running ( can be done via zabbix agent on the VM level ) or you'll see it in webfrontend or play with https://scoutapm.com/blog/how-to-use-docker-healthcheck

    Comment

    Working...