Výsledky 1 až 2 z 2

Téma: [perl] - neajkej divnej bug v hotsanic

  1. #1
    Senior Member
    Založen
    08.10.2002
    Bydliště
    Mělník
    Věk
    44
    Příspěvky
    1 275
    Vliv
    290

    Standardní [perl] - neajkej divnej bug v hotsanic

    mam problemek. nainstalil sem Hotsanic, meri a kresli grafy, ale nefunguje mereni dat prenesenych po siti. do logu to pise ze hodnota namere is not a simple integer

    Kód:
    1076182112: : unable to update `192.168.3.254_eth0.rrd': not a simple integer: '50077915
    '
    1076182122: : unable to update `192.168.3.254_eth0.rrd': not a simple integer: '50087148
    '
    1076182132: : unable to update `192.168.3.254_eth0.rrd': not a simple integer: '50100183
    '
    je tam divne odratkovani jako by to cpalo \n za cislo, tak jsem kouknul tam kde se to kresli a zjistil ze to parsuje /proc/net/dev
    touto funkci. pruser dela to cislo output. kdyz to nahradim cislem je to ok takze uz nekde pred tim se to kazi.

    Kód:
     open(IN,"/proc/net/dev");
      while&#40;<IN>&#41; &#123;
        chomp;
        if &#40; /&#58;/ &#41; &#123;
          my &#40;$combined, $a, undef, undef, undef, undef, undef, undef, $output, $e&#41;=split;
          &#40;$name, $input&#41;=split&#40;"&#58;",$combined&#41;;
          if&#40;!$input&#41; &#123; &#40;$input, $output&#41; = &#40;$a, $e&#41;; &#125;
          $devin&#123;$name&#125;=$input;
          $devout&#123;$name&#125;=1000;      #$output;
          $sampletime&#123;$name&#125;=time;
          &#125;
        &#125;
      close&#40;IN&#41;;
    v proc net dev je neco takovehoto

    Kód:
    Inter-|   Receive                                                |  Transmit
     face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
        lo&#58;148334339  591589    0    0    0     0          0         0 148334339  591589    0    0    0     0       0          0
     dummy&#58;       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
      eth0&#58;3168642959 135904059    0    0    0     0          0         0 52665557 132310971    0    0    0     0       0          0
      eth1&#58;3381235504 208210865    0    0    0     0          0         0 4043680851 189054283    0    0    0     0       0          0
    tohle by to melo onen radek rozparsovat dobre ale zrejme ne a pridava to tam odradkovani

    $combined, $a, undef, undef, undef, undef, undef, undef, $output, $e)=split;

    nevite nekdo co stim? ja perlu moc nehovim
    CASE Chieftec DX-01B-D { GIGABYTE X48 DS5 { Intel q9300 + 8GB + ATI x1600 + 2x Seagate ES2 1TB } + LiteOn SHM-165P6S} } + 21" Samsung SyncMaster 215TW

  2. #2
    Senior Member
    Založen
    08.10.2002
    Bydliště
    Mělník
    Věk
    44
    Příspěvky
    1 275
    Vliv
    290

    Standardní

    hmmm tak v prubehu jak sme to psal me napadlo neco a uz to funguje

    do
    Kód:
    my &#40;$combined, $a, undef, undef, undef, undef, undef, undef, $output, $e&#41;=split;
    jsem pripsal jedno undef nakonec

    Kód:
    my &#40;$combined, $a, undef, undef, undef, undef, undef, undef, $output, $e, undef&#41;=split;
    a uz to jede jak ma

    dik za spolupraci pomaha mi i si o tom napsat
    CASE Chieftec DX-01B-D { GIGABYTE X48 DS5 { Intel q9300 + 8GB + ATI x1600 + 2x Seagate ES2 1TB } + LiteOn SHM-165P6S} } + 21" Samsung SyncMaster 215TW

Informace o tématu

Users Browsing this Thread

Toto téma si právě prohlíží 1 uživatelů. (0 registrovaných a 1 anonymních)

Pravidla přispívání

  • Nemůžete zakládat nová témata
  • Nemůžete zasílat odpovědi
  • Nemůžete přikládat přílohy
  • Nemůžete upravovat své příspěvky
  •