paregupt / ucs_traffic_monitor

Cisco UCS traffic monitoring using Grafana, InfluxDB and Telegraf
MIT License
81 stars 26 forks source link

Power Utilization #90

Open odesey opened 2 years ago

odesey commented 2 years ago

Similar to #66 , how can I get power utilization for:

Blade \Server Chassis FI Total power utilization

Any documentation on how to get started? I would be willing to give it a shot and submit a pull request if successful.

Thanks.

paregupt commented 2 years ago

Code is the documentation :)

TheKowalski commented 2 years ago

Any hope that we have more information about how to create the dashboard (mainly the SQL request) ? Thanks !

jlefeuvr commented 2 years ago

Similar to #66 , how can I get power utilization for:

Blade \Server Chassis FI Total power utilization

Any documentation on how to get started? I would be willing to give it a shot and submit a pull request if successful.

Thanks.

Hello, You can use a UTM fork I just released https://github.com/jlefeuvr/ucs_traffic_monitor. I added a power consumption usage dashboard. So you can just take the python script and the grafana dashboards from that projects and import them into your existing UTM VM.

odesey commented 2 years ago

Thanks @jlefeuvr , I tried to use your updated .json and .py files but it broke all my dashboards. Is there anything hard-coded stuff in there that needs to be changed, like db names?

jlefeuvr commented 2 years ago

Hello @odesey, I used the same parameters as in the original utm project. how did you proceed ? Normally you only need to replace the .py files and import the power_consumption.json file into grafana ( Dashboard --> Manage --> import --> import json file). Optionally you can import the "locations.json" dashboard, the new version integrates a shortcut to the power_consumption dashboard. can you please send the output of "python3 /usr/local/telegraf/ucs_traffic_monitor.py /usr/local/telegraf/ucs_domains_group_1.txt influxdb-lp -vv" and "cat /var/log/telegraf/telegraf.log" if you still face the issue? thank you

TheKowalski commented 2 years ago

Hello, It's working well for me now but there is just an error on your dashboard because there are "overrides" on the graph FI, Chassis and Servers... must edit the panel and remove the existing overrides. Perhaps good to be removed on your repository Github. Thanks a lot one more time @jlefeuvr

TheKowalski commented 2 years ago

I try to put the script into our prod UTM and we have an error on 1 domain after try with the command python3 /usr/local/telegraf/ucs_traffic_monitor.py /usr/local/telegraf/ucs_domains_group_1.txt influxdb-lp -vv. The result log error is :

2022-11-02 17:36:10,401 - INFO - Printing output in InfluxDB Line Protocol format 2022-11-02 17:36:10,409 - ERROR - Exception with print_output:'power' Traceback (most recent call last): File "/usr/local/telegraf/ucs_traffic_monitor_new.py", line 3002, in main print_output() File "/usr/local/telegraf/ucs_traffic_monitor_new.py", line 2959, in print_output print_output_in_influxdb_lp() File "/usr/local/telegraf/ucs_traffic_monitor_new.py", line 2769, in print_output_in_influxdb_lp blade_fields) File "/usr/local/telegraf/ucs_traffic_monitor_new.py", line 2474, in influxdb_lp_server_fields ',serial="' + server_dict['serial'] + '"' KeyError: 'power'

How can I debug the error ? as I understand, it's on the table servers right ? but which server, is it possible to know ?

Thanks in advance @jlefeuvr

NEWS : after list all our servers into this domain, I just point on the special type UCSB-EX-M4 type of blade which take 2 slots and there is no information on the power in UCSM. I just try to decom them (not used actually) and the script working well now ! So just to know that this type of blade could be a problem with your script @jlefeuvr :-) !

jlefeuvr commented 2 years ago

@TheKowalski many thanks for the feedback. I will document and create an issue on my repo.

jlefeuvr commented 2 years ago

@TheKowalski I pushed a fix to your issue on my repo, please let me know