Ad Widget

Collapse

Email notification after docker restart

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • I.Ts
    Junior Member
    • Feb 2022
    • 3

    #1

    Email notification after docker restart

    Hi guys,

    I have installed Zabbix 5.4 on Ubuntu 18. As clients I use the zabbixagent2.
    So that I can also monitor my docker containers I have imported the official template of Zabbix Docker Agent 2 https://git.zabbix.com/projects/ZBX/...Frelease%2F5.4
    Now everything works fine. But what doesn't work is that I get notified by email after my docker container restarts.
    Can anyone help me with this?

    P.S I am still inexperienced in Zabbix.

    Thanks in advance!

  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    So you want to get a notification about container restart? Is there a check for it? is there a trigger for it? is thee an action for it?
    from https://git.zabbix.com/projects/ZBX/...Frelease%2F5.4 I cannot see such trigger...

    I am not too familiar with all that docker stuff, but there seems to be an item "Container {#NAME}: Restart count" ... You could create trigger based on that (if increased then fire a trigger) and then work out the rest of it...

    Comment

    • I.Ts
      Junior Member
      • Feb 2022
      • 3

      #3
      Originally posted by cyber
      So you want to get a notification about container restart? Is there a check for it? is there a trigger for it? is thee an action for it?
      from https://git.zabbix.com/projects/ZBX/...Frelease%2F5.4 I cannot see such trigger...

      I am not too familiar with all that docker stuff, but there seems to be an item "Container {#NAME}: Restart count" ... You could create trigger based on that (if increased then fire a trigger) and then work out the rest of it...
      Hi. thank you for your answer and help.

      You are right, there is not a trigger.

      Can you give me an example of how the trigger should be set up?

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4807

        #4
        Without actually knowing, what that item returns .. Just guessing here

        Name: "Container {#NAME}: restarted"
        Expression: "abschange(/Docker by Zabbix agent 2/docker.container_info.restart_count["{#NAME}"])>0"

        maybe... But I have no experience with this template or containers...

        Comment

        Working...