Bonsoir

J'utilise un thème de superkaramba et je voudrais afficher mon IP mais ça ne marche pas

Voici la ligne qui doit donner l'IP

text x=80 y=200 sensor=program program="/sbin/ip addr show eth0 | grep 'inet ' | cut -d t -f2 | cut -d / -f1 | cut -b 2-" color=255,255,255 font="Neuropol" fontsize=11

J'ai aussi trouvé un autre petit programme que voici

#!/usr/bin/perl

$net = `/sbin/ifconfig | grep 'eth0'`;
if (length($net))
{
        $net = `/sbin/ifconfig eth0 | grep 'inet addr'`;
        if (!length($net))
        {
           $net = `/sbin/ifconfig eth0 | grep 'inet end.'`;
        }
        if (length($net))
        {
           chop($net);
           @netip = split/:/,$net;
           $netip[1] =~ /(\d{1,3}).(\d{1,3}).(\d{1,3}).(\d{1,3})/;
           $ip = $1 .".". $2 .".". $3 .".". $4;
           print "". $ip ."\n";
        }
        else
        {
           print "Not Found\n";
        }
}
else
{
   print "Error\n";
}

La première ligne me donne l'adresse mac de ma carte réseau mais rien pour les autres ligne de recherche avec ifconfig.

Je voudrais bien un peu d'aide si quelqu'un a une idée sur ce petit problème.

merci


--
Cyrille Maiche

Debian Etch 2.6.15

------------------------------------
http://clcr94.clg.ac-creteil.fr
------------------------------------


--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.net/?DebianFrench Vous pouvez aussi ajouter le mot ``spam'' dans vos champs "From" et
"Reply-To:"

To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Répondre à