File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # Linux-System-Inventory-Tool-
1+ # Linux-System-Inventory-Tool
Original file line number Diff line number Diff line change 11Vagrant . configure ( "2" ) do |config |
22 config . vm . box = "debian/bookworm64"
33 config . vbguest . auto_update = false
4+ config . vm . provision "shell" , inline : <<-SHELL
5+ apt-get update
6+ apt-get install -y python3 python3-pip
7+ apt-get install -y nano
8+ SHELL
49end
Original file line number Diff line number Diff line change 1+ with open ("/etc/hostname" ) as f :
2+ hostname = f .read ().strip ()
3+
4+ print (f"La cible a été identifiée. Nom de la machine : { hostname } " )
5+
6+ ram_info = ""
7+ with open ("/proc/meminfo" ) as f :
8+ for ligne in f :
9+ if "MemTotal" in ligne :
10+ ram_info = ligne .strip ()
11+
12+ print (f"Mémoire totale : { ram_info } " )
13+
14+ with open ("rapport_lsit.txt" , "a" ) as rapport :
15+ rapport .write (f"La cible a été identifiée. Nom de la machine : { hostname } \n " )
16+ rapport .write (f"Mémoire totale : { ram_info } \n " )
You can’t perform that action at this time.
0 commit comments