Для этой этой цели в debian установим serverstats:
$ apt-get install serverstats
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
librrd4 rrdtool
Suggested packages:
librrds-perl
The following NEW packages will be installed:
librrd4 rrdtool serverstats
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 886kB of archives.
After this operation, 2298kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.de.debian.org lenny/main librrd4 1.3.1-4 [246kB]
Get:2 http://ftp.de.debian.org lenny/main rrdtool 1.3.1-4 [598kB]
Get:3 http://ftp.de.debian.org lenny/main serverstats 0.8.2-2 [41.9kB]
Fetched 886kB in 1s (448kB/s)
Selecting previously deselected package librrd4.
(Reading database ... 56173 files and directories currently installed.)
Unpacking librrd4 (from .../librrd4_1.3.1-4_amd64.deb) ...
Selecting previously deselected package rrdtool.
Unpacking rrdtool (from .../rrdtool_1.3.1-4_amd64.deb) ...
Selecting previously deselected package serverstats.
Unpacking serverstats (from .../serverstats_0.8.2-2_all.deb) ...
Setting up librrd4 (1.3.1-4) ...
Setting up rrdtool (1.3.1-4) ...
Setting up serverstats (0.8.2-2) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
librrd4 rrdtool
Suggested packages:
librrds-perl
The following NEW packages will be installed:
librrd4 rrdtool serverstats
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 886kB of archives.
After this operation, 2298kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.de.debian.org lenny/main librrd4 1.3.1-4 [246kB]
Get:2 http://ftp.de.debian.org lenny/main rrdtool 1.3.1-4 [598kB]
Get:3 http://ftp.de.debian.org lenny/main serverstats 0.8.2-2 [41.9kB]
Fetched 886kB in 1s (448kB/s)
Selecting previously deselected package librrd4.
(Reading database ... 56173 files and directories currently installed.)
Unpacking librrd4 (from .../librrd4_1.3.1-4_amd64.deb) ...
Selecting previously deselected package rrdtool.
Unpacking rrdtool (from .../rrdtool_1.3.1-4_amd64.deb) ...
Selecting previously deselected package serverstats.
Unpacking serverstats (from .../serverstats_0.8.2-2_all.deb) ...
Setting up librrd4 (1.3.1-4) ...
Setting up rrdtool (1.3.1-4) ...
Setting up serverstats (0.8.2-2) ...
На вопрос об удовлетворении зависимостей я нажал Y и Enter, либо можно ставить так:
$ apt-get install -y serverstats
тогда зависимости будут удовлетворяться молча и автоматически.
Теперь добавляем в crontab -e задачу:
* * * * * php -f /var/www/serverstats/update.phpДанная задача будет выполняться каждую минуту (для танкистов: это 60 раз в течении часа).
Теперь создаём виртуальный хост в Apache с указанием на папку /var/www/serverstats
и наблюдаем красивые графики загрузки процессора, свободной памяти и всякого прочего.
Комментариев нет:
Отправить комментарий