Forum Discussion

Henry_Steinhaue's avatar
3 years ago

Setup for Python 3.x to Query LM looking at Arista Voltage Sensors - Just PowerSupply

Looking for examples to setup Python 3.x usage of the API for v2 -  Perhaps in GitHub? 

I learn best by example and I'm looking for examples that others have done for successful setup and use of Python 3.x API V2.

I'm looking for device information on Arista devices, Arista Voltage Sensors - but just the ones that have PowerSupply  (could have multiple entries).

We discovered that some of the dual power supplies were not connected to power supplies and did not have any alerts on that fact.

There is a Voltage Alert - but that also alerts on the on the POE and other power items besides just the PowerSupply marker.

Any help and points would be welcome. 

Of course when this is done- I need to check all the other vendor device types and create queries for those as well.

Thanks for your help and pointers to learn from examples that others have done.

I have upload a picture of both one that shows good values and one that shows bad values. 

Henry Steinhauer -

15 Replies

  • Anonymous's avatar
    Anonymous

    ok, easy peasy. 

    The strategy mentioned before is still the recommended way. You'd clone the datasource and modify the new datasource to include a discovery filter where the sensor_owner (which is the attribute that determines instance group membership) starts with "PowerSupply". There's not a "starts with" option, but there's a "RegexMatch" option. So it would look like this:

    This should result is basically the same datasource as you had before, but will only discover the instances where the sensor_owner is a power supply. Use the "Test Active Discovery" button to make sure you're getting the right instances. You might not need the "auto." at the beginning, i can't test without an arista device.

    Once you've got that new clone working, set your threshold on the volt datapoint.

     

    Once that's all working, there's no need to monitor those instances with the old datasource, so go add a filter that filters them out of that one. Something like this:

     

  • I think I understand .

    But - this will duplicate the devices that are being monitored - adding more devices to our license -
    One of the devices will be able to alert on the powersupply voltage if it is low -
    The other would have everything else being monitored.

    We still need the other objects being monitored - like the traffic on the interfaces and other items like BGP etc. All the normal stuff.
    If I do the RegexNotMatch - then won't it exclude all the other items from being monitored?

  • Anonymous's avatar
    Anonymous

    It will add more datasources to the same device, not add more devices. 

    Before (top) and after (bottom). You are licensed by device, not by instance. We count the number of devices your collector talks to, not how much data we gather from that device. Besides, the total number of instances isn't actually changing.

  • OK - thanks for helping me understand the process. I see that I also have the ability to set the alert. 

     

    As an aside -
    I noticed that the allowed ranges were 0 to 207 volts. - - I'm seeing actual voltage values higher than 207 though - it is a 240 volt source.
    In rolling through the devices - I see some at 210 for instance. 

  • Anonymous's avatar
    Anonymous

    I'm not seeing a max on the datapoint definition nor on the axis in any of the graph definitions. Normally, if you don't set a max, it just auto adjusts to a decent height so everything is visible on the graph. You can hard code that, or leave it automatic.