wawastein / zabbix-cloudwatch

Cloudwatch integration for Zabbix 3.x
GNU General Public License v3.0
33 stars 53 forks source link

Cannot seem to make the scripts working on Ubuntu 20.04 #29

Closed IgalSc closed 3 years ago

IgalSc commented 3 years ago

In Ubuntu, python packages are installed as either python2 or python3. There's no /usr/bin/python executable, but ls -alh /usr/bin/pyt* lrwxrwxrwx 1 root root 9 Mar 13 2020 /usr/bin/python2 -> python2.7 -rwxr-xr-x 1 root root 3.5M Aug 4 11:16 /usr/bin/python2.7 lrwxrwxrwx 1 root root 9 Mar 13 2020 /usr/bin/python3 -> python3.8 lrwxrwxrwx 1 root root 16 Mar 13 2020 /usr/bin/python3-config -> python3.8-config -rwxr-xr-x 1 root root 5.3M Jul 28 12:59 /usr/bin/python3.8 lrwxrwxrwx 1 root root 33 Jul 28 12:59 /usr/bin/python3.8-config -> x86_64-linux-gnu-python3.8-config

I tried changing the script to have #!/usr/bin/python2 at the beginning, but trying to run /usr/lib/zabbix/scripts/aws_discovery.py --account default --region eu-west-1 --service s3

I get

Traceback (most recent call last):
  File "/usr/lib/zabbix/scripts/aws_discovery.py", line 43, in <module>
    args.service, args.region)
  File "/usr/lib/zabbix/scripts/discovery/aws_client.py", line 9, in __init__
    aws_key = config.get(account, "key")
  File "/usr/lib/python2.7/ConfigParser.py", line 607, in get
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'default'
IgalSc commented 3 years ago

Looks like I had to update the conf file with [default] as account