User Tools

Site Tools


graficar_variables_de_ups_en_grafana

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
graficar_variables_de_ups_en_grafana [2024/05/25 21:41] โ€“ [Code Explanation:] osograficar_variables_de_ups_en_grafana [2024/10/17 21:42] (current) โ€“ external edit 127.0.0.1
Line 3: Line 3:
 **Objective:** This project aims to monitor the status of a UPS (Uninterruptible Power Supply) by fetching data through a web service and storing it in a MariaDB database. The data is then visualized in a Grafana dashboard. **Objective:** This project aims to monitor the status of a UPS (Uninterruptible Power Supply) by fetching data through a web service and storing it in a MariaDB database. The data is then visualized in a Grafana dashboard.
  
 +{{:3029b882-0fff-4238-a832-c6ebfb5b5d8a.jpg?nolink|}}
 +
 +๐Ÿ˜… //This image was created in May 2024, using Bing AI. Apparently it struggles a bit with the cable routing... ToDo: create this same prompt (raspberry pi connected to an UPS using an USB cable, photorealistic) in a couple of years.//
 ===== Code ===== ===== Code =====
  
Line 23: Line 26:
     host="localhost",     host="localhost",
     port=3306,     port=3306,
-    user="facundo",ย +    user="f******",ย 
-    password="myPassword",+    password="***my*assword***",
     database="UPSstats"     database="UPSstats"
 ) )
Line 154: Line 157:
 With these commands, you will have a database named `UPSstats` with two tables: `variables` for storing the names and IDs of the variables, and `ups_data` for storing the actual readings along with their timestamps. Make sure to execute these commands in your MariaDB client to set up the database before running your Python script. With these commands, you will have a database named `UPSstats` with two tables: `variables` for storing the names and IDs of the variables, and `ups_data` for storing the actual readings along with their timestamps. Make sure to execute these commands in your MariaDB client to set up the database before running your Python script.
  
 +<code sql>GRANT ALL PRIVILEGES ON UPSstats.* TO 'facundo'@'%' WITH GRANT OPTION;</code>
 +
 +<code sql>FLUSH PRIVILEGES;</code>
 ===== Flask Service ===== ===== Flask Service =====
  
Line 233: Line 239:
 {{:upsstats.png?nolink|}} {{:upsstats.png?nolink|}}
  
 +**Live site:**
 +https://monitoring.facundoitest.space/public-dashboards/d26eff1b7dd548e6a5a88426efda10ba
graficar_variables_de_ups_en_grafana.1716673304.txt.gz ยท Last modified: 2024/10/17 21:42 (external edit)