Ad Widget

Collapse

Need to remove / delete terminated AWS EC2 instances

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mellis
    Senior Member
    • Oct 2017
    • 145

    #1

    Need to remove / delete terminated AWS EC2 instances

    We are starting to deploy our software solutions for customers in the AWS cloud. Of course our developers are going to take advantage of the auto-scaling which leads to the auto terminate of un-needed EC2 instances. I am wondering if someone else has faced this and if there are some examples of a solution.

    I am running a 4.4 system with 46 proxies. The AWS deployments would share a new proxy. Currently we are using a Oracle Linux 7.9 with a MySQL database 5.7.x

    Thanks for any help.
  • incama
    Member
    • Jan 2015
    • 65

    #2
    But what is the question then?

    Comment

    • mellis
      Senior Member
      • Oct 2017
      • 145

      #3
      I am wondering if someone else has faced this and if there are some examples of a solution.

      Comment

      • incama
        Member
        • Jan 2015
        • 65

        #4
        But your question is about the auto-scaling and auto terminating within AWS? I really don't see the question. Maybe it's already too late for me.

        Comment

        • incama
          Member
          • Jan 2015
          • 65

          #5
          Ah wait. Now I see it. You want to delete hosts within Zabbix when they are deleted in AWS?

          Comment

          • mellis
            Senior Member
            • Oct 2017
            • 145

            #6
            Sorry, What I need to do is remove the host(s) from Zabbix server that have been delete / terminated from the AWS cloud.

            Comment

            • incama
              Member
              • Jan 2015
              • 65

              #7
              Yeah sorry about that, but I really didn't see the question at first.
              I guess it depends on how the hosts are registered within Zabbix. Maybe as an example, look at the vmware template which has this kind off construction. The downside of the vmware template is that it doesn't use the zabbix agent. The vmware templates discovers guess vm's and registers them within zabbix. When the guess is removed, zabbix removes them within a time period of 30 days. It does this by using the discovery method. But, when you use agent registration or manually add the hosts using the agent it's a whole other ballgame.

              Maybe you could create an agent item on all hosts, and when it hits no-data you create a script to remove the host from zabbix via the api. Is it easy? No! Do I have an example? No! Is it fun? Hell yeah!

              Comment

              • incama
                Member
                • Jan 2015
                • 65

                #8
                Nah, forget my solution about the no-data, because if there is something wrong with the instance, your created item will surely come back with no-data and trigger the remove script.

                But again, I find this fascinating and going to think this through.
                Last edited by incama; 29-03-2022, 18:15. Reason: Final thoughts

                Comment

                • raulnuevo
                  Junior Member
                  • Jan 2024
                  • 1

                  #9
                  Hello,

                  Any ideas came up? I'm facing the same situation. Cloud hosts are terminated and have to manually delete them in Zabbix...

                  Comment

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

                    #10
                    How are they created? By some discovery? Set expiry period accordingly... If not discovered any more, they will be deleted.

                    Comment

                    • abhijeet.powar
                      Junior Member
                      • Jan 2025
                      • 1

                      #11
                      You can refere below post for Auto-removal of Zabbix host on termination of EC2 instance from AWS.
                      Boost your cloud setup with automated Zabbix monitoring. Seamlessly manage and deregister hosts using AWS tools for a smarter, agile system. Read the blog today!

                      Comment

                      Working...