33800 Docs

← Retour

Proposition : Fix JSON invalide - variable PROD_NFS_MOUNTED

Date : 06/01/2026 Status : IMPLEMENTEE Priorite : HAUTE (dashboard inutilisable)


Probleme identifie

Le dashboard 33800 est vide car le JSON genere est invalide.

Cause : Ligne 282 de collect.sh :

PROD_NFS_MOUNTED=$(mount | grep -c "192.168.1.10" 2>/dev/null || echo 0)

Cette commande :

  1. S'execute localement sur PVE au lieu de via SSH sur prod-portainer
  2. Le || echo 0 ajoute un second 0 car grep retourne code 1 quand 0 match

Resultat dans le JSON :

"nfs_mounted": 0
0,

Au lieu de :

"nfs_mounted": 0,

Fix propose

Modifier la ligne 282 de /stock_8to/33800-stack/monitoring/collect.sh :

Avant :

PROD_NFS_MOUNTED=$(mount | grep -c "192.168.1.10" 2>/dev/null || echo 0)

Apres :

PROD_NFS_MOUNTED=$(ssh_cmd 192.168.1.12 'mount | grep -c "10.10.10.10" 2>/dev/null' | tr -d '\n')
[ -z "$PROD_NFS_MOUNTED" ] && PROD_NFS_MOUNTED=0

Notes :


Test

Apres le fix, verifier :

# Relancer collect
/stock_8to/33800-stack/monitoring/collect.sh

# Valider JSON
ssh gouroubleu@192.168.1.104 "python3 -c \"
import re, json
html = open('/var/www/dashboard/index.html').read()
match = re.search(r'const data =\s*(\{[\s\S]*?\n\})\n;', html)
json.loads(match.group(1))
print('JSON VALIDE')
\""

# Verifier dashboard
curl -s https://dashboard.33800.nowhere84.com | grep -c "grid"

Impact