Linux за българи: Форуми

Linux секция за напреднали => Хардуерни и софтуерни проблеми => Темата е започната от: sys7em в Oct 16, 2005, 15:03



Титла: Чертане на графики от tc с mrtg
Публикувано от: sys7em в Oct 16, 2005, 15:03
Значи как може да се извлекат годни данни от shaper и да се начертаят с mrtg? Всмисъл за всеки клас да се начертят в графика. В нета има някакви perl-ски решения, но нито едно от тях не сработи както трябва

Някой да има идея ллл :crazy:  :zzz:  :huh:


Титла: Чертане на графики от tc с mrtg
Публикувано от: romeo_ninov в Oct 16, 2005, 18:31
Всъщност в mrtg графиките се чертаят чрез библиотеката gd. Потърси инфо за нея.


Титла: Чертане на графики от tc с mrtg
Публикувано от: VladSun в Oct 16, 2005, 23:11
еми ако и кажеш как ти работи шейпинга - iptables MARK, БГ/ИНТ, UPLOAD/DOWNLOAD имаш ли ?


Титла: Чертане на графики от tc с mrtg
Публикувано от: George Andonov в Oct 17, 2005, 11:22
За да нарисуваш графика с MRTG, може да използваш External Monitoring Scripts, който да извлича необходимите ти данни и ги подаваш на MRTG-то.

Въпросният script трябва да връща 4 стоиности, както е написано в документацията  ;)
Примерен код
External Monitoring Scripts

If you want to monitor something which does not provide data via snmp you can use some external program to do the data gathering.

    The external command must return 4 lines of output:

Line 1 - current state of the first variable, normally 'incoming bytes count'
Line 2 - current state of the second variable, normally 'outgoing bytes count'
Line 3 - string (in any human readable format), telling the uptime of the target.
Line 4 -  string, telling the name of the target.

Depending on the type of data your script returns you might want to use the 'gauge' or 'absolute' arguments for the Options keyword.

  Example:
   Target[myrouter]: `/usr/local/bin/df2mrtg /dev/dsk/c0t2d0s0`

Note the use of the backticks (`), not apostrophes (') around the command.

If you want to use a backtick in the command name this can be done but you must escape it with a backslash ...

If your script does not have any data to return but does not want mrtg to complain about invalid data, it can return 'UNKNOWN' instead of a number. Note though that only rrdtool is realy equipped to handle unknown data well.


Създаваш Target за всеки клас:
  Target[class-1]: `/.../script class1`
   ...
  Target[class-2]: `/.../script class2`
   ...
  Target[class-3]: `/.../script class3`
   ...
 и т.н.