samedi 28 août 2010
Hobbit-client 4.3 et Serveur Hobbit 4.2
Par david techer, samedi 28 août 2010 à 22:00 :: Mon réseau et compagnie...
A la maison, j'ai mon serveur Hobbit qui tourne sous 4.2. Sur gemini (une des machines clientes), je viens tout juste d'installer hobbit-client.
Malheureusement c'est un hobbit-client version 4.3 car gemini est une Ubuntu Lucid Lynx 10.04
Installlation du client
apt-get install hobbit-clientl hobbit-pluginsLors de l'installation, il faudra préciser l'IP du serveur Hobbit
Ensuite, il faut modifier le fichier pour supprimer le sufixe davidgis.fr à la ligne CLIENTHOSTNAME="gemini" au lieu de CLIENTHOSTNAME="gemini.davidgis.fr"
root@gemini:~# cat /etc/default/hobbit-client # Configure the Hobbit client settings. # You MUST set the list of Hobbit servers that this # client reports to. # It is good to use IP-adresses here instead of DNS # names - DNS might not work if there's a problem. # (Internally this will be translated to BBDISP and BBDISPLAYS # variables in /var/run/hobbit/bbdisp-include.cfg) # # E.g. (a single Hobbit server) # HOBBITSERVERS="192.168.1.1" # or (multiple servers) # HOBBITSERVERS="10.0.0.1 192.168.1.1" HOBBITSERVERS="192.168.2.242" # Hostname used by the client for its reports. # Must match the name for this host in the Hobbit servers' # bb-hosts file. root@gemini:~# cat /etc/default/hobbit-client # Configure the Hobbit client settings. # You MUST set the list of Hobbit servers that this # client reports to. # It is good to use IP-adresses here instead of DNS # names - DNS might not work if there's a problem. # (Internally this will be translated to BBDISP and BBDISPLAYS # variables in /var/run/hobbit/bbdisp-include.cfg) # # E.g. (a single Hobbit server) # HOBBITSERVERS="192.168.1.1" # or (multiple servers) # HOBBITSERVERS="10.0.0.1 192.168.1.1" HOBBITSERVERS="192.168.2.242" # Hostname used by the client for its reports. # Must match the name for this host in the Hobbit servers' # bb-hosts file. CLIENTHOSTNAME="gemini"
Configuration côté serveur
On ajoute la ligne suivante dans le fichier/etc/hobbit/bb-hosts
melina-xen06:~# head -n35 /etc/hobbit/bb-hosts ############################################################################################### # $Id: bb-hosts 55 2010-08-28 18:19:20Z david $ ############################################################################################### # Master configuration file for Hobbit # # This file defines several things: # # 1) By adding hosts to this file, you define hosts that are monitored by Hobbit # 2) By adding "page", "subpage", "group" definitions, you define the layout # of the Hobbit webpages, and how hosts are divided among the various webpages # that Hobbit generates. # 3) Several other definitions can be done for each host, see the bb-hosts(5) # man-page. # # You need to define at least the Hobbit server itself here. #0.0.0.0 .default. # NOPROPRED:+apt,+libs group Serveurs physiques 192.168.2.1 olivia # http://olivia.davidgis.fr disk memory COMMENT:"Serveur 1 - principal (FireWall/Web/QMail/Samba/LDAP" 192.168.2.6 monroe # http://monroe.davidgis.fr disk memory oratns COMMENT:"Serveur 2 - Lighttpd/Oracle" 192.168.2.8 melina # disk memory COMMENT:"Serveur 3 - Xen" 192.168.2.14 gemini # cpu disk memory COMMENT:"Serveur 4 - Multimedia (FreeBox/TV)" group Serveurs virtuels sous Xen 192.168.2.252 melina-xen01 # disk memory COMMENT:"Bases MySQL/PostgreSQL" 192.168.2.250 melina-xen02 # disk memory COMMENT:"Squid" 192.168.2.248 melina-xen03 # disk memory COMMENT:"FreeRadius" 192.168.2.244 melina-xen04 # disk memory COMMENT:"Windows XP" 192.168.2.246 melina-xen05 # disk memory COMMENT:"P3Scan/ClamAV/SpamAssassin" 127.0.0.1 melina-xen06 # bbd http://melina-xen06/ COMMENT:"Serveurs Web internes/SVN" 192.168.2.238 melina-xen07 # disk memory COMMENT:"Bases Oracle"Ce qui donnera donc ceci
Suppression du test pour apt
Côté Client:
Depuis gemini (client), il faut décommenter la ligne '#DISABLED' dans le fichier. Pour le coup, un petit sed interactif devrait suffireroot@gemini:~# cat /etc/hobbit/clientlaunch.d/apt.cfg [apt] #DISABLED ENVFILE /etc/hobbit/hobbitclient.cfg CMD $HOBBITCLIENTHOME/ext/apt LOGFILE /var/log/hobbit/hobbitclient.log INTERVAL 5m root@gemini:~# sed -i "s:#::g" /etc/hobbit/clientlaunch.d/apt.cfg root@gemini:~# cat /etc/hobbit/clientlaunch.d/apt.cfg [apt] DISABLED ENVFILE /etc/hobbit/hobbitclient.cfg CMD $HOBBITCLIENTHOME/ext/apt LOGFILE /var/log/hobbit/hobbitclient.log INTERVAL 5m
Côté Serveur:
On voit que le test est toujours actifmelina-xen06:~# /usr/lib/hobbit/server/bin/bb 127.0.0.1 "hobbitdboard test=apt fields=hostname" gemini
Il faut donc le dropperTEST=apt; /usr/lib/hobbit/server/bin/bb 127.0.0.1 "hobbitdboard test=$TEST fields=hostname"| \ while read H; do /usr/lib/hobbit/client/bin/bb 127.0.0.1 "drop $H $TEST"; doneOn vérifiemelina-xen06:~# /usr/lib/hobbit/server/bin/bb 127.0.0.1 "hobbitdboard test=apt fields=hostname" melina-xen06:~#
