Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does anyone tried to test vmware_exporter on a vcenter v8.xx? #395

Open
ARVENMOLINILLA opened this issue Jun 11, 2024 · 1 comment
Open

Comments

@ARVENMOLINILLA
Copy link

does anyone tried to test vmware_exporter on a vcenter v8.xx? we are just new to this exporter thing

I am getting this while testing

[root@bin]# ./vmware_exporter -c /usr/monitoring/config.yml
2024-06-05 04:55:15,695 INFO:Starting web server on port :9272
2024-06-05 04:59:20,688 ERROR:Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/vmware_exporter-0.18.4-py3.6.egg/vmware_exporter/vmware_exporter.py", line 1937, in _async_render_GET
yield self.generate_latest_metrics(request)
AttributeError: 'NoneType' object has no attribute 'get'

2024-06-05 04:59:20,688 ERROR:Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/vmware_exporter-0.18.4-py3.6.egg/vmware_exporter/vmware_exporter.py", line 1937, in _async_render_GET
yield self.generate_latest_metrics(request)
AttributeError: 'NoneType' object has no attribute 'get'

@seowjin1060
Copy link

seowjin1060 commented Jun 22, 2024

Hello! I'm running this exporter on vcenter 8 with resolved some problem.

  1. It seems your error has popped up before collecting metrics with pyvomi,
    because no logs with collecting functions and none type error occurred during initial configuration.
    Check if yaml file exist and vsphere variables blew defined in your conf file properly under default attribute . or It will return Nonetype error

    if self.config[section].get('vsphere_host') and self.config[section].get('vsphere_host') != "None":
         vsphere_host = self.config[section].get('vsphere_host')
     elif request.args.get(b'target', [None])[0]:
         vsphere_host = request.args.get(b'target', [None])[0].decode('utf-8')
     elif request.args.get(b'vsphere_host', [None])[0]:
         vsphere_host = request.args.get(b'vsphere_host')[0].decode('utf-8')
    
    
     section = request.args.get(b'section', [b'default'])[0].decode('utf-8')
     if section not in self.config.keys():
         logging.info("{} is not a valid section, using default".format(section))
         section = 'default'
    
  2. Check if any sphere host in your vCenter, collect functions will return nonetype if you don't add any host on your vcenter.
    Because this exporter code not checking error / empty json.

Also, can you share your config.yml file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants