Files
ROMFASTSQL/CLAUDE.md
Marius 9ba99eb9d1 feat(ups): monitorizare UPS pe serverul 36, in locul ViewPower
ViewPower nu putea dialoga cu acest UPS: 5777 de "QPI return(NAK" si zero
citiri reusite in fereastra 6-10 august, pentru ca UPS-ul vorbeste HID Power
Device standard, nu dialectul text Voltronic. Serviciile au fost dezactivate
pe 10.08.2026 la 22:34, lasand serverul fara nicio alertare 17 zile. Nici
inainte nu exista: emailReceivers = 0, iar excuteProgram era gol, deci Oracle
nu era oprit curat oricum.

UPS-ul comunica insa perfect cu Windows pe canalul HID - dovedit de perechile
de evenimente Kernel-Power 105 la panele reale din 2026.

Monitorul nou citeste GetSystemPowerStatus, acelasi semnal pe care il foloseste
Windows pentru propria actiune la baterie critica. Alerteaza pe email la
trecerea pe baterie, la revenirea curentului si cand UPS-ul nu mai comunica -
cazul care a trecut neobservat. Opreste curat listenerul, apoi instanta cu
shutdown immediate, apoi Windows-ul, inaintea pragului brutal de 20% al
Windows-ului.

Ruleaza ca task programat sub SYSTEM, cu AllowStartIfOnBatteries si
DontStopIfGoingOnBatteries - fara ele Windows ar fi oprit taskul exact cand
serverul trece pe baterie.

Validat pe 27.08.2026: citire, email, secventa de oprire in dry-run si
pierderea comunicatiei (alerta la exact 8 cicluri, apoi revenire). Pragurile
de 10 min / 35% sunt conservatoare, nu masurate - testul de autonomie reala
ramane de facut.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RRyaDj39hPQ89SZS6URRpS
2026-08-27 15:33:45 +03:00

136 lines
6.1 KiB
Markdown

# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
ROMFASTSQL is an infrastructure and database management project for ROMFAST, featuring:
- Proxmox virtualization cluster (3 nodes: pve1, pvemini, pveelite)
- Oracle Database XE 21c with migration support from Oracle 10g
- AI chatbot system (Flowise + Claude)
- Disaster recovery infrastructure
## Repository Structure
```
proxmox/ # Main infrastructure documentation
├── README.md # Master index - START HERE
├── cluster/ # Proxmox cluster, UPS, storage management
├── lxc102-docker/ # Docker + Portainer + Docker Sandboxes (sbx)
├── lxc104-flowise/ # AI Chatbot (Flowise on port 3000)
├── lxc108-oracle/ # Oracle XE 21c/18c Database (port 1521/1522)
├── lxc110-moltbot/ # MoltBot AI Telegram Bot
├── lxc171-claude-agent/ # Claude Code development environment
├── vm109-windows-dr/ # Windows Disaster Recovery VM
├── vm201-windows/ # Windows 11 (IIS reverse proxy)
└── vm302-oracle-test/ # Windows 11 + Oracle 21c test VM (ROA setup validation)
system_instructions/ # SQL migration guidelines and knowledge base
├── system_prompt.md # SQL migration rules - READ BEFORE WRITING SQL
└── knowledge_base/ # Example scripts and PACK_MIGRARE.pck
scripts/ # Utilities
├── generare_proces_verbal.py # Generate assembly minutes (DOCX)
├── verificare_voturi_AG.py # Verify assembly votes
└── ups-monitor/ # UPS monitoring for production Oracle server 10.0.20.36
input/ # Oracle DMP files for import
```
## Key Documentation Entry Points
- **Infrastructure overview**: `proxmox/README.md`
- **Oprire planificată a clusterului (lucrări electrice) — fără failover HA / fence**: `proxmox/cluster/docs/oprire-planificata-cluster.md`
- **SQL migration guidelines**: `system_instructions/system_prompt.md` (always read before generating migration SQL)
- **Oracle database setup**: `proxmox/lxc108-oracle/README.md`
- **Migration orchestration**: `proxmox/lxc108-oracle/migration/00-MASTER-MIGRATION.sh`
- **Chatbot architecture**: `proxmox/lxc104-flowise/docs/prd.md`
- **Docker Sandboxes (sbx) — agenți AI izolați**: `proxmox/lxc102-docker/README.md`
- **Disaster recovery**: `proxmox/vm109-windows-dr/README.md`
- **Instalare/migrare Oracle — care director se folosește**: `proxmox/lxc108-oracle/docs/instalare-si-migrare-oracle.md`
- **ROA Windows setup scripts (XE/SE 21c)**: `proxmox/lxc108-oracle/roa-windows-setup/README.md`
- **Conectarea clienților vechi (Instant Client 10/11) la 21c — ORA-28040 / ORA-01017 / ORA-12514**: `docs/lectii-conectare-client-oracle.md`
- **Kit de instalare pentru client (DMP-uri șablon + scripturi, gata de dus la client)**: `proxmox/lxc108-oracle/scripts/build-client-kit.ps1`
- **VM 302 test environment for ROA setup**: `proxmox/vm302-oracle-test/README.md`
- **Diagnostic spațiu Oracle la clienți (job zilnic + emailuri)**: `docs/diagnostic-spatiu-clienti.md`
- **Monitorizare UPS pe serverul Oracle de producție 10.0.20.36 (înlocuiește ViewPower)**: `docs/ups-server36-monitorizare.md`
- **Acces SSH la clienți cu chei publice (angajați noi)**: `docs/acces-ssh-chei-angajati.md`
- **Acces administrativ la server client prin Tailscale + SSH (fără forward pe router)**: `docs/acces-client-tailscale-ssh.md`
- **Cazuri clienți (depanare DB)**: `proxmox/lxc108-oracle/clienti/README.md`
- **ROMPETROL ENERGY — recreare PDB Oracle XE 21c după ORA-12954**: `proxmox/lxc108-oracle/clienti/oracle-xe-21c/README.md`
## Infrastructure Commands
### Proxmox Cluster
```bash
ssh root@10.0.20.201 "pvecm status" # Cluster status
ssh root@10.0.20.201 "pct list" # List LXC containers
ssh root@10.0.20.201 "qm list" # List VMs
```
### Oracle Database (LXC 108)
```bash
pct exec 108 -- docker exec -it oracle-xe sqlplus / as sysdba
pct exec 108 -- docker restart oracle-xe
```
### Flowise Chatbot (LXC 104)
```bash
pct exec 104 -- systemctl status flowise
pct exec 104 -- systemctl restart flowise
pct exec 104 -- journalctl -u flowise -f
```
### Validation Scripts
```bash
# UPS monthly test
proxmox/cluster/ups/scripts/ups-monthly-test.sh
# SSL certificate monitoring
proxmox/vm201-windows/scripts/monitor-ssl-certificates.sh
# Oracle backup monitoring
proxmox/vm109-windows-dr/scripts/oracle-backup-monitor-proxmox.sh
```
## Network Layout
| Service | IP Address | Port | Purpose |
|---------|-----------|------|---------|
| pvemini (main host) | 10.0.20.201 | 8006 | Proxmox GUI |
| Oracle XE 21c | 10.0.20.121 | 1521 | Production database |
| Oracle XE 18c | 10.0.20.121 | 1522 | Export compatibility (TSTZ 31) |
| Flowise | 10.0.20.161 | 3000 | Chatbot UI |
| Gitea | 10.0.20.165 | 3000 | Git server |
| Docker + Portainer + sbx | 10.0.20.113 | 9000/9443 | Docker host, sandbox-uri agenți AI |
| Claude Agent | 10.0.20.171 | 22 | Development (also via Tailscale: 100.95.55.51) |
| MoltBot | 10.0.20.173 | 22 | AI Telegram Bot (also via Tailscale: 100.120.119.70) |
| Primary Oracle | 10.0.20.36 | 1521 | Windows production |
| DR Oracle | 10.0.20.37 | 1521 | Disaster recovery |
## SQL Migration Conventions
When writing Oracle migration scripts, follow the naming convention:
```
ff_YYYY_MM_DD_##_TYPE.sql
```
Where TYPE is: DDL, DML, VIEW, PACK, TRIG, etc.
Always reference `system_instructions/system_prompt.md` for:
- Oracle 10g compatibility requirements
- PACK_MIGRARE package usage
- Migration script patterns and examples
## Custom Claude Code Commands
- `/ultimate_validate_command` - Generate comprehensive validation commands
- `/plan-handover` - Save implementation plan for session handover
- `/branch-plan-handover` - Create branch and save plan
- `/context-handover` - Save context for next session
## Git Workflow
- Remote: `http://gitea:3000/romfast/ROMFASTSQL.git`
- Main branch: `master`
- Feature branches merged directly to master