Si vous avez des graphiques cacti de traffic ou de cpu qui ne s’affiche pas au dela de la métrique 100 la solution trouvé sur le forum cacti est la suivante.

Dans mon cas le graphique CPU n’était plus affiché au dela de 100 ? pourquoi ? alors que je disposais de 4 CPU bi core donc potentiellement 800% de puissance ? Simplement car dans le data source du data template le MAXIMUM VALUES a été coché et limité à 100.

Il ne me restait plus qu’a re paramètre les fichier rrd tools créé à partir de ce template pour monté le maximum value à la hauteur du nb de core disponible.

rrdtool tune apache_01_cpu_user_1739.rrd --maximum cpu_nice:<span style="color: #000000;">800</span>

Petite vérification avant de poursuivre

rrdtool info  apache_01_cpu_user_2226.rrd <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> max ds<span style="color: #7a0874; font-weight: bold;">&#91;</span>cpu_user<span style="color: #7a0874; font-weight: bold;">&#93;</span>.max = <span style="color: #000000;">800</span>

Ok, on applique ce a tout les fichier rrd cpu concernés

<span style="color: #000000; font-weight: bold;">for</span> I <span style="color: #000000; font-weight: bold;">in</span> `<span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000;">-1</span> <span style="color: #000000; font-weight: bold;">*</span>_cpu_<span style="color: #000000; font-weight: bold;">*</span>`; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rrdtool info <span style="color: #007800;">$I</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> max ; <span style="color: #000000; font-weight: bold;">done</span>
 

Script de création d’un Amazone Machine Image (ami) instance root[1] depuis l’instance de référence utilisé comme modèle pour construire l’image en question.

Dans mon cas j’utilise un type hardware m1.large avec comme départ une image de Ubuntu Karmic 9.10 créé par alestic.com.. Une fois cette instance démarrée je l’ai modifier et updaté en fonction des mes besoins. Souhaitant garder comme master de départ cette instance et la dupliquer à volonté j’ai créé décidé et créé une AMI.

Pour ce faire il faut installer les paquets suivant :

apt-get <span style="color: #c20cb9; font-weight: bold;">install</span> ec2-ami-tools apt-get <span style="color: #c20cb9; font-weight: bold;">install</span> ec2-api-tools

Il est nécéssaire en outre de disposer d’un stockage Amazon Simple Stockage Service dit bucket S3.

Je considère que disposer déjà d’un compte AWS et des éléments d’identification et authentification lier à ce compte : access key, secret key, certificat x509 etc..

Le script en question de fait que reprendre les commandes ec2 expliqué dans les documentations officielles AWS.

<span style="color: #808080; font-style: italic;">#!/bin/sh</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">bucket=</span>ami-stockage
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">prefix=</span>k9-karmic-OsBase
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_USER_ID=</span><span style="color: #000000;">9452</span><span style="color: #000000;">-1810</span><span style="color: #000000;">-7536</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_ACCESS_KEY_ID=</span>TV542X3ONAAKITV54YCTN
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_SECRET_ACCESS_KEY=</span>dwYjHg2msv8rQEjmSBDPFP4m1f4R31f3rCJ9bI
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">[</span> $<span style="color: #7a0874; font-weight: bold;">(</span><span style="color: #c20cb9; font-weight: bold;">uname</span> -m<span style="color: #7a0874; font-weight: bold;">)</span> = <span style="color: #ff0000;">'x86_64'</span> <span style="color: #7a0874; font-weight: bold;">]</span>;
<span style="color: #000000; font-weight: bold;">then</span>   <span style="color: #007800;">arch=</span>x86_64
<span style="color: #000000; font-weight: bold;">else</span>   <span style="color: #007800;">arch=</span>i386
<span style="color: #000000; font-weight: bold;">fi</span>   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ec2-bundle-vol -r <span style="color: #007800;">$arch</span> -d <span style="color: #000000; font-weight: bold;">/</span>mnt -p <span style="color: #007800;">$prefix</span> -u <span style="color: #007800;">$AWS_USER_ID</span> -k <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>pk-<span style="color: #000000; font-weight: bold;">*</span>.pem \     -c <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>cert-<span style="color: #000000; font-weight: bold;">*</span>.pem -s <span style="color: #000000;">10240</span>  -e <span style="color: #000000; font-weight: bold;">/</span>mnt,<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>ubuntu<span style="color: #000000; font-weight: bold;">/</span>.<span style="color: #c20cb9; font-weight: bold;">ssh</span>    <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ec2-upload-bundle -b <span style="color: #007800;">$bucket</span> -m <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$prefix</span>.manifest.xml \     -a <span style="color: #007800;">$AWS_ACCESS_KEY_ID</span> -s <span style="color: #007800;">$AWS_SECRET_ACCESS_KEY</span>   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ec2-register -K <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>pk-<span style="color: #000000; font-weight: bold;">*</span>.pem -C <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>cert-<span style="color: #000000; font-weight: bold;">*</span>.pem <span style="color: #007800;">$bucket</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$prefix</span>.manifest.xml

ec2-bundle-vol construit les paquets de l’image AMI tout en excluant ce celle ci le contenue du répertoire /mnt (avec l’option -e ) ou justement sont stocker provisoirement les paquets en question. J’exclue également /home/ubuntu/.ssh préférent utilisé le compte root.

ec2-upload-bundle upload les paquets sur le bucket S3

ec2-register déclare dans votre compte l’ami, qui reste privée, afin qu’elle soit disponible pour créé de nouvelle instance.

Notes

[1] c’est à dire avec / sur le disque local éphémère

 

Je cherchais un truc simple pour faire un unique rebond ssh sur la machine portail d’une plate-forme et utilisable avec CsshX que j’utilise. Et bien voila j’ai trouvé cela il y à quelque temps, rien de nouveau sous le soleil, merci netcate. Parfois il est nécéssaire de relire les doc des autres pour ce rafraîchir la mémoire.

rebond ssh automatique via netcat

Perso j’ai introduit un méta caractère dans ma règle ssh de mon fichier config pour m’éviter de dupliquer des informations. Le tips cible donc uniquement les serveurs comportant « web » dans leur hostname.

Host <span style="color: #000000; font-weight: bold;">*</span>-web<span style="color: #000000; font-weight: bold;">*</span> User root ProxyCommand <span style="color: #c20cb9; font-weight: bold;">ssh</span> gate <span style="color: #ff0000;">&quot;nc `basename %h ` %p&quot;</span> IdentityFile ~<span style="color: #000000; font-weight: bold;">/</span>.<span style="color: #c20cb9; font-weight: bold;">ssh</span><span style="color: #000000; font-weight: bold;">/</span>karles<span style="color: #000000; font-weight: bold;">@</span>boulot.id-dsa

Du coup pour lancer CsshX et avoir un terminal d’ouvert sur chacun des serveurs d’un pool au travers d’un rebond sur la machine portal c’est des plus simple

CsshX frontal-web1 frontal-web2 frontal-web3 frontal-web4 frontal-web5

Attention, si je ferme brutalement CsshX, les processus nc on tendance à rester sur la machine portail.

 

Encore un petit billet aide mémoire pour le poisson rouge que je suis. J’utilise cet outil git à mon travail git-osx-installer

 

Un billet aide mémoire pour ma pomme. Un peu marre de chercher la version de unison uniquement en ligne de commande à chaque fois que je fais une installation de mac. Une version bien utile pour scripter la synchronisation de répertoire et de système de fichier entre deux mac ou linux distant à la mode dropbox. L’intérêt étant d’avoir du versioning en plus comme avec Time Machine. Bref vous aurez compris c’est pas aussi graphiquement fun que dropbox et Time Machine mais pour un bricoleur c’est indispensable.

Donc c’est sur cette page http://www.cs.haifa.ac.il/~shuly/unison/

© 2012 Karlesnine Suffusion theme by Sayontan Sinha