[FYI] サーバーの状態を知る
WEBサーバの過負荷を調べようと思って組んだシェルスクリプトを公開。
60秒で1ループして150回(2時間30分)分計測してテキストに吐き出します。
ポートは80と3306,プロセスはhttpdに関してセッションの数を吐き出しています。
ま、使う人は少ないでしょうけど(笑)
WEBサーバの過負荷を調べようと思って組んだシェルスクリプトを公開。
60秒で1ループして150回(2時間30分)分計測してテキストに吐き出します。
ポートは80と3306,プロセスはhttpdに関してセッションの数を吐き出しています。
ま、使う人は少ないでしょうけど(笑)
cacti等のsnmp監視ソフトを利用していると /var/log/messages が下記のようにとんでもない事になります。
Sep 27 17:00:02 web01 snmpd[2359]: Received SNMP packet(s) from UDP: [192.168.0.254]:35679
Sep 27 17:00:02 web01 snmpd[2359]: Connection from UDP: [192.168.0.254]:35679
Sep 27 17:00:02 web01 snmpd[2359]: Connection from UDP: [192.168.0.254]:45744
Sep 27 17:00:02 web01 snmpd[2359]: Received SNMP packet(s) from UDP: [192.168.0.254]:45744
Sep 27 17:00:02 web01 snmpd[2359]: Connection from UDP: [192.168.0.254]:45744
それだけならともかく、rsyslog 等で転送していると憂鬱になるレベルのログが溜まりました。先日のrsyslog監視ツールでの負荷も馬鹿になりません。
凄まじく鬱陶しいので、対応するとします。
設定ファイルの場所が少しずつ違うので以下、OSごとに書きました。
# yum -y install “memcached*”
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: rsync.atworks.co.jp
* extras: rsync.atworks.co.jp
* rpmforge: ftp-stud.fht-esslingen.de
* updates: rsync.atworks.co.jp
Setting up Install Process
No package memcached* available.
Nothing to do
rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm 入れてるのになぁ…
CentOS が rsyslog 標準になりました。 それにより syslog がデータベースへ保存できるようになったのですが、常時監視するのは手間が掛かってめんどくさいと思います。 そこでPHPで監視するプログラムを書… 続きを読む »SyslogMonitor for mysql + rsyslog ver 1.0 (PHP4or5)
古いサーバに rsyslog をコンパイルしてインストールしようとしたらこんなエラーが。
CPPFLAGS=”-I/usr/include -I/usr/local/mysql/include -I/usr/local/include” LDFLAGS=”-L/usr/lib -L/usr/local/mysql/lib” PATH=$PATH:/usr/local/mysql/bin ./configure –enable-mysql –enable-mail –enable-imfile –enable-omstdout ; make
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for a thread-safe mkdir -p… /bin/mkdir -p
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking for style of include used by make… GNU
checking for gcc… gcc
checking whether the C compiler works… yes
・
・
・
../runtime/.libs/librsyslog.a(librsyslog_la-wti.o): In function `wtiCancelThrd’:
/root/src/rsyslog-4.6.5/runtime/wti.c:181: undefined reference to `ATOMIC_STORE_1_TO_INT’
collect2: ld returned 1 exit status
make[2]: *** [rsyslogd] Error 1
make[2]: Leaving directory `/root/src/rsyslog-4.6.5/tools’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/src/rsyslog-4.6.5′
make: *** [all] Error 2
[環境]
CentOS release 5.2 (Final)
Linux test.test.local 2.6.18-92.1.22.el5PAE #1 SMP Tue Dec 16 12:36:25 EST 2008 i686 i686 i386 GNU/Linux
最近syslogを監視していると、ftpとpopへのアタックが非常に多いようです。
SSHは昔からあったけど、どうしてpopが増えたんでしょうね?
CentOS 6.0で denyhost をインストールしようとすると、今現在(2011/08/04)は yum でインストールできません。
yumを実行したらこんなエラーが出ました。
転送途中でコケたせいでしょうか?
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
The program yum-complete-transaction is found in the yum-utils package.