Cacti 0.8.7g install [全] on Centos 5.5

1. install centos 5.5
建議於 語系的部份加選繁體中文的部份.

2. Add file at /etc/yum.repos.d/dag.repo
[root@localhost ~]# vim /etc/yum.repos.d/dag.repo
#Add by Yen at 2009/09/19
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el5/en/i386/dag
gpgcheck=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
enabled=1
[root@localhost ~]#

3. yum install yum-fastestmirror

4.yum update

5.yum install cacti

cacti will install on /var/www/cacti
[root@localhost cacti]# pwd
/var/www/cacti
[root@localhost cacti]#

6.0
————————————————————————-
### 這個步驟是因為我自己有修改部分的php code ,所以才會有需要做的change ,安裝cacti 並不需要.請使用 6.1 & 6.2
[root@localhost ~]# cd /var/www
[root@localhost www]# ls -l
total 36984
drwxr-xr-x 12 root root 4096 Mar 19 16:58 cacti
drwxr-xr-x 2 root root 4096 Aug 31 2010 cgi-bin
drwxr-xr-x 3 root root 4096 Mar 19 16:51 error
drwxr-xr-x 2 root root 4096 Aug 31 2010 html
-rwxr-xr-x 1 root root 37793505 Mar 17 10:10 html_20110315.tar.gz
drwxr-xr-x 3 root root 4096 Mar 19 16:57 icons
[root@localhost www]# mv html html.old
[root@localhost www]# tar -zxvf html_20110315.tar.gz
————————————————————————-

6.1
因為我們想要將cacti 安裝於根目錄 ,所以要修改目錄的路徑.

[root@localhost /] rm /var/www/html

ex:
未修改前
http://127.0.0.1/cacti/
修改後
http://127.0.0.1/

6.2.
將安裝好的cacti 建立 software link 到 /var/www/html

[root@localhost /] ln -s /var/www/cacti /var/www/html

7.將開機自動帶起httpd service open
[root@localhost /]# chkconfig httpd on

8.編輯 /etc/php.ini
將 memory_limit 改成 1024 M ,因為 poller Weathermap 等程式如果圖越多,所需要的記憶體越大
memory_limit = 128M ; Maximum amount of memory a script may consume

將 php 上傳file 的最大值改成500M,這樣上傳sql file 才不會有2M 的限制.
; Maximum allowed size for uploaded files.
upload_max_filesize = 500M

9. 開啟httpd 的 service

[root@localhost /]# service httpd start
Starting httpd: [ OK ]
[root@localhost /]#

10. install mysql
[root@localhost /]# yum install mysql-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* extras: ftp.cse.yzu.edu.tw
* updates: ftp.cse.yzu.edu.tw
* base: ftp.cse.yzu.edu.tw
* addons: ftp.cse.yzu.edu.tw
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
–> Running transaction check
—> Package mysql-server.i386 0:5.0.77-3.el5 set to be updated
–> Processing Dependency: perl-DBD-MySQL for package: mysql-server
–> Running transaction check
—> Package perl-DBD-mysql.i386 0:4.012-1.el5.rf set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mysql-server i386 5.0.77-3.el5 updates 9.8 M
Installing for dependencies:
perl-DBD-mysql i386 4.012-1.el5.rf dag 224 k

Transaction Summary
================================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 10 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): perl-DBD-mysql-4.012-1.el5.rf.i386.rpm | 224 kB 00:06
(2/2): mysql-server-5.0.77-3.el5.i386.rpm | 9.8 MB 03:30
—————————————————————————————————————————–
Total 47 kB/s | 10 MB 03:38
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : perl-DBD-mysql [1/2]
Installing : mysql-server [2/2]

Installed: mysql-server.i386 0:5.0.77-3.el5
Dependency Installed: perl-DBD-mysql.i386 0:4.012-1.el5.rf
Complete!
[root@localhost /]#

11. 將開機自動帶起 mysqld
[root@localhost /]# chkconfig mysqld on

12. open mysqld

[root@localhost html]# service httpd start
Starting httpd: [ OK ]
[root@localhost html]# service mysqld start
Initializing MySQL database: Installing MySQL system tables…
OK
Filling help tables…
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h localhost.localdomain password ‘new-password’

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
[ OK ]
Starting MySQL: [ OK ]
[root@localhost html]#

13. 設定 mysql root password
[root@localhost /]# mysqladmin -u root password ‘Passw0rd’
[root@localhost /]#

14. 安裝 spine
先 download從: http://www.cacti.net/downloads/spine/cacti-spine-0.8.7g.tar.gz

15. 解壓縮
[root@localhost tmp]# tar -zxvf cacti-spine-0.8.7g.tar.gz

16. 安裝 spine 之前請先安裝 gcc

[root@localhost cacti-spine-0.8.7g]# yum install gcc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: ftp.twaren.net
* base: ftp.twaren.net
* extras: ftp.twaren.net
* updates: ftp.twaren.net
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package gcc.x86_64 0:4.1.2-48.el5 set to be updated
–> Processing Dependency: libgomp >= 4.1.2-48.el5 for package: gcc
–> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc
–> Running transaction check
—> Package glibc-devel.x86_64 0:2.5-49.el5_5.7 set to be updated
–> Processing Dependency: glibc-headers = 2.5-49.el5_5.7 for package: glibc-devel
–> Processing Dependency: glibc-headers for package: glibc-devel
—> Package libgomp.x86_64 0:4.4.0-6.el5 set to be updated
–> Running transaction check
—> Package glibc-headers.x86_64 0:2.5-49.el5_5.7 set to be updated
–> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers
–> Processing Dependency: kernel-headers for package: glibc-headers
–> Running transaction check
—> Package kernel-headers.x86_64 0:2.6.18-194.32.1.el5 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
gcc x86_64 4.1.2-48.el5 base 5.3 M
Installing for dependencies:
glibc-devel x86_64 2.5-49.el5_5.7 updates 2.4 M
glibc-headers x86_64 2.5-49.el5_5.7 updates 593 k
kernel-headers x86_64 2.6.18-194.32.1.el5 updates 1.1 M
libgomp x86_64 4.4.0-6.el5 base 68 k

Transaction Summary
================================================================================
Install 5 Package(s)
Upgrade 0 Package(s)

Total download size: 9.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): libgomp-4.4.0-6.el5.x86_64.rpm | 68 kB 00:00
(2/5): glibc-headers-2.5-49.el5_5.7.x86_64.rpm | 593 kB 00:00
(3/5): kernel-headers-2.6.18-194.32.1.el5.x86_64.rpm | 1.1 MB 00:00
(4/5): glibc-devel-2.5-49.el5_5.7.x86_64.rpm | 2.4 MB 00:02
(5/5): gcc-4.1.2-48.el5.x86_64.rpm | 5.3 MB 00:04
——————————————————————————–
Total 1.1 MB/s | 9.4 MB 00:08
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libgomp Installing : libgomp 1/5
Installing : kernel-headers 2/5
Installing : glibc-headers 3/5
Installing : glibc-devel 4/5
Installing : gcc 5/5

Installed:
gcc.x86_64 0:4.1.2-48.el5

Dependency Installed:
glibc-devel.x86_64 0:2.5-49.el5_5.7 glibc-headers.x86_64 0:2.5-49.el5_5.7 kernel-headers.x86_64 0:2.6.18-194.32.1.el5
libgomp.x86_64 0:4.4.0-6.el5

Complete!
[root@localhost cacti-spine-0.8.7g]#

17. 到這邊我想很多人應該會遇到
configure: error: Cannot find MySQL headers. Use –with-mysql= to specify non-default path.
其實只是少裝 mysql-devel and net-snmp-devel 的問題 可以參考如下: 請使用安裝 mysql-devel and net-snmp-devel即可.

[root@localhost cacti-spine-0.8.7g]# ./configure
checking build system type… x86_64-unknown-linux-gnu
checking host system type… x86_64-unknown-linux-gnu
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 gawk… (cached) gawk
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking for style of include used by make… GNU
checking dependency style of gcc… gcc3
checking how to run the C preprocessor… gcc -E
checking for a BSD-compatible install… /usr/bin/install -c
checking whether ln -s works… yes
checking for a sed that does not truncate output… /bin/sed
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/grep -E
checking for fgrep… /bin/grep -F
checking for ld used by gcc… /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld… yes
checking for BSD- or MS-compatible name lister (nm)… /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface… BSD nm
checking the maximum length of command line arguments… 98304
checking whether the shell understands some XSI constructs… yes
checking whether the shell understands “+=”… yes
checking for /usr/bin/ld option to reload object files… -r
checking for objdump… objdump
checking how to recognize dependent libraries… pass_all
checking for ar… ar
checking for strip… strip
checking for ranlib… ranlib
checking command to parse /usr/bin/nm -B output from gcc object… ok
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking for dlfcn.h… yes
checking for objdir… .libs
checking if gcc supports -fno-rtti -fno-exceptions… no
checking for gcc option to produce PIC… -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works… yes
checking if gcc static flag -static works… yes
checking if gcc supports -c -o file.o… yes
checking if gcc supports -c -o file.o… (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries… yes
checking whether -lc should be explicitly linked in… no
checking dynamic linker characteristics… GNU/Linux ld.so
checking how to hardcode library paths into programs… immediate
checking whether stripping libraries is possible… yes
checking if libtool supports shared libraries… yes
checking whether to build shared libraries… yes
checking whether to build static libraries… yes
checking for ranlib… (cached) ranlib
checking whether to enable -Wall… no
checking for threadsafe gethostbyname()… no
checking for gethostbyname_r in -lnls… no
checking for socket in -lsocket… no
checking for floor in -lm… yes
checking for pthread_exit in -lpthread… yes
checking for deflate in -lz… no
checking for kstat_close in -lkstat… no
checking for CRYPTO_realloc in -lcrypto… no
checking for ANSI C header files… (cached) yes
checking sys/socket.h usability… yes
checking sys/socket.h presence… yes
checking for sys/socket.h… yes
checking sys/select.h usability… yes
checking sys/select.h presence… yes
checking for sys/select.h… yes
checking sys/wait.h usability… yes
checking sys/wait.h presence… yes
checking for sys/wait.h… yes
checking sys/time.h usability… yes
checking sys/time.h presence… yes
checking for sys/time.h… yes
checking assert.h usability… yes
checking assert.h presence… yes
checking for assert.h… yes
checking ctype.h usability… yes
checking ctype.h presence… yes
checking for ctype.h… yes
checking errno.h usability… yes
checking errno.h presence… yes
checking for errno.h… yes
checking signal.h usability… yes
checking signal.h presence… yes
checking for signal.h… yes
checking math.h usability… yes
checking math.h presence… yes
checking for math.h… yes
checking malloc.h usability… yes
checking malloc.h presence… yes
checking for malloc.h… yes
checking netdb.h usability… yes
checking netdb.h presence… yes
checking for netdb.h… yes
checking for signal.h… (cached) yes
checking stdarg.h usability… yes
checking stdarg.h presence… yes
checking for stdarg.h… yes
checking stdio.h usability… yes
checking stdio.h presence… yes
checking for stdio.h… yes
checking syslog.h usability… yes
checking syslog.h presence… yes
checking for syslog.h… yes
checking for netinet/in_systm.h… yes
checking for netinet/in.h… yes
checking for netinet/ip.h… yes
checking for netinet/ip_icmp.h… yes
checking for unsigned long long… yes
checking for long long… yes
checking for an ANSI C-conforming const… yes
checking for size_t… yes
checking whether time.h and sys/time.h may both be included… yes
checking whether struct tm is in sys/time.h or time.h… time.h
checking return type of signal handlers… void
checking for malloc… yes
checking for calloc… yes
checking for gettimeofday… yes
checking for strerror… yes
checking for strtoll… yes
checking priv.h usability… no
checking priv.h presence… no
checking for priv.h… no
checking whether we are using Solaris privileges… no
configure: error: Cannot find MySQL headers. Use –with-mysql= to specify non-default path.
[root@localhost cacti-spine-0.8.7g]#
這邊遇到的問題是因為沒有安裝 mysql-devel ,所以我們使用yum 來安裝一下 mysql-devel
其實還需要 net-snmp-devel,所以我們就一起裝一裝.

[root@localhost cacti-spine-0.8.7g]# yum -y install mysql-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: ftp.nsysu.edu.tw
* base: ftp.nsysu.edu.tw
* extras: ftp.nsysu.edu.tw
* updates: ftp.nsysu.edu.tw
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package mysql-devel.i386 0:5.0.77-4.el5_5.4 set to be updated
–> Processing Dependency: openssl-devel for package: mysql-devel
–> Processing Dependency: libmysqlclient.so.15 for package: mysql-devel
–> Processing Dependency: libmysqlclient_r.so.15 for package: mysql-devel
—> Package mysql-devel.x86_64 0:5.0.77-4.el5_5.4 set to be updated
–> Running transaction check
—> Package mysql.i386 0:5.0.77-4.el5_5.4 set to be updated
—> Package openssl-devel.x86_64 0:0.9.8e-12.el5_5.7 set to be updated
–> Processing Dependency: zlib-devel for package: openssl-devel
–> Processing Dependency: krb5-devel for package: openssl-devel
–> Running transaction check
—> Package krb5-devel.x86_64 0:1.6.1-36.el5_5.6 set to be updated
–> Processing Dependency: keyutils-libs-devel for package: krb5-devel
–> Processing Dependency: libselinux-devel for package: krb5-devel
–> Processing Dependency: e2fsprogs-devel for package: krb5-devel
—> Package zlib-devel.x86_64 0:1.2.3-3 set to be updated
–> Running transaction check
—> Package e2fsprogs-devel.x86_64 0:1.39-23.el5_5.1 set to be updated
—> Package keyutils-libs-devel.x86_64 0:1.2-1.el5 set to be updated
—> Package libselinux-devel.x86_64 0:1.33.4-5.5.el5 set to be updated
–> Processing Dependency: libsepol-devel >= 1.15.2-1 for package: libselinux-devel
–> Running transaction check
—> Package libsepol-devel.x86_64 0:1.15.2-3.el5 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================
Installing:
mysql-devel i386 5.0.77-4.el5_5.4 updates 2.4 M
mysql-devel x86_64 5.0.77-4.el5_5.4 updates 2.5 M
Installing for dependencies:
e2fsprogs-devel x86_64 1.39-23.el5_5.1 updates 633 k
keyutils-libs-devel x86_64 1.2-1.el5 base 27 k
krb5-devel x86_64 1.6.1-36.el5_5.6 updates 1.9 M
libselinux-devel x86_64 1.33.4-5.5.el5 base 149 k
libsepol-devel x86_64 1.15.2-3.el5 base 192 k
mysql i386 5.0.77-4.el5_5.4 updates 4.8 M
openssl-devel x86_64 0.9.8e-12.el5_5.7 updates 1.9 M
zlib-devel x86_64 1.2.3-3 base 102 k

Transaction Summary
=============================================================================================================================================
Install 10 Package(s)
Upgrade 0 Package(s)

Total download size: 14 M
Downloading Packages:
(1/10): keyutils-libs-devel-1.2-1.el5.x86_64.rpm | 27 kB 00:00
(2/10): zlib-devel-1.2.3-3.x86_64.rpm | 102 kB 00:00
(3/10): libselinux-devel-1.33.4-5.5.el5.x86_64.rpm | 149 kB 00:00
(4/10): libsepol-devel-1.15.2-3.el5.x86_64.rpm | 192 kB 00:00
(5/10): e2fsprogs-devel-1.39-23.el5_5.1.x86_64.rpm | 633 kB 00:00
(6/10): openssl-devel-0.9.8e-12.el5_5.7.x86_64.rpm | 1.9 MB 00:01
(7/10): krb5-devel-1.6.1-36.el5_5.6.x86_64.rpm | 1.9 MB 00:01
(8/10): mysql-devel-5.0.77-4.el5_5.4.i386.rpm | 2.4 MB 00:02
(9/10): mysql-devel-5.0.77-4.el5_5.4.x86_64.rpm | 2.5 MB 00:02
(10/10): mysql-5.0.77-4.el5_5.4.i386.rpm | 4.8 MB 00:04
———————————————————————————————————————————————
Total 1.1 MB/s | 14 MB 00:13
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : e2fsprogs-devel 1/10
Installing : keyutils-libs-devel 2/10
Installing : libsepol-devel 3/10
Installing : libselinux-devel 4/10
Installing : krb5-devel 5/10
Installing : zlib-devel 6/10
Installing : mysql 7/10
Installing : openssl-devel 8/10
Installing : mysql-devel 9/10
Installing : mysql-devel 10/10

Installed:
mysql-devel.i386 0:5.0.77-4.el5_5.4 mysql-devel.x86_64 0:5.0.77-4.el5_5.4

Dependency Installed:
e2fsprogs-devel.x86_64 0:1.39-23.el5_5.1 keyutils-libs-devel.x86_64 0:1.2-1.el5 krb5-devel.x86_64 0:1.6.1-36.el5_5.6
libselinux-devel.x86_64 0:1.33.4-5.5.el5 libsepol-devel.x86_64 0:1.15.2-3.el5 mysql.i386 0:5.0.77-4.el5_5.4
openssl-devel.x86_64 0:0.9.8e-12.el5_5.7 zlib-devel.x86_64 0:1.2.3-3

Complete!
[root@localhost cacti-spine-0.8.7g]#

[root@localhost cacti-spine-0.8.7g]# yum -y install net-snmp-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: ftp.nsysu.edu.tw
* base: ftp.nsysu.edu.tw
* extras: ftp.nsysu.edu.tw
* updates: ftp.nsysu.edu.tw
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package net-snmp-devel.i386 1:5.3.2.2-9.el5_5.1 set to be updated
–> Processing Dependency: beecrypt-devel for package: net-snmp-devel
–> Processing Dependency: libsnmp.so.10 for package: net-snmp-devel
–> Processing Dependency: libnetsnmptrapd.so.10 for package: net-snmp-devel
–> Processing Dependency: elfutils-devel for package: net-snmp-devel
–> Processing Dependency: libnetsnmp.so.10 for package: net-snmp-devel
–> Processing Dependency: rpm-devel for package: net-snmp-devel
–> Processing Dependency: elfutils-libelf-devel for package: net-snmp-devel
–> Processing Dependency: lm_sensors-devel for package: net-snmp-devel
–> Processing Dependency: libnetsnmpagent.so.10 for package: net-snmp-devel
–> Processing Dependency: libnetsnmphelpers.so.10 for package: net-snmp-devel
–> Processing Dependency: libnetsnmpmibs.so.10 for package: net-snmp-devel
—> Package net-snmp-devel.x86_64 1:5.3.2.2-9.el5_5.1 set to be updated
–> Running transaction check
—> Package beecrypt-devel.x86_64 0:4.1.2-10.1.1 set to be updated
–> Processing Dependency: beecrypt = 4.1.2-10.1.1 for package: beecrypt-devel
–> Processing Dependency: libbeecrypt.so.6()(64bit) for package: beecrypt-devel
—> Package elfutils-devel.x86_64 0:0.137-3.el5 set to be updated
–> Processing Dependency: elfutils-libs-x86_64 = 0.137-3.el5 for package: elfutils-devel
–> Processing Dependency: elfutils-devel-static-x86_64 = 0.137-3.el5 for package: elfutils-devel
–> Processing Dependency: libdw.so.1()(64bit) for package: elfutils-devel
–> Processing Dependency: libasm.so.1()(64bit) for package: elfutils-devel
—> Package elfutils-libelf-devel.x86_64 0:0.137-3.el5 set to be updated
–> Processing Dependency: elfutils-libelf-devel-static-x86_64 = 0.137-3.el5 for package: elfutils-libelf-devel
—> Package lm_sensors-devel.x86_64 0:2.10.7-9.el5 set to be updated
—> Package net-snmp-libs.i386 1:5.3.2.2-9.el5_5.1 set to be updated
—> Package rpm-devel.x86_64 0:4.4.2.3-20.el5_5.1 set to be updated
–> Processing Dependency: sqlite-devel for package: rpm-devel
–> Processing Dependency: nss-devel for package: rpm-devel
–> Running transaction check
—> Package beecrypt.x86_64 0:4.1.2-10.1.1 set to be updated
—> Package elfutils-devel-static.x86_64 0:0.137-3.el5 set to be updated
—> Package elfutils-libelf-devel-static.x86_64 0:0.137-3.el5 set to be updated
—> Package elfutils-libs.x86_64 0:0.137-3.el5 set to be updated
—> Package nss-devel.x86_64 0:3.12.8-1.el5.centos set to be updated
–> Processing Dependency: nspr-devel >= 4.8.6 for package: nss-devel
—> Package sqlite-devel.x86_64 0:3.3.6-5 set to be updated
–> Running transaction check
—> Package nspr-devel.x86_64 0:4.8.6-1.el5_5 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================
Installing:
net-snmp-devel i386 1:5.3.2.2-9.el5_5.1 updates 1.9 M
net-snmp-devel x86_64 1:5.3.2.2-9.el5_5.1 updates 2.0 M
Installing for dependencies:
beecrypt x86_64 4.1.2-10.1.1 base 87 k
beecrypt-devel x86_64 4.1.2-10.1.1 base 118 k
elfutils-devel x86_64 0.137-3.el5 base 62 k
elfutils-devel-static x86_64 0.137-3.el5 base 119 k
elfutils-libelf-devel x86_64 0.137-3.el5 base 24 k
elfutils-libelf-devel-static x86_64 0.137-3.el5 base 64 k
elfutils-libs x86_64 0.137-3.el5 base 183 k
lm_sensors-devel x86_64 2.10.7-9.el5 base 85 k
net-snmp-libs i386 1:5.3.2.2-9.el5_5.1 updates 1.3 M
nspr-devel x86_64 4.8.6-1.el5_5 updates 112 k
nss-devel x86_64 3.12.8-1.el5.centos updates 233 k
rpm-devel x86_64 4.4.2.3-20.el5_5.1 updates 1.3 M
sqlite-devel x86_64 3.3.6-5 base 257 k

Transaction Summary
=============================================================================================================================================
Install 15 Package(s)
Upgrade 0 Package(s)

Total download size: 7.7 M
Downloading Packages:
(1/15): elfutils-libelf-devel-0.137-3.el5.x86_64.rpm | 24 kB 00:00
(2/15): elfutils-devel-0.137-3.el5.x86_64.rpm | 62 kB 00:00
(3/15): elfutils-libelf-devel-static-0.137-3.el5.x86_64.rpm | 64 kB 00:00
(4/15): lm_sensors-devel-2.10.7-9.el5.x86_64.rpm | 85 kB 00:00
(5/15): beecrypt-4.1.2-10.1.1.x86_64.rpm | 87 kB 00:00
(6/15): nspr-devel-4.8.6-1.el5_5.x86_64.rpm | 112 kB 00:00
(7/15): beecrypt-devel-4.1.2-10.1.1.x86_64.rpm | 118 kB 00:00
(8/15): elfutils-devel-static-0.137-3.el5.x86_64.rpm | 119 kB 00:00
(9/15): elfutils-libs-0.137-3.el5.x86_64.rpm | 183 kB 00:00
(10/15): nss-devel-3.12.8-1.el5.centos.x86_64.rpm | 233 kB 00:00
(11/15): sqlite-devel-3.3.6-5.x86_64.rpm | 257 kB 00:00
(12/15): net-snmp-libs-5.3.2.2-9.el5_5.1.i386.rpm | 1.3 MB 00:01
(13/15): rpm-devel-4.4.2.3-20.el5_5.1.x86_64.rpm | 1.3 MB 00:01
(14/15): net-snmp-devel-5.3.2.2-9.el5_5.1.i386.rpm | 1.9 MB 00:01
(15/15): net-snmp-devel-5.3.2.2-9.el5_5.1.x86_64.rpm | 2.0 MB 00:01
———————————————————————————————————————————————
Total 989 kB/s | 7.7 MB 00:07
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : lm_sensors-devel 1/15
Installing : elfutils-libs 2/15
Installing : beecrypt 3/15
Installing : beecrypt-devel 4/15
Installing : nspr-devel 5/15
Installing : nss-devel 6/15
Installing : sqlite-devel 7/15
Installing : net-snmp-libs 8/15
Installing : elfutils-libelf-devel 9/15
Installing : rpm-devel 10/15
Installing : elfutils-devel 11/15
Installing : elfutils-libelf-devel-static 12/15
Installing : elfutils-devel-static 13/15
Installing : net-snmp-devel 14/15
Installing : net-snmp-devel 15/15

Installed:
net-snmp-devel.i386 1:5.3.2.2-9.el5_5.1 net-snmp-devel.x86_64 1:5.3.2.2-9.el5_5.1

Dependency Installed:
beecrypt.x86_64 0:4.1.2-10.1.1 beecrypt-devel.x86_64 0:4.1.2-10.1.1 elfutils-devel.x86_64 0:0.137-3.el5
elfutils-devel-static.x86_64 0:0.137-3.el5 elfutils-libelf-devel.x86_64 0:0.137-3.el5 elfutils-libelf-devel-static.x86_64 0:0.137-3.el5
elfutils-libs.x86_64 0:0.137-3.el5 lm_sensors-devel.x86_64 0:2.10.7-9.el5 net-snmp-libs.i386 1:5.3.2.2-9.el5_5.1
nspr-devel.x86_64 0:4.8.6-1.el5_5 nss-devel.x86_64 0:3.12.8-1.el5.centos rpm-devel.x86_64 0:4.4.2.3-20.el5_5.1
sqlite-devel.x86_64 0:3.3.6-5

Complete!
[root@localhost cacti-spine-0.8.7g]#

18. 安裝完成就需要 configure spine
[root@localhost cacti-spine-0.8.7g]# ./configure
checking build system type… x86_64-unknown-linux-gnu
checking host system type… x86_64-unknown-linux-gnu
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 gawk… (cached) gawk
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking for style of include used by make… GNU
checking dependency style of gcc… gcc3
checking how to run the C preprocessor… gcc -E
checking for a BSD-compatible install… /usr/bin/install -c
checking whether ln -s works… yes
checking for a sed that does not truncate output… /bin/sed
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/grep -E
checking for fgrep… /bin/grep -F
checking for ld used by gcc… /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld… yes
checking for BSD- or MS-compatible name lister (nm)… /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface… BSD nm
checking the maximum length of command line arguments… 98304
checking whether the shell understands some XSI constructs… yes
checking whether the shell understands “+=”… yes
checking for /usr/bin/ld option to reload object files… -r
checking for objdump… objdump
checking how to recognize dependent libraries… pass_all
checking for ar… ar
checking for strip… strip
checking for ranlib… ranlib
checking command to parse /usr/bin/nm -B output from gcc object… ok
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking for dlfcn.h… yes
checking for objdir… .libs
checking if gcc supports -fno-rtti -fno-exceptions… no
checking for gcc option to produce PIC… -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works… yes
checking if gcc static flag -static works… yes
checking if gcc supports -c -o file.o… yes
checking if gcc supports -c -o file.o… (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries… yes
checking whether -lc should be explicitly linked in… no
checking dynamic linker characteristics… GNU/Linux ld.so
checking how to hardcode library paths into programs… immediate
checking whether stripping libraries is possible… yes
checking if libtool supports shared libraries… yes
checking whether to build shared libraries… yes
checking whether to build static libraries… yes
checking for ranlib… (cached) ranlib
checking whether to enable -Wall… no
checking for threadsafe gethostbyname()… no
checking for gethostbyname_r in -lnls… no
checking for socket in -lsocket… no
checking for floor in -lm… yes
checking for pthread_exit in -lpthread… yes
checking for deflate in -lz… yes
checking for kstat_close in -lkstat… no
checking for CRYPTO_realloc in -lcrypto… yes
checking for ANSI C header files… (cached) yes
checking sys/socket.h usability… yes
checking sys/socket.h presence… yes
checking for sys/socket.h… yes
checking sys/select.h usability… yes
checking sys/select.h presence… yes
checking for sys/select.h… yes
checking sys/wait.h usability… yes
checking sys/wait.h presence… yes
checking for sys/wait.h… yes
checking sys/time.h usability… yes
checking sys/time.h presence… yes
checking for sys/time.h… yes
checking assert.h usability… yes
checking assert.h presence… yes
checking for assert.h… yes
checking ctype.h usability… yes
checking ctype.h presence… yes
checking for ctype.h… yes
checking errno.h usability… yes
checking errno.h presence… yes
checking for errno.h… yes
checking signal.h usability… yes
checking signal.h presence… yes
checking for signal.h… yes
checking math.h usability… yes
checking math.h presence… yes
checking for math.h… yes
checking malloc.h usability… yes
checking malloc.h presence… yes
checking for malloc.h… yes
checking netdb.h usability… yes
checking netdb.h presence… yes
checking for netdb.h… yes
checking for signal.h… (cached) yes
checking stdarg.h usability… yes
checking stdarg.h presence… yes
checking for stdarg.h… yes
checking stdio.h usability… yes
checking stdio.h presence… yes
checking for stdio.h… yes
checking syslog.h usability… yes
checking syslog.h presence… yes
checking for syslog.h… yes
checking for netinet/in_systm.h… yes
checking for netinet/in.h… yes
checking for netinet/ip.h… yes
checking for netinet/ip_icmp.h… yes
checking for unsigned long long… yes
checking for long long… yes
checking for an ANSI C-conforming const… yes
checking for size_t… yes
checking whether time.h and sys/time.h may both be included… yes
checking whether struct tm is in sys/time.h or time.h… time.h
checking return type of signal handlers… void
checking for malloc… yes
checking for calloc… yes
checking for gettimeofday… yes
checking for strerror… yes
checking for strtoll… yes
checking priv.h usability… no
checking priv.h presence… no
checking for priv.h… no
checking whether we are using Solaris privileges… no
checking for mysql_init in -lmysqlclient_r… yes
checking for mysql_thread_init in -lmysqlclient_r… yes
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 scripts… 20
checking for the maximum MySQL buffer size… 65536
checking whether we are using traditional popen… no
checking whether to verify net-snmp library vs header versions… 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
config.status: executing libtool commands
[root@localhost cacti-spine-0.8.7g]#

[root@localhost cacti-spine-0.8.7g]# make install

[root@localhost cacti-spine-0.8.7g]# make
gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT sql.o -MD -MP -MF .deps/sql.Tpo -c -o sql.o sql.c
mv -f .deps/sql.Tpo .deps/sql.Po
gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT spine.o -MD -MP -MF .deps/spine.Tpo -c -o spine.o spine.c
mv -f .deps/spine.Tpo .deps/spine.Po
gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT util.o -MD -MP -MF .deps/util.Tpo -c -o util.o util.c
mv -f .deps/util.Tpo .deps/util.Po
gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT snmp.o -MD -MP -MF .deps/snmp.Tpo -c -o snmp.o snmp.c
mv -f .deps/snmp.Tpo .deps/snmp.Po
gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT locks.o -MD -MP -MF .deps/locks.Tpo -c -o locks.o locks.c
mv -f .deps/locks.Tpo .deps/locks.Po
gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT poller.o -MD -MP -MF .deps/poller.Tpo -c -o poller.o poller.c
mv -f .deps/poller.Tpo .deps/poller.Po
gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT nft_popen.o -MD -MP -MF .deps/nft_popen.Tpo -c -o nft_popen.o nft_popen.c
mv -f .deps/nft_popen.Tpo .deps/nft_popen.Po
gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT php.o -MD -MP -MF .deps/php.Tpo -c -o php.o php.c
mv -f .deps/php.Tpo .deps/php.Po
gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT ping.o -MD -MP -MF .deps/ping.Tpo -c -o ping.o ping.c
mv -f .deps/ping.Tpo .deps/ping.Po
gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT keywords.o -MD -MP -MF .deps/keywords.Tpo -c -o keywords.o keywords.c
mv -f .deps/keywords.Tpo .deps/keywords.Po
gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT error.o -MD -MP -MF .deps/error.Tpo -c -o error.o error.c
mv -f .deps/error.Tpo .deps/error.Po
/bin/sh ./libtool –tag=CC –mode=link gcc -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -L/usr/lib64 -L/usr/lib64/mysql -o spine sql.o spine.o util.o snmp.o locks.o poller.o nft_popen.o php.o ping.o keywords.o error.o -lnetsnmp -lmysqlclient_r -lmysqlclient_r -lcrypto -lz -lpthread -lm
libtool: link: gcc -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -o spine sql.o spine.o util.o snmp.o locks.o poller.o nft_popen.o php.o ping.o keywords.o error.o -L/usr/lib64 -L/usr/lib64/mysql -lnetsnmp -lmysqlclient_r -lcrypto -lz -lpthread -lm
[root@localhost cacti-spine-0.8.7g]#

19.
如果都沒有錯誤訊息, 現在可以 make install 安裝 spine .

[root@localhost cacti-spine-0.8.7g]# make install
make[1]: Entering directory `/tmp/cacti-spine-0.8.7g’
test -z “/usr/local/spine/bin” || /bin/mkdir -p “/usr/local/spine/bin”
/bin/sh ./libtool –mode=install /usr/bin/install -c spine ‘/usr/local/spine/bin’
libtool: install: /usr/bin/install -c spine /usr/local/spine/bin/spine
test -z “/usr/local/spine/etc” || /bin/mkdir -p “/usr/local/spine/etc”
/usr/bin/install -c -m 644 spine.conf.dist ‘/usr/local/spine/etc’
make[1]: Leaving directory `/tmp/cacti-spine-0.8.7g’
[root@localhost cacti-spine-0.8.7g]#

20. 將不需要使用的東西清掉 ,

[root@localhost cacti-spine-0.8.7g]# make clean
rm -f spine
rm -rf .libs _libs
rm -f *.o
rm -f *.lo
[root@localhost cacti-spine-0.8.7g]#

19 20 可以縮減成 make install clean

到這邊大功告成.

請使用瀏覽器開 http://127.0.0.1/ 即可看到畫面.


Leave a Comment

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料