10 juillet 2007

Nagios2 sur Debian 4.0

installation de debian etch via le réseau système de base seulement

ajout de contrib et non-free dans /etc/apt/sources.list

en root:

apt-get install nagios2 nagios-images nagios-plugins nagios2-doc openssh-server

On obtient typiquement quelque chose de ce type:
PDBL:~# apt-get install nagios2 nagios-images nagios-plugins nagios2-doc openssh-server
Reading package lists... Done
Building dependency tree... Done
openssh-server is already the newest version.
The following extra packages will be installed:
fping libnet-snmp-perl libradius1 nagios-plugins-basic
nagios-plugins-standard nagios2-common qstat radiusclient1 snmp
Suggested packages:
libcrypt-des-perl libdigest-hmac-perl libdigest-sha1-perl
libio-socket-inet6-perl nagios-text nagios nagios-nrpe-plugin
The following NEW packages will be installed:
fping libnet-snmp-perl libradius1 nagios-images nagios-plugins
nagios-plugins-basic nagios-plugins-standard nagios2 nagios2-common
nagios2-doc qstat radiusclient1 snmp
0 upgraded, 13 newly installed, 0 to remove and 1 not upgraded.
Need to get 0B/6020kB of archives.
After unpacking 14.9MB of additional disk space will be used.

cd /etc/nagios2/
htpasswd -c htpasswd.users nagiosadmin

!!!! si on choisit un autre nom d'utilisateur que nagiosadmin,
il faut faire le changement dans /etc/nagios2/cgi.cfg

Pour pouvoir lancer des vérifications de puis l'interface graphique

chown nagios.www-data /var/lib/nagios2/
chown nagios.www-data /var/lib/nagios2/rw/

chmod u+rwx /var/lib/nagios2/rw/
chmod g+rwx /var/lib/nagios2/rw/

chmod g+s /var/lib/nagios2/
chmod g+s /var/lib/nagios2/rw/

----------------------------------------------------

quand on fait une modification dans un des fichiers de configuration,
on peut vérifier que tout est ok en faisant:

/usr/sbin/nagios2 -v /etc/nagios2/nagios.cfg

afin de pouvoir lancer des checks depuis l'interface web:

dans /etc/nagios2/nagios.cfg

check_external_commands=1 (mis à 0 par défaut)

---------------------------------------------------

Monitoring d'une machine windows:

  • sur la machine windows il faut installer un client

Installing the Windows Agent

Before you can begin monitoring private services and attributes of Windows machines,
you'll need to install an agent on those machines. I recommend using the NSClient++ addon, which can be found at http://sourceforge.net/projects/nscplus. These instructions will take
you through a basic installation of the NSClient++ addon, as well as the configuration
of Nagios for monitoring the Windows machine.

1. Download the latest stable version of the NSClient++ addon from http://sourceforge.net/projects/nscplus

2. Unzip the NSClient++ files into a new C:\NSClient++ directory

3. Open a command prompt and change to the C:\NSClient++ directory

4. Register the NSClient++ system service with the following command:

 nsclient++ /install

5. Install the NSClient++ systray with the following command ('SysTray' is case-sensitive):

 nsclient++ SysTray

6. Open the services manager and make sure the NSClientpp service is allowed to interact
with the desktop (see the 'Log On' tab of the services manager). If it isn't already allowed
to interact with the desktop, check the box to allow it to.

7. Edit the NSC.INI file (located in the C:\NSClient++ directory) and make the following changes:

  • Uncomment all the modules listed in the [modules] section, except for CheckWMI.dll and RemoteConfiguration.dll
  • Optionally require a password for clients by changing the 'password' option in the [Settings] section.
  • Uncomment the 'allowed_hosts' option in the [Settings] section. Add the IP address of the Nagios server to this line, or leave it blank to allow all hosts to connect.
  • Make sure the 'port' option in the [NSClient] section is uncommented and set to '1248' (the default port).
voilà un exemple de fichier de config NSC.INI fonctionnel:

[modules]
;# NSCLIENT++ MODULES
;# A list with DLLs to load at startup.
; You will need to enable some of these for NSClient++ to work.
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
; * *
; * N O T I C E ! ! ! - Y O U H A V E T O E D I T T H I S *
; * *
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
NSClientListener.dll
NRPEListener.dll
SysTray.dll
CheckEventLog.dll
CheckHelpers.dll
;
; CheckWMI IS AN EXTREM EARLY IDEA SO DONT USE FOR PRODUCTION ENVIROMNEMTS!
;CheckWMI.dll
;
; RemoteConfiguration IS AN EXTREM EARLY IDEA SO DONT USE FOR
PRODUCTION ENVIROMNEMTS!
;RemoteConfiguration.dll

[Settings]
;# OBFUSCATED PASSWORD
; This is the same as the password option but here you can store the password
in an obfuscated manner.
; *NOTICE* obfuscation is *NOT* the same as encryption, someone with access
to this file can still figure out the
; password. Its just a bit harder to do it at first glance.
;obfuscated_password=Jw0KAUUdXlAAUwASDAAB
;
;# PASSWORD
; This is the password (-s) that is required to access NSClient remotely.
If you leave this blank everyone will be able to access the daemon remotly.
password=test
;# ALLOWED HOST ADDRESSES
; This is a comma-delimited list of IP address of hosts that are allowed to talk
; to the all daemons.
; If leave this blank anyone can access the deamon remotly (NSClient still requires
; a valid password).
; The syntax is host or ip/mask so 192.168.0.0/24 will allow anyone on that
; subnet access
allowed_hosts=172.16.0.0/16
;
;# USE THIS FILE
; Use the INI file as opposed to the registry if this is 0 and the use_reg in the
; registry is set to 1
; the registry will be used instead.
use_file=1

[log]
;# LOG DEBUG
; Set to 1 if you want debug message printed in the log file (debug messages
; are always printed to stdout when run with -test)
debug=1
;
;# LOG FILE
; The file to print log statements to
file=NSC.log
;
;# LOG DATE MASK
; The format to for the date/time part of the log entry written to file.
date_mask=%Y-%m-%d %H:%M:%S


[NSClient]
;# ALLOWED HOST ADDRESSES
; This is a comma-delimited list of IP address of hosts that are allowed to talk
; to NSClient deamon.
; If you leave this blank the global version will be used instead.
allowed_hosts=172.16.27.43
;
;# NSCLIENT PORT NUMBER
; This is the port the NSClientListener.dll will listen to.
port=1248
;
;# BIND TO ADDRESS
; Allows you to bind server to a specific local address.
;This has to be a dotted ip adress not a hostname.
; Leaving this blank will bind to all avalible IP adresses.
bind_to_address=


[Check System]
;# CPU BUFFER SIZE
; Can be anything ranging from 1s (for 1 second) to 10w for 10 weeks.
; Notice that a larger buffer will waste memory
; so don't use a larger buffer then you need (ie. the longest check you do +1).
;CPUBufferSize=1h
;
;# CHECK RESOLUTION
; The resolution to check values (currently only CPU).
; The value is entered in 1/10:th of a second and the default is 10
; (which means ones every second)
;CheckResolution=10

[NRPE]
;# NRPE PORT NUMBER
; This is the port the NRPEListener.dll will listen to.
;port=5666
;
;# COMMAND TIMEOUT
; This specifies the maximum number of seconds that the NRPE
; daemon will allow plug-ins to finish executing before killing them off.
;command_timeout=60
;
;# COMMAND ARGUMENT PROCESSING
; This option determines whether or not the NRPE daemon will
;allow clients to specify arguments to commands that are executed.
;allow_arguments=0
;
;# COMMAND ALLOW NASTY META CHARS
; This option determines whether or not the NRPE daemon will allow clients to specify nasty (as in |`&><'"\[]{}) characters in arguments. ;allow_nasty_meta_chars=0 ; ;# USE SSL SOCKET ; This option controls if SSL should be used on the socket. ;use_ssl=1 ; ;# BIND TO ADDRESS ; Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. ; Leaving this blank will bind to all avalible IP adresses. ; bind_to_address= ; ;# ALLOWED HOST ADDRESSES ; This is a comma-delimited list of IP address of hosts that are allowed to talk to NRPE deamon. ; If you leave this blank the global version will be used instead. ;allowed_hosts= ; ;# SCRIPT DIRECTORY ; All files in this directory will become check commands. ; *WARNING* This is undoubtedly dangerous so use with care! ;script_dir=scripts\ [NRPE Handlers] ;# COMMAND DEFINITIONS ;# Command definitions that this daemon will run. ;# Can be either NRPE syntax: ;command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10 ;# Or simplified syntax: ;test=c:\test.bat foo $ARG1$ bar ;check_disk1=/usr/local/nagios/libexec/check_disk -w 5 -c 10 ;# Or even loopback (inject) syntax (to run internal commands) ;# This is a way to run "NSClient" commands and other internal module commands such as check eventlog etc. ;check_cpu=inject checkCPU warn=80 crit=90 5 10 15 ;check_eventlog=inject CheckEventLog Application warn.require.eventType=error warn.require.eventType=warning critical.require.eventType=error critical.exclude.eventType=info truncate=1024 descriptions ;check_disk_c=inject CheckFileSize ShowAll MaxWarn=1024M MaxCrit=4096M File:WIN=c:\ATI\*.* ;# But be careful: ; dont_check=inject dont_check This will "loop forever" so be careful with the inject command... ;# Check some escapings... ; check_escape=inject CheckFileSize ShowAll MaxWarn=1024M MaxCrit=4096M "File: foo \" WIN=c:\\WINDOWS\\*.*" ;# Some real world samples ;nrpe_cpu=inject checkCPU warn=80 crit=90 5 10 15 ;nrpe_ok=scripts\ok.bat

8. Start the NSClient++ service with the following command:

 nsclient++ /start

9. If installed properly, a new icon should appear in your system tray.

It will be a yellow circle with a black 'M' inside.

10. Success! The Windows server can now be added to the Nagios monitoring configuration...

  • sur le serveur nagios
créer un fichier avec toutes les machines windows

cd /etc/nagios2/conf.d/

cp host-gateway_nagios2.cfg host-windows_nagios2.cfg
vim host-windows_nagios2.cfg

renseigner le hostname, l'alias, l'adresse et le parent

rajouter le service:
optiplex:/etc/nagios2/conf.d# vim services_nagios2.cfg

# check that NSClient is up
define service {
host_name pc-simulation
service_description NS Client Version
check_command check_nt!CLIENTVERSION
use generic-service
notification_interval 0 ; set > 0 if you want to be renotified
}

dans /etc/nagios-plugins/config/nt.cfg s'assurer que le mot de passe défini
dans NSC.INI est bien présent (par défaut non)

command_line /usr/lib/nagios/plugins/check_nt -H $HOSTADDRESS$
-v $ARG1$ -s test (le -s test est à rajouter)

define service{
use generic-service
host_name winserver
service_description NSClient++ Version
check_command check_nt!CLIENTVERSION
}

Add the following service definition to monitor the uptime of the Windows server.

define service{
use generic-service
host_name winserver
service_description Uptime
check_command check_nt!UPTIME
}

Add the following service definition to monitor the CPU utilization on the
Windows server and generate a CRITICAL alert if the 5-minute CPU load
is 90% or more or a WARNING alert if the 5-minute load is 80% or greater.

define service{
use generic-service
host_name winserver
service_description CPU Load
check_command check_nt_cpuload!10,80,90,20,80,95,30,80,95
}

!!!!! Il faut rajouter ceci dans le fichier /etc/nagios-plugins/config/load.cfg
# 'check_nt_cpuload command definition
define command{
command_name check_nt_cpuload
command_line /usr/lib/nagios/plugins/check_nt -H $HOSTADDRESS$ -p 1248 -
s test -v CPULOAD -l $ARG1$
}

Add the following service definition to monitor memory usage
on the Windows server and generate a CRITICAL alert if memory
usage is 90% or more or a WARNING alert if memory usage is 80% or greater.

define service{
use generic-service
host_name winserver
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
}

Add the following service definition to monitor usage of the C:\ drive on
the Windows server and generate a CRITICAL alert if disk usage is 90%
or more or a WARNING alert if disk usage is 80% or greater.

define service{
use generic-service
host_name winserver
service_description C:\ Drive Space
check_command check_nt_disk!C!80!90
}

!!!!! Il faut rajouter ceci dans le fichier /etc/nagios/-plugins/config/disk.cfg
# 'check_nt_disk command definition
define command{
command_name check_nt_disk
command_line /usr/lib/nagios/plugins/check_nt -H $HOSTADDRESS$ -p 1248 -
s test -v USEDDISKSPACE -l $ARG1$ -w $ARG2$ -c $ARG3$
}

Add the following service definition to monitor the W3SVC service
state on the Windows machine and generate a CRITICAL alert if
the service is stopped.

define service{
use generic-service
host_name winserver
service_description W3SVC
check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
}

Add the following service definition to monitor the Explorer.exe process
on the Windows machine and generate a CRITICAL alert if the process
is not running.

define service{
use generic-service
host_name winserver
service_description Explorer
check_command check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
}
----------------------------------------------------------------

monitoring de "switches" et routeurs


Creating Required Definitions

You'll need to create some object definitions in order to monitor a new switch.
These definitions can be placed in their own file or added to an already exiting
object configuration file.

First, its best practice to create a new template for each different type of host
you'll be monitoring. Let's create a new template for switches.

define host{ name generic-switch ; The name of this host template use generic-host ; Inherit default values from the generic-host template check_period 24x7 ; By default, switches are monitored round the clock check_interval 5 ; Switches are checked every 5 minutes retry_interval 1 ; Schedule host check retries at 1 minute intervals max_check_attempts 10 ; Check each switch 10 times (max) check_command check-host-alive ; Default command to check if routers are "alive" notification_period 24x7 ; Send notifications at any time notification_interval 30 ; Resend notifications every 30 minutes notification_options d,r ;
Only send notifications for specific host states contact_groups admins ; Notifications get sent to the admins by default register 0 ; DONT REGISTER THIS - ITS JUST A TEMPLATE }

Notice that the switch template definition is inheriting default values from the generic-host template, which is defined in the sample localhost.cfg file.

Next, define a new host for the switch that references the newly created generic-switch host template.

define host{ use generic-switch ; Inherit default values from a template host_name linksys-srw224p ; The name we're giving to this switch alias Linksys SRW224P Switch ; A longer name associated with the switch address 192.168.1.253 ; IP address of the switch hostgroups allhosts ; Host groups this switch is associated with }

Add an optional hostgroup for switches. This is useful if you create additional switches in the future and want to view them together in the CGIs. It can also be useful for object definition tricks that you can use to manage larger configurations later on.

define hostgroup{ hostgroup_name switches ; The name of the hostgroup alias Network Switches ; Long name of the group members linksys-srw224p ; Comma separated list of hosts that belong to this group }

The linksys-srw224p host will be a member of two hostgroups - allhosts (which is referenced in the host definition and defined in localhost.cfg) and switches (which is defined above).

Monitoring Packet Loss and RTA

Now its time to define some services that should be associated with the switch. First off, we should monitor packet loss and round trip average between the Nagios host and the switch.
This can be accomplished by using the check_ping plugin. A command definition for using the check_ping plugin that has been defined in the commands.cfg file. That command definition looks like this...

define command{ command_name check_ping command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5 }

Let's create a service called PING as follows...

define service{ use generic-service ; Inherit values from a template host_name linksys-srw224p ; The name of the host the service is associated with service_description PING
; The service description check_command check_ping!200.0,20%!600.0,60%
; The command used to monitor the service normal_check_interval 5
; Check the service every 5 minutes under normal conditions retry_check_interval 1
; Re-check the service every minute until its final/hard state is determined }

Notice that the check_command directive is passing "200.0,20%" and "600.0,60%" to the check_ping command, where they are substituted for the $ARG1$ and $ARG2$ macros, respectively. This means that the PING service will be:

  • CRITICAL if the round trip average (RTA) is greater than 600 milliseconds or the packet loss is 60% or more
  • WARNING if the RTA is greater than 200 ms or the packet loss is 20% or more
  • OK if the RTA is less than 200 ms and the packet loss is less than 20%

Monitoring SNMP Status Information

If your switch or router supports SNMP, you can monitor a lot of information by using the check_snmp plugin. A command definition for using the check_snmp plugin that has been defined in the commands.cfg file. That command definition looks like this...

define command{ command_name check_snmp command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$ }

Monitoring the uptime of a switch is fairly common. A service definition that would accomplish that looks like this...

define service{ use generic-service ; Inherit values from a template host_name linksys-srw224p service_description Uptime check_command check_snmp!-C public -o sysUpTime.0 }

The check_command directive will pass the "-C public -o sysUpTime.0" options to the $ARG1$ macro in the check_snmp command definitions. The "-C public" tells the plugin that the SNMP community name is "public" and the "-o sysUpTime.0" is the OID that we want to check.

If you want to ensure that a specific port/interface on the switch is in an up state, you could create a service definition like this:

define service{ use generic-service ; Inherit values from a template host_name linksys-srw224p service_description Port 1 Link Status check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB }

In the example above, the "-o ifOperStatus.1" refers to the OID for the operational status of port 1 on the switch. The "-r 1" option tells the check_snmp plugin to return an OK state if "1" is found in the SNMP result (1 indicates an "up" state on the port) and CRITICAL if it isn't found. The "-m RFC1213-MIB" is optional and tells the check_snmp plugin to only load the "RFC1213-MIB" instead of every single MIB that's installed on your system, which can help speed things up.

That's it for the SNMP monitoring example. There are a million things that can be monitored via SNMP, so its up to you to decide what you need and want to monitor. Good luck!

Tip: You can usually find the OIDs that can be monitored on a switch by running the following command (replace 192.168.1.253 with the IP address of the switch): snmpwalk -v1 -c public 192.168.1.253 -m ALL .1

04 juillet 2007

helo mal configuré sur serveur exim4

LE problème:

Testing HELO configuration

One way of testing whether your mail server is misconfigured is to send an email through it to helocheck@cbl.abuseat.org. You will get a virtually immediate rejection.

In other words, you will get bounce message back that appears to indicate that your email to helocheck didn't work. It did. It's _supposed_ to work that way. The important piece to check is the error message you see.

Examine the error message, and you should see something like one of the following lines:

#5.1.1 SMTP; 550 Your HELO name for IP address 1.2.4.6 was "localhost.localdomain"
#5.1.1 SMTP; 550 Your HELO name for IP address 1.2.4.6 was "localhost"
#5.1.1 SMTP; 550 Your HELO name for IP address 1.2.4.6 was "smtp"
#5.1.1 SMTP; 550 Your HELO name for IP address 1.2.4.6 was "1.2.4.6"
#5.1.1 SMTP; 550 Your HELO name for IP address 1.2.4.6 was "[1.2.4.6]"
#5.1.1 SMTP; 550 Your HELO name for IP address 1.2.4.6 was "mail.example.com"

It should be the fully qualified domain name for your mail server or an IP address enclosed in square brackets.

In the above example, the first four examples are syntactically wrong by RFC2821. The last two are valid.

If it isn't like one of the last two examples, you have found the problem that needs to be fixed.

If the HELO you see from "helocheck" is a fully qualified domain (such as "mail.example.com"), your mail server software is configured correctly, but something else in your environment is attempting to send email, and you need to hunt it down. Check for sender verify code, challenge/response or proxy trojans (common on certain flavours of web servers). Eg: check the running tasks for anything you don't immediately recognize.

Please don't contact us and say "but our mail server software isn't doing it". It may not be, but SOMETHING at the listed IP IS.

Hit the browser button to see hints on how to fix this.


La solution:


rajouter la variable

primary_hostname = name.domain

avant la ligne

domainlist local_domains = DEBCONF.....


dans le fichier /etc/exim4/exim4.conf.template

et puis faire un


dpkg-reconfigure exim4-config




29 juin 2007

impression qualité photo epson r800


il faut absolument aller dans les options avancées et sélectionner le bon papier et la bonne qualité:

Capture d'écran sous macosx

tiré de wikipedia (excellentissime)

MacOSX offre plusieurs possibilités pour réaliser une capture d'écran :

Combinaisons de touches :

  • majuscule - commande (touche pomme) - 3(pas sur le pavé numérique) capturera l'écran entier, et placera le résultat dans un fichier Image x.png (où x est un chiffre). Si vous utilisez une configuration multi-écrans, un fichier par écran sera créé.
  • majuscule - commande (touche pomme) - 4(pas sur le pavé numérique) fera apparaitre une croix permettant de délimiter la zone de l'écran à capturer. Une pression sur la barre espace transformera cette croix en appareil photo, permettant de prendre une capture d'un élément de l'écran (menu, fenêtre, dock ...). L'élément qui sera capturé est mis en surbrillance lors du passage de la souris.

Si vous appuyez sur la touche contrôl (ctrl) lors de la capture, le résultat ne sera pas stocké dans un fichier, mais dans le presse papier. Vous pourrez alors le coller dans n'importe quelle application acceptant les images.

Sous Mac OS X 10.4 "Tiger", le format par défaut des fichiers créés est le PNG. Il est possible de modifier ce format, mais cela nécessite une manipulation en ligne de code : dans le Terminal, entrez :

defaults write com.apple.screencapture type format

format peut êre BMP (Windows bitmap), GIF, JPEG 2000, JPEG, PDF, PICT, PNG, PSD, SGI, TGA & TIFF.

Pour finir, entrez

killall SystemUIServer

pour redémarrer le serveur graphique (c'est totalement invisible et immédiat). Vous pouvez aussi relancer la session si vous n'aimez pas les lignes de commandes.

08 juin 2007

caractères de protection en bash

PROTECTION

Les protections (quoting) permettent de forcer l'interpréteur à ignorer la signification spéciale de certains caractères ou mots. Les protections peuvent être utilisées pour empêcher le traitement des caractères spéciaux, éviter la reconnaissance des mots-réservés ou empêcher le développement des paramètres.

Tous les méta-caractères mentionnés dans le paragraphe DÉFINITIONS plus haut ont des significations spéciales pour le shell, et doivent être protégés pour garder leur propre valeur. Il y a trois mécanismes de protection : Le caractère d'échappement, les apostrophes (quote) et les guillemets (double-quote).

Un caractère backslash (\), quand il n'est pas protégé, représente le caractère d'échappement. Il préserve la valeur littérale du caractère qui le suit, à l'exception du . Si une séquence \ apparaît, et si le backslash n'est pas protégé, l'ensemble \ est considéré comme une continuation de ligne (autrement dit, il est ignoré).

Encadrer des caractères entre des apostrophes simples préserve la valeur littérale de chacun des caractères. Une apostrophe ne peut pas être placée entre deux apostrophes, même si elle est précédée d'un backslash.

Encadrer des caractères entre des guillemets préserve la valeur littérale de chacun des caractères sauf $, `, et \. Les caractères $ et ` conservent leurs significations spéciales, même entre guillemets. Le backslash ne conserve sa signification que lorsqu'il est suivi par $, `, ", \, ou . Un guillemet peut être protégé entre deux guillemets, à condition de le faire précéder par un backslash.

Les caractères spéciaux * et @ ont des significations spéciales lorsqu'ils se trouvent entre guillemets (voir le paragraphe PARAMÈTRES ci-dessous).

Les mots de la forme $'chaîne' sont traités différemment. Le mot est développé en chaîne avec les séquences d'échappement remplacées par les séquences standards du C ANSI:

\a
alerte (cloche alias bip)
\b
effacement arrière
\e
un caractère escape
\f
fin de page
\n
fin de ligne
\r
retour chariot
\t
tabulation horizontale
\v
tabulation verticale
\\
anti-slash
\nnn
le caractère dont le code ASCII en octal est nnn (un à trois chiffres)
\xnnn
le caractère dont le code ASCII en hexadécimal est nnn (un à trois chiffres)

Le résultat après traduction est protégé par des apostrophes comme si le symbole dollar n'avait pas été présent.

Une chaîne entre guillemets précédée d'un symbole dollar ($) sera traduite selon la localisation en vigueur. Si la locale courante est C ou POSIX, le symbole dollar est ignoré. Si la chaîne a subi une traduction ou des remplacements, le résultat est protégé par des guillemets.

01 juin 2007

reconfiguration de vmware

Au changement de noyaux, il faut reconfigurer vmware en lancant le script:
/usr/bin/vmware-config.pl

pour recompiler il faut installer les derniers headers
uname -a
apt-get install linux-headers-2.6.15-28-386

et préciser le chemin
/usr/src/linux-headers-2.6.15-28-386linux-headers-2.6.15-28-386/include
les machines virtuelles se trouvent dans le sous répertoire vm de mon home directory

22 mai 2007

monitoring du wifi: aircrack

apt-get install aircrack

pour capturer du traffic sur l'interface eth1 et le channel 3 et le sauvegarder dans un format lisible par wireshark/ethereal

sudo airodump eth1 wlantest 3

ensuite on lit le contenu de wlantest dans wireshark

monitoring du wifi: kismet

apt-get install kismet

éditer le fichier de config:

vi /etc/kismet/kismet.conf

changer 4 lignes:
suiduser=hanoteau (mettre à la place de hanoteau votre utilisateur)
source=ipw2200,eth1,ipw2200 (pour mon latitude D610 avec centrino ipw2200 cfr lspci)
defaultchannels=IEEE80211b:1,7,13,2,8,3,9,4,10,5,11,6,12
defaultchannels=IEEE80211g:1,7,13,2,8,3,9,4,10,5,11,6,12

Pour le lancer:
sudo kismet

dans l'interface appuyer sur s pour lister les différents réseaux et pouvoir les sélectionner
h = help

15 mars 2007

Accélérer le Mac

Lorsque votre Mac se fait plus lent qu'à l'accoutumé, il est temps de d'exécuter ces 11 commandements :

  1. Supprimer des applications qui se lancent à l'ouverture de la session (Préférences Systèmes/Comptes/Ouverture)
  2. Désactiver l'accès universel, le Bluetooth et la reconnaissance vocale.
  3. Nettoyer les Préférences Systèmes "Autre".
  4. Contrôler la version du logiciel : éviter les applications tournant sous Rosetta.
  5. Supprimer le code superflu : les dernières applications contiennent le code destiné aux processeurs PowerPC et Intel. XSlimmer permet de ne garder que le code nécessaire à votre machine.
  6. Supprimer les langues qui vous sont inutiles à l'aide d'utilitaires comme Monolingual.
  7. Améliorer le refroidissement de votre Mac : Divers utilitaires permettent de contrôler la vitesse de rotation du ventilateur du processeur.
  8. Réduire le nombre de Widgets.
  9. Garder un oeil sur le Moniteur d'Activité (situé dans les utilitaires). Il permet de surveiller la charge du processeur et la disponibilité de la RAM.
  10. Nettoyer votre disque dur.
  11. Exécuter OnyX.
Les étapes à suivre sont détaillées sur le site Low End Mac

14 mars 2007

wpa supplicant et ms chap v2

copié du site: http://pthichat.net/index.php/Linux



Voici les différentes étapes de configuration pour utiliser le réseau WIFI de l'Université de Bretagne Occidentale sous Linux.

"Installation de wpa_supplicant"

Pour cela il suffit de télecharger le paquet wpa_supplicant pour votre distribution favorite. Pour les gens qui utilisent Debian

apt-get install wpa_supplicant

"Configuration du SSID"

Pour cela il faut préciser qu'on va utiliser le vlan enseignement et non pas le SSID wifiUBO (Saleté d'AP CISCO je me suis fait avoir).

iwconfig ath0 essid enseignement

"Configuration wpa_supplicant"

Le réseau wifi utilise le protocol 802.1x/PEAP/MS-ChapV2 pour cela veuillez renseigner le fichier wpa_supplicant.conf comme suit :

network={
ssid="enseignement"
key_mgmt=IEEE8021X
eap=PEAP
phase2="auth=MSCHAPV2"
identity="numero etudiant"
password="password"
}

"Lancement de wpa_supplicant"

Je vous laisse lire la doc de wpa_supplicant pour savoir quelles options utiliser (Dans mon cas ma carte wifi ath0 et j'utilise ndiswrapper avec le driver wext)

wpa_supplicant -Dwext -iath0 -c/etc/wpa_supplicant/wpa_supplicant.conf &

Il vous reste maintenant à lancer le dhcp et vous voila prêt a utiliser le wifi :)

dhclient ath0

28 février 2007

Config d'une IP sur un ap cisco 1242

enable
(passwd Cisco)
configure terminal
no logging console
interface bvi1
ip address 172.16.1.115 255.255.255.0
exit
exit
copy run start

connecteurs RF & microwave

Cisco vers antennes :


  • Reverse TNC mâle jack ->OK -> reverse TNC femelle plug


  • Reverse TNC mâle jack -> reverse TNC femelle plug/N femelle jack (adaptateur 7603400, 242131, be.farnell.com) -> N mâle plug/N mâle plug (câble 50cm 1056158, be.farnell.com) -> N femelle jack


Proxim vers antennes :


  • Reverse MMCX femelle ->voir anixter (1086-PGTL pigtail cable N mâle plug) -> N femelle jack/reverse TNC mâle jack ????? -> reverse TNC femelle plug


  • Reverse MMCX femelle -> voir anixter (1086-PGTL pigtail cable N mâle plug) -> N femelle jack


Zyxel/d-link vers antennes :


  • Reverse SMA mâle jack -> reverse SMA femelle plug/reverse TNC mâle jack ??? -> reverse TNC femelle plug


  • Reverse SMA mâle jack -> OK -> N femelle jack

--------------------------------------------------------------------------------------------


AP Cisco 1242 reverse TNC Male Jack
AP Proxim 4000 reverse MMCX Femelle
AP Zyxel 3000/570U Reverse SMA Male Jack
AP d-link 2000 Reverse SMA Male Jack

Antenne Cisco (2,2 dBi et Yagi) Reverse TNC femelle plug
Antenne proxim 1086 9.5 dBi, d-link 0800 8 dBi & 1080 8 dBi N femelle jack



21 janvier 2007

script conversion tif jpg (basename est mon ami)

#!/bin/bash

#for img in `ls *.TIF`
#do
# convert $img $img.jpg
#done
mkdir jpeg
FILES=$(ls *.tif)
echo $FILES
for i in $FILES; do
# sed -e 's/\.TIF.jpg$/\.jpg/';
# convert $i $i.jpg
convert $i `basename $i .tif`.jpg
# sed -e 's/\.tif.jpg/\.jpg/';
done

Files=$(ls *.TIF)
#echo $Files
for i in $Files; do
# sed -e 's/\.TIF.jpg$/\.jpg/';
convert $i `basename $i .TIF`.jpg
done
cp *.jpg jpeg/

21 décembre 2006

Extraction de cd soundjuicer

Par défaut sound juicer extrait au format ogg, si on veut extraire au format wav sans perte et codage alors il faut faire la modif suivante:

Sound Juicer/Edition/Préférences/Format de sortie/Editer les profils/Wav/Edition/Pipeline GStreamer
Il faut modifier les valeurs indiquées ci dessous :
audio/x-raw-int,rate=22050,channels=1 ! wavenc name=enc (par défaut)
audio/x-raw-int,rate=44100,channels=2 ! wavenc name=enc (aprés correction)

sinon sound juicer refuse de lier le pipeline

09 novembre 2006

Le défi proposé:

connecter un téléphone UTstarcomm (VoWiFi) sur un AP Cisco Aironet 1131AG IOS 12.3(8ja) avec la sécurité WPA

Les solutions:

avoir ces paramètres sur le point d'accès sinon aucune connexion possible

dot11 wpa handshake timeout 500
interface Dot11Radio0
no dot11 extension aironet
dot11 qos mode
no world-mode (dot11d country BE both) (à priori pas nécessaire)

24 octobre 2006

conversion ext2 vers ext3

Converting the / directory
First, think long and hard before deciding to convert the root directory. Ext3's primary purpose is shorter recovery from disaster rather than data loss prevention. Converting the root directory from Ext2 to Ext3 isn't difficult, but converting it back from Ext3 to Ext2 is a treacherous process fraught with problems. But, if you really must perform the Ext2 to Ext3 conversion on the root directory, here's how, assuming /dev/hda2 is mounted as the root directory and /dev/hda1 is mounted as /boot:

* Log in as root
* Edit /etc/fstab and change ext2 to ext3 on the line referencing the root directory.
* tune2fs -j /dev/hda2
* cd /boot
* mv initrd-2.4.18-26.8.0.img initrd-2.4.18-26.8.0.img.ext2
* mkinitrd initrd-2.4.18-26.8.0.img 2.4.18-26.8.0
* reboot

In the preceding, you MUST perform all the steps, including the mkinitrd, before rebooting. Failing to perform all the steps before rebooting produces a "buried shovel" where if only you could boot the machine, you could run the mkinitrd command, and if only you could run the mkinitrd command, you could boot the machine.

23 octobre 2006

changer la configuration du clavier

Changement non persistant à la volée:

terminal: loadkeys be-latin1|us|uk|...

serveur X: setxkbmap

Persistant distribution spécifique:

RHEL : system-config-keyboard
Debian: dpkg-reconfigure console-data

20 octobre 2006

Wine basics

Wine Quickstart Guide

This Quickstart Guide will help you to get Wine running. Make sure you have Wine installed. If you don't check this page on installing Wine: http://winehq.org/site/docs/wineusr-guide/getting-wine

Installing an application

In this guide I will show you how to install MS Office 97.
In order to install an application you must know the name of the file to run and the location of the file.
In this example I must run setup.exe which is loacted in /media/cdrom.
To install Office I must run the following command:

$ wine /media/cdrom/setup.exe

The application will now be installed.




Running an application

The application will be installed in a directory called .wine in your HOME directory. If your file manager doesn't show this directory make sure that it shows hidden files/directories (.wine is a hidden directory).

Office is installed in ~/.wine/drive_c/Program Files/Microsoft Office/Office
If I want to run Word I must type the following lines:

$ cd ~/.wine/drive_c/Program Files/Microsoft\ Office/Office
$ wine winword.exe




It might be a good idea to create a file that launches Word. It could look like this:

#/bin/sh
cd ~/.wine/drive_c/Program Files/Microsoft\ Office/Office
wine winword.exe

Save this as word.sh in ~/bin and make it executable by typing chmod +x word.sh
You can now start Word by typing word.sh

04 octobre 2006

wpa supplicant

Authentification wi-fi sécurisée en Linux
- apt-get install wpasupplicant et wpagui

- créer fichier de config : par exemple : /etc/wpa_supplicant.conf
(voir plus bas en fonction de la méthode utilisée)

- mettre les certificats adéquat, par exemple dans : /etc/cert/*.*
client.p12 root.pem client.pem root.der

- lancer la commande :
wpa_supplicant -d -c/etc/wpa_supplicant.conf -ieth1 -Dwext

--> se lance en mode debugg
--> pour lancer en background : -B au lieu de -d
--> -Dwext dépend du driver utilisé faire un man de wpasupplicant

- lancer la commande :
wpa_gui

--> interface pour vérifier état de connexion et donner des paramètres complémentaires


--> il peut être nécessaire de faire un dhclient eth1 pour obtenir une adresse ip

--> il peut être nécessaire de définir l'interface par défaut (eth1 au lieu de eth0)

Exemples de configuration
---------------------------------------------------------
# WPA-PSK

ctrl_interface=/var/run/wpa_supplicant

network={
ssid="MULTITELWIFI"
key_mgmt=WPA-PSK
psk="*****************"
}
---------------------------------------------------------
--> OK
---------------------------------------------------------
# WPA-EAP/TLS

ctrl_interface=/var/run/wpa_supplicant

network={
ssid="MULTITELWIFI"
key_mgmt=WPA-EAP
eap=TLS
ca_cert="/etc/cert/root.pem"
private_key="/etc/cert/client.p12"
private_key_passwd="***************"
}
---------------------------------------------------------
--> promp pour le paramètre identity
sinon, on peut mettre en dur identity="username"
---------------------------------------------------------
# WPA-EAP/TTLS

ctrl_interface=/var/run/wpa_supplicant

network={
ssid="MULTITELWIFI"
key_mgmt=WPA-EAP
eap=TTLS
ca_cert="/etc/cert/root.pem"
}
---------------------------------------------------------
--> prompt pour les paramètre identity et password
sinon, mettre en dur :
---------------------------------------------------------
# WPA-EAP/TTLS avec paramètres dans le fichier pour éviter #prompt

ctrl_interface=/var/run/wpa_supplicant

network={
ssid="MULTITELWIFI"
key_mgmt=WPA-EAP
eap=TTLS
identity="******"
password="***********"
ca_cert="/etc/cert/root.pem"
}
---------------------------------------------------------
--> OK
---------------------------------------------------------
# WPA-EAP/PEAP

ctrl_interface=/var/run/wpa_supplicant

network={
ssid="MULTITELWIFI"
key_mgmt=WPA-EAP
eap=PEAP
ca_cert="/etc/cert/root.pem"
}
---------------------------------------------------------
--> OK
---------------------------------------------------------