Ad Widget

Collapse

Create Container uptime Check in Zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bigOconstant
    Junior Member
    • Sep 2021
    • 5

    #1

    Create Container uptime Check in Zabbix

    Hello Zabbix world,

    I have been tasked with creating a container uptime check in our zabbix instance. The idea is that some how zabbix will discover that a container has been running for> 90 Days and then an alert in zabbix will be created. That alert will signal a webhook to something called service now afterwords. I would like to do it like this,

    Write a golang service that calls the kubernetes api and then call a zabbix api. I have zabbix running locally in docker-compose so I can test this.

    Could anyone give me any pointers on how I can accomplish this?
  • Singularity
    Member
    • Aug 2020
    • 81

    #2
    zabbix-agent2 has native docker container monitoring template that extracts almost everything related to containers.
    Link to items the template collects : https://www.zabbix.com/integrations/docker

    You can then create a trigger to check the running time and if that exceeds 90, alert will be displayed.

    Comment

    • bigOconstant
      Junior Member
      • Sep 2021
      • 5

      #3
      We are using kubernetes which uses podman and not docker as it's container layer. So I think that one might not work.

      Comment

      • Singularity
        Member
        • Aug 2020
        • 81

        #4
        I didn't got the chance to do it but there are third party integrations that you can try out.

        Ofcourse the other thing is using the k8s api. I have used that. A script that will call k8s api to get container information ( in your case you might only get container running time ).
        This script will be used as a low level discovery which will automatically handle containers and data associated with it. And on that, you can create a trigger.
        To know and how to use LLD, here is the link : https://www.zabbix.com/documentation...evel_discovery

        If you want me to elaborate, please feel free to ask.

        Comment

        • bigOconstant
          Junior Member
          • Sep 2021
          • 5

          #5
          Originally posted by Singularity
          I didn't got the chance to do it but there are third party integrations that you can try out.

          Ofcourse the other thing is using the k8s api. I have used that. A script that will call k8s api to get container information ( in your case you might only get container running time ).
          This script will be used as a low level discovery which will automatically handle containers and data associated with it. And on that, you can create a trigger.
          To know and how to use LLD, here is the link : https://www.zabbix.com/documentation...evel_discovery

          If you want me to elaborate, please feel free to ask.


          So my current plan is to call the k8's api and send the information via a zabbix_sender. Singularity do you think that would be a good approach?

          Comment

          • Singularity
            Member
            • Aug 2020
            • 81

            #6
            Yes, zabbix_sender is a good approach.

            Comment

            Working...