[精讚] [會員登入]
1787

[CENTOS7] 安裝rrdtool+RRDs+PERL

要讓perl繪圖,安裝rrdtool和RRDs

分享此文連結 //n.sfs.tw/13060

分享連結 [CENTOS7] 安裝rrdtool+RRDs+PERL@新精讚
(文章歡迎轉載,務必尊重版權註明連結來源)
2022-01-07 15:07:36 最後編修
2019-01-29 03:11:37 By 張○○
 

自動目錄

要讓perl繪圖,安裝rrdtool和RRDTool::OO,安裝的過程記錄,有一些困難也排除

CENTOS7+ PERL+ RRDTOOL+ RRDTool::OO(for PERL)

下載

CENTOS8 可以直接 dnf install rrdtool

如果要使用tarball 來裝的話,請到下方連結下載。

https://oss.oetiker.ch/rrdtool/pub/?M=D

安裝及解壓到目錄,進到目錄(略)

 

 

組態

# ./configure

執行出現以下錯誤:

* I found a copy of pkgconfig, but there is no libxml-2.0.pc file around.
  You may want to set the PKG_CONFIG_PATH variable to point to its
  location.

* I found a copy of pkgconfig, but there is no glib-2.0.pc file around.
  You may want to set the PKG_CONFIG_PATH variable to point to its
  location.

* I found a copy of pkgconfig, but there is no libpng.pc file around.
  You may want to set the PKG_CONFIG_PATH variable to point to its
  location.

* I found a copy of pkgconfig, but there is no pangocairo.pc file around.
  You may want to set the PKG_CONFIG_PATH variable to point to its
  location.
----------------------------------------------------------------------------

從[1]得來的建議,要裝以下套件

# yum install libxml2*
# yum install glib2*
# yum install libpng*

# yum install libpango* (不確定這個要不要?)

# yum install libcairo* (不確定這個要不要?)

裝完這個錯誤依舊

* I found a copy of pkgconfig, but there is no pangocairo.pc file around.
  You may want to set the PKG_CONFIG_PATH variable to point to its
  location.

上面的錯誤顯然是 pango和cairo這兩個套件,但我裝了又沒作用,但我不確定libcairo, libpango要不要。

爬文花了不少時間,後來發現[2]最後說到的重點,要裝這兩個套件:

# yum install cairo-devel
# yum install pango-devel

裝完組態就過了,感謝他們!

 

編譯及安裝

# make

# make install clean

裝好的程式放在 /opt/rrdtool-1.7.0/

 

PERL 如何使用?

原本找到[3] 所寫的 RRDTool::OO模組,以為可以使用,但是安裝時出現

This module requires rrdtool 1.2.x and the RRDs module to be
installed. They are available in the rrdtool distribution:
 http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz

他說要rrdtool 1.2.x版,我目前是1.7.0版,無論你按y或n都會失敗。

換句話說,在PERL中你不能使用這個套件,只能用1.7版提供的功能。

在PERL中,只要指定pm檔的目錄

 use lib qw( /opt/rrdtool-1.7.0/lib/perl/5.16.3/ );
 use RRDs;

後來發現,可以直接裝 rrdtool-perl

# yum install rrdtool-perl

這樣子安裝完就能直接use RRDs,不必再加 lib路徑~~

呿!怎麼不早說?

還是有差異,這樣子裝好的版本是 1.4.x版。

就看各位想用什麼版本了。

祝您寫程愉快~~

 

參考資料

[1] https://ubuntuforums.org/showthread.php?t=1112365

[2] https://wwangcg.iteye.com/blog/1408328

[3] https://metacpan.org/pod/RRDTool::OO

END

你可能感興趣的文章

Centos7 的ifconfig和netstat Centos7 和RHEL 7 最小安裝中竟然沒有ifconfig和netstat?原來centos/rhel準備把這兩個指令作廢,那怎麼辦?

[Centos7] 新的防火牆firewalld Centos7新的防火牆firewalld 和前面的iptables有很大的不同

[Centos7] 安裝 semanage (selinux工具程式) 安裝selinux的工具程式 semanage

動態DNS -- dynamic DNS實作 BIND9動態DNS設定

[Linux] 安裝rsync (selinux 的設定) 在selinux enforcing 的情況下安裝rsync

[Centos7] 安裝phpMyAdmin Centos 7有新的方式可以安裝phpmyadmin,不必再採用過去的tarball安裝法。

我有話要說

>>

限制:留言最高字數1000字。 限制:未登入訪客,每則留言間隔需超過10分鐘,每日最多5則留言。

訪客留言

[無留言]

隨機好文

[jQuery] 利用load()來達成ajax的寫法 jQuery中利用load()來達成ajax的寫法,也有人稱他是假的ajax,作法就是..

[JAVA] JWS, JWT, JWE, JOSE是什麼? [JAVA] JWS, JWT, JWE, JOSE是什麼?非常的複雜,儘量來搞清楚..

UTF-8的網頁但IE8一片空白 UTF8編碼的網頁在Firefox 正常顯示、但IE8 就是空白,IE8編碼設定是「自動偵測」可是自動偵測到的是 big5...

維修冰箱 維修冰箱

Smarty安裝 smarty 是著名的樣版引擎,非常的好用,用多了突然發現拿掉smarty反而不會寫php了,以下是安裝過程..