guilbaults / infiniband-exporter

Prometheus exporter for a Infiniband Fabric
Apache License 2.0
55 stars 22 forks source link

Error processing from file #21

Closed gabrieleiannetti closed 3 years ago

gabrieleiannetti commented 3 years ago

Hi,

I tried to run the exporter to process the input data from file, but it crashes.

Execute exporter:

$ ./infiniband-exporter.py --from-file ../ibqueryerrors_nohostnames.txt 2>exporter_errors.txt

It shows up error messages with Unknown link state on guid... and finally will crash with the following Python errors:

  File "./infiniband-exporter.py", line 346, in collect
    self.parse_switch(switch_name, item[0], item[1])
  File "./infiniband-exporter.py", line 222, in parse_switch
    guid = m_port.group(1)
AttributeError: 'NoneType' object has no attribute 'group'
^CTraceback (most recent call last):
  File "./infiniband-exporter.py", line 437, in <module>

Files:

Looks like objects are not generated because of the Unknown link state errors,
but objects were expected and then the exporter crashes accessing a NoneType object.

gabrieleiannetti commented 3 years ago

I got the cause of the error...

The program ibqueryerrors needs to be executed with the following flags as it is called in the exporter:

--verbose --details --suppress-common --data --report-port --switch

gabrieleiannetti commented 3 years ago

Probably it would be helpful to mention how to create an output file by ibqueryerrors,
so it can be processed by the exporter e.g.: