Schrift
[thread]4603[/thread]

Sys::Statistics::Linux (neu)

Leser: 1


<< >> 8 Einträge, 1 Seite
bloonix
 2006-12-08 10:26
#38960 #38960
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
Hallo Community,

heute Nacht habe ich ein neues bzw altes-neues Paket nach CPAN geladen.

CPAN:Sys::Statistics::Linux Version 0.01

Das Paket ist um einiges besser als CPAN:Linux::Statistics und soll dieses ablösen.

Mit den Modulen kann man für Linux Kernel 2.4 und 2.6 diverse System-
statistiken und Informationen sammeln. Wer das Paket sysstat (sar, iostat)
kennt und bisher Statistiken damit gesammelt hat, wird hier so einiges
wieder finden. :)

Es gibt im Verzeichnis "examples" des Pakets für jede Statistik ein kleines
Skript, was man nach Bedarf anpassen oder erweitern kann.

Gruss,
opi
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.
renee
 2007-01-11 13:01
#38961 #38961
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Eine "find"-Methode wäre nicht schlecht.

Ich habe Dir mal nen Patch geschrieben: http://rt.cpan.org/Public/Dist/Display.html?Name=Sys-Statistics-Linux
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/
bloonix
 2007-01-11 14:37
#38962 #38962
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
[quote=renee,11.01.2007, 12:01]Eine "find"-Methode wäre nicht schlecht.[/quote]
Klingt gut! Hatte mir über sowas schon gedanken gemacht. Auch das
Finden von Werten > Threshold.

BLOONIX - Status von 'neu' auf 'offen' geändert
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.
bloonix
 2007-01-11 14:41
#38963 #38963
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
Ich arbeite gerade auch an einem Modul um MySQL Statistiken
für MyISAM, InnoDB und globale Werte zu sammeln. Das
erweist sich als verdammt schwierig. Hat hier rein zufällig
jemand einen fertigen Parser für "show innodb status"?\n\n

<!--EDIT|opi|1168541561-->
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.
renee
 2007-01-11 14:47
#38964 #38964
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Nö, viel Spaß...

Das sieht nach 'ner Menge Arbeit aus, das zu Parsen...
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/
bloonix
 2007-02-25 20:27
#38965 #38965
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
Hallo Renee,

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use strict;
use warnings;
use Data::TreeDumper;
use Sys::Statistics::Linux;

my $options = {
  SysInfo   => 2,
  CpuStats  => 2,
  ProcStats => 2,
  MemStats  => 2,
  PgSwStats => 2,
  NetStats  => 2,
  SockStats => 2,
  DiskStats => 2,
  DiskUsage => 2,
  LoadAVG   => 2,
  FileStats => 2,
  Processes => 2,
};

my $thresholds = {
  LoadAVG   => { avg_1 => 'gt:20' },
  NetStats  => { ttbyt => 'gt:4000000' },
  PgSwStats => { pswpout => 'gt:1' },
  Processes => { cmd => 'eq:(apache2)' },
  CpuStats  => {
     total => 'gt:80',
     iowait => 'gt:20'
  },
  MemStats  => {
     swapusedper => 'gt:80',
     realfreeper => 'lt:10',
  },
  DiskUsage => {
     '/dev/md1' => {
        usageper => 'gt:80'
      }
  },
};

my $lxs = new Sys::Statistics::Linux;
$lxs->set($options);
$lxs->init();
sleep(1);
my $stats = $lxs->get();
my $hits  = $lxs->search($thresholds);
print DumpTree($hits);


`- Processes  [H1]
  |- 8786  [H2]
  |  `- cmd = (apache2)  [S3]
  |- 9784  [H4]
  |  `- cmd = (apache2)  [S5]
  |- 9798  [H6]
  |  `- cmd = (apache2)  [S7]
  |- 9799  [H8]
  |  `- cmd = (apache2)  [S9]
  |- 9800  [H10]
  |  `- cmd = (apache2)  [S11]
  |- 9801  [H12]
  |  `- cmd = (apache2)  [S13]
  `- 9802  [H14]
     `- cmd = (apache2)  [S15]


sinn der Methode ist, nach bestimmten Werten zu suchen und nur
die Matches zurück zu geben. Auf diese Weise ist es einfach, einige
Statistiken zu überwachen und gegebenfalls Warnmeldungen für alle
Treffer in %hits zu generieren.

Gruss,
opi

Edit: betrifft Release 0.09_06\n\n

<!--EDIT|opi|1172428227-->
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.
esskar
 2007-02-25 20:29
#38966 #38966
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
warum eigentlich ein neues modul? und keine neue version?
bloonix
 2007-02-25 20:32
#38967 #38967
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
[quote=esskar,25.02.2007, 19:29]warum eigentlich ein neues modul? und keine neue version?[/quote]
Weil wenn sich die Zeit bei mir ergibt, ich auch gerne mehr machen
möchte...

Sys::Statistics::Solaris
Sys::Statistics::Win32
Sys::Statistics::BSD

usw. oder sich vielleicht jemand hinreißen lässt, mitzuwirken.
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.
<< >> 8 Einträge, 1 Seite



View all threads created 2006-12-08 10:26.