tecnologia:luzparaeleko:monitorizacion
This is an old revision of the document!
Grafana
Gráfica del bot
El docker del bot tiene mapeado:
| /var/www/html/grafica | /dades/web/htdocs/apitelegram.lobo99.info/grafica |
Hace un ls y coge un fichero (confirmar cual) y lo pone en la variable $grafica:
- rw-r–r– 1 ruth ruth 29858 jun 23 13:00 1655982001.png
- rw-r–r– 1 ruth ruth 29858 jun 23 13:00 grafica.png
Lo cuelga en esta web:
https://apitelegram.lobo99.info/grafica/'.$grafica;
En el crontab está esto que se descarga la imagen de grafana. Creo que se lo descarga de un dokcer que tiene un plugin de gráficas creado con un token (Pendiente de revisar)
hoy=`date +%Y%m%d`
inicio=`date "+%s" -d "$hoy 00:00:00"`"000"
fin=`date "+%s" -d "$hoy 23:59:59"`"000"
fecha=`date +%s`
curl -H "Authorization: Bearer eyJrIjoiUm9YNzdZb0Iyam5xOGp2TFI4aThpOVQwNzlqQnNOQUMiLCJuIjoiZGFzaGJvYXJkIiwiaWQiOjF9" "https://grafanaeko.lobo99.info/render/d-solo/Ehqv1ctnz/eko2?orgId=1&from="${inicio}"&to="${fin}"&panelId=6&width=1000&height=500&tz=Europe%2FMadrid&" -o "/dades/web/htdocs/apitelegram.lobo99.info/grafica/"${fecha}".png"
#borro todos los ficheros, menos el que me acabo de descargar y grafica.png por si alguien justo lo pide, que exista
find /dades/web/htdocs/apitelegram.lobo99.info/grafica/ -type f -not -name ${fecha}'.png' -not -name grafica.png -delete
cp /dades/web/htdocs/apitelegram.lobo99.info/grafica/"${fecha}".png /dades/web/htdocs/apitelegram.lobo99.info/grafica/grafica.png
tecnologia/luzparaeleko/monitorizacion.1655982273.txt.gz · Last modified: by admin
