Cacti spine 的安裝

Cacti spine 的安裝
最近裝了臺server用來對網絡設備進行準實時監控
系統組成
Centos5.2
mysql -4.1.22
php-4.6.4
apache2.1.2
cacti 0.8.7d
rrdtool 1.0.5 爲什麼還使用1.0.5呢,主要是這個版本集成了很多庫,安裝調試方便,而只是生成的圖稍微顆粒點,沒有多大的關係。
NET-snmp5.1.22
spine-0.8.7c
本來不打算安裝spine的,就使用cmd.php來完成數據採集,可是後來發現cmd.php採集存在很大的延遲,執行效率太低了。兩廂比較了一下,從添加device好到設備up,spine只需要不到一分鐘,而cmd等的時間較長,超過10分鐘。
當設備down後 2分鐘之內spine可以發出alert,而cmd可能需要10分鐘以上。
所以還是要使用spine
=========================
順便一提:最近因爲搞這個監控,找來找去到最後發現cacti的報警使用移動的郵箱最好了! 139的郵箱現在提供“郵件到達通知”而且是免費的,只要有郵件到達,就會有一個短消息給你。
2009年3月份139郵箱升級後,郵件到達通知可以有好多選擇,支持超長短信了。把接受到的郵件主題和內容作爲短信發送給你,長度達到350個字符!
使用139郵箱,實現cacti實時報警發送sms的很有效途徑,我覺得比網絡上現在那些所謂的pushmail及時、準確多了。關鍵是不用花錢!!
=========================
下載的是cacti-spine-0.8.7c
tar -zxvf ./tools/cacti-spine-0.8.7c.tar.gz 按照install文檔執行之!
[root@mycentos52 cacti-spine-0.8.7c]# aclocal
[root@mycentos52 cacti-spine-0.8.7c]# libtoolize --force
Using `AC_PROG_RANLIB' is rendered obsolete by `AC_PROG_LIBTOOL'
Putting files in AC_CONFIG_AUX_DIR, `config'.
[root@mycentos52 cacti-spine-0.8.7c]# autoconf
[root@mycentos52 cacti-spine-0.8.7c]# autoheader
[root@mycentos52 cacti-spine-0.8.7c]# automake
[root@mycentos52 cacti-spine-0.8.7c]# ./configure
-bash: ./configure: Permission denied
[root@mycentos52 cacti-spine-0.8.7c]# chmod 755 configure
[root@mycentos52 cacti-spine-0.8.7c]# ./configure
checking build system type... i686-redhat-linux-gnu
checking host system type... i686-redhat-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c

checking for mysql_init in -lmysqlclient_r... no
configure: error: MySQL libraries not found
下載 mysql的共享包
檢查安裝位置:
rpm -qlp  MySQL-shared-standard-4.1.22-0.rhel4.i386.rpm
/usr/lib/libmysqlclient.so
/usr/lib/libmysqlclient.so.15
/usr/lib/libmysqlclient.so.15.0.0
/usr/lib/libmysqlclient_r.so
/usr/lib/libmysqlclient_r.so.15
/usr/lib/libmysqlclient_r.so.15.0.0
/usr/lib/libndbclient.so
/usr/lib/libndbclient.so.2
/usr/lib/libndbclient.so.2.0.0
執行安裝:
[root@mycentos52 tools]# rpm -ivh MySQL-shared-standard-4.1.22-0.rhel4.i386.rpm
Preparing...                ########################################### [100%]
   1:MySQL-shared-standard  ########################################### [100%]
查看:
[root@mycentos52 tools]# cd /usr/lib
[root@mycentos52 lib]# ls libmysql*
libmysqlclient_r.so     libmysqlclient_r.so.14.0.0  libmysqlclient.so.14
libmysqlclient_r.so.14  libmysqlclient.so           libmysqlclient.so.14.0.0
[root@mycentos52 lib]#
執行spine的編譯:
[root@mycentos52 cacti-spine-0.8.7c]#./configure
checking for mysql_thread_init in -lmysqlclient_r... yes
configure: error: Cannot find SNMP headers.  Use --with-snmp= to specify non-default path.
提示snmp的目錄沒有發現,指定自己安裝的snmp的目錄後再進行編譯
[root@mycentos52 cacti-spine-0.8.7c]# ./configure --with-snmp=/usr/local/net-snmp/ 
checking if UCD-SNMP needs crypto support... no
checking if Net-SNMP needs crypto support... yes
checking for snmp_timeout in -lnetsnmp... yes
checking for the spine results buffer size... 1024 bytes
checking for the maximum simultaneous spine .s... 20
checking for the maximum MySQL buffer size... 65536
checking whether we are using nifty popen... no
checking for glibc gethostbyname_r... yes
checking for Solaris/Irix gethostbyname_r... no
checking for HP-UX gethostbyname_r... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config/config.h
config.status: executing depfiles commands
編譯成功了!
下面 make;make install
將產生spine的安裝目錄[root@mycentos52 spine]#pwd
/usr/local/spine
[root@mycentos52 spine]#cp ./etc/spine.conf.dist ./spine.conf 建立spine的配置文件
[root@mycentos52 etc]# vi spine.conf
檢查數據庫名、用戶名等
試着運行spine看行不行?、
 ./spine
SPINE: Using spine config file [spine.conf]
MYSQL: Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
11/02/2007 04:02:51 PM - SPINE: Poller[0] FATAL: Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) (Spine init)
google問題,最後
在/var/lib/ 下建立mysql文件夾
[root@monitor mysql]# pwd
/var/lib/mysql
[root@monitor mysql]#
[root@monitor mysql]# ln -s /tmp/mysql.sock  /var/lib/mysql/mysql.sock
產生一個mysql.sock 的文件。 和tmp目錄下的連接起來。 tmp下的mysql.sock 是安裝mysql的時候產生的,而/var/lib/mysql/mysql.sock ln產生的。
然後
[root@mycentos52 bin]# ./spine
SPINE: Using spine config file [../etc/spine.conf]
SPINE: Version 0.8.7c starting
SPINE: Time: 2.8546 s, Threads: 1, Hosts: 5
[root@mycentos52 bin]#
不知道spine的conf文件是怎麼回事,一定要到/var/lib/mysql/下去找mysql.sock 這個文件。也不知道怎麼調整。所以就做了這麼個ln來解決。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章