conext-computer / conext-bot Goto Github PK
View Code? Open in Web Editor NEWScript permettant inventaire, effacement et test automatique d'un ordinateur [GLPI-Agent] [Debian]
License: GNU Affero General Public License v3.0
Script permettant inventaire, effacement et test automatique d'un ordinateur [GLPI-Agent] [Debian]
License: GNU Affero General Public License v3.0
Modifier le fichier agent.cfg de glpi-agent afin de pouvoir communiquer avec un serveur protégé par Apache AUTH_BASIC
Demande des identifiants lors de l'init -> SED -i du fichier main.conf -> après Install GLPi Sed -i du fichier /etc/GLPI-Agent/agent.cfg via les valeurs de main.conf
Remplacer la partie NFS par FTP, afin d'avoir plus de souplesses et permettre du téléversement de logs à distance.
Compiler les informations essentielles des différents fichiers logs afin d'avoir une vue générale pour chaque Ordinateur.
Par exemple:
Inventaire -> OK / NOK
Effacement -> OK / NOK
SMART Short -> OK / NOK
SMART Long -> OK / NOK
RAM Test -> OK / NOK
Actuellement, impossible de savoir dans GLPI quel est le type de stockage.
Il serait possible de reprendre une partie du script "toolbox.sh" de la clé de réemploi du collectif emmabuntus:
# Identification du type de disque dur : Classique ou SSD
TYPE_HARD_DRIVE=$(cat /sys/block/${HARD_DRIVE}/queue/rotational)
if [ ${TYPE_HARD_DRIVE} -eq 0 ] ; then
# Test si le SSD est NVMe
HARD_DRIVE_NVME=$(sudo nvme list | grep "/dev/" | cut -d " " -f1 )
if [ "${HARD_DRIVE_NVME}" != "" ] ; then
NAME_TYPE_HARD_DRIVE="MVMe"
ERASE_LOG=${NVME_LOG}
else
NAME_TYPE_HARD_DRIVE="SSD"
ERASE_LOG=${HDPARM_LOG}
fi
else
# Disque magnétique
NAME_TYPE_HARD_DRIVE=${message_type_disque_dur}
ERASE_LOG=${NWIPE_LOG}
fi
echo ""
echo -e "${message_usb_disque_dur_avant} ${GREEN}${KEY_DRIVE}${NC} ${message_usb_disque_dur_apres}${GREEN}/dev/${HARD_DRIVE}${NC} (Type : ${GREEN}${NAME_TYPE_HARD_DRIVE}${NC})${NC}"
echo ""
Adapter pour intégrer les informations dans le fichier inventory.xml afin d'avoir une remontée dans GLPI.
Faire un test ramener avec lot via memtester
Trouver une méthode appropriée afin d’exclure formellement la clé USB contenant le Système Live actuellement démarrer, puis lancer un effacement "Quick" sur le reste des disques.
Il faudrait compléter le couple utilisateur/mot de passe du serveur Apache avec la gestion de certificats, afin de sécuriser la remontée des inventaires vers le serveur.
user
_Specifies the user to use for HTTP authentication on the server._
password
_Specifies the password to use for HTTP authentication on the server._
ca-cert-dir
_Specifies the directory containing indexed Certification Authority (CA) certificates.
This directory must contain the certificate files corresponding to different certificate authorities in Privacy Enhanced Mail (PEM) format. The file name of each certificate file must match the hash value of the certificate's subject field and use the .0 extension.
You can obtain the hash value of the certificate's subject field and copy the CA.crt certificate to the expected place following this snippet:
$ CA_CERT_DIR=/etc/glpi-agent/ca-cert-dir
$ openssl x509 -in CA.crt -subject_hash -noout
b760f1ce
* cp -a CA.crt $CA_CERT_DIR/b760f1ce.0_
ca-cert-file
_Specifies the file containing aggregated Certification Authority (CA) certificates._
ssl-cert-file
_Specifies the file containing SSL client certificate to use when connecting to server target or for WinRM remote inventory._
ssl-fingerprint (Available since GLPI Agent v1.3)
_Specifies the fingerprint of the ssl server certificate to trust.
The fingerprint to use can be retrieved in agent log by temporarily enabling no-ssl-check option._
La variable Hostname étant une variable système, il serait préférable de paramétrer le nom à remonter dans GLPI via l'option additionnal-content.
additional-content
_Specifies an XML file whose content will be automatically merged with output. If inventory format is JSON, you can also specify a JSON file from which content base node will be merged.
This directive is used for inventory task only._
Le test SMART Long se lance actuellement manuellement, alors qu'il devrait se lancer automatiquement si le test Short est OK.
Déplacer les chemins de destination et les options de test/effacement dans un fichier .conf
install.sh
chemin du répertoire log
adresse du serveur d'hébergement du script
script.sh
chemin du répertoire log
chemin du répertoir NFS
options nwipe
options et chemin log memtester
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.