Ad Widget

Collapse

Monitoring Amazon Web Services EC2 Instance State

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • levkov
    Junior Member
    • Jun 2010
    • 12

    #1

    Monitoring Amazon Web Services EC2 Instance State

    Hi all,
    I am publishing simple external check script to get running/stopped state of EC2 instances from AWS API. It may be useful for general monitoring of instances, count of running instances using aggregation (grpsum) and setting dependencies to silent other triggers while instance is in stopped state.

    Instructions:
    1. Put script to /usr/local/share/zabbix/externalscripts and set permissions
    2. Edit script to set correct region and AWS keys
    3. Create external check item in template or host with following key: ec2.us.east.get.state.py[{$AWSID}]
    4. Set macro {$AWSID} on EC2 instance host in Zabbix with EC2 instance id
    5. Set triggers and grpsum items. When EC2 instance is running script output is 1, when stopped - 0.

    Script:
    GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.
    Last edited by levkov; 19-11-2012, 21:47.
  • chpatelisin
    Junior Member
    • Jul 2024
    • 3

    #2
    levkov This article you have created for ec2 state is really great and wondering when I go to github link it doesn't allow me to download the python file. Thanking you

    Comment

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

      #3
      Originally posted by chpatelisin
      levkov This article you have created for ec2 state is really great and wondering when I go to github link it doesn't allow me to download the python file. Thanking you
      That post was done almost 12 years ago... don't you think that things can be removed by that time... It would be most probably out of date by now...

      Comment


      • chpatelisin
        chpatelisin commented
        Editing a comment
        I cant find any article for ec2 aws api monitoring alert when ec2 instance stoping or shutdown. This is the only article I found. I am looking for the ec2 shutdown alert and that basic feature is not available in AWS api monitoring. Do you know is there I can achieve that in zabbix?
    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4807

      #4
      I don't use AWS, so no... But are you sure there is not enough in https://www.zabbix.com/integrations/...2#aws_ec2_http ? There seem to be several status checks present... Aren't they somewhat related to things being shut down ?

      Comment

      • chpatelisin
        Junior Member
        • Jul 2024
        • 3

        #5
        Instance status check failed and System status check failed​ doesn't help to monitor ec2 instance shutdown behaviour as this is only good if VM is not booting up and having below issue.
        The following are examples of problems that can cause system status checks to fail:
        • Loss of network connectivity
        • Loss of system power
        • Software issues on the physical host
        • Hardware issues on the physical host that impact network reachability

        ​The following are examples of problems that can cause instance status checks to fail:
        • Failed system status checks
        • Incorrect networking or startup configuration
        • Exhausted memory
        • Corrupted file system
        • Incompatible kernel
        • [Windows instances] During instance reboot or while a Windows instance store-backed instance is being bundled, an instance status check reports a failure until the instance becomes available again.

        Attached Files

        Comment

        Working...