[精讚] [會員登入]
1503

[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

你可能感興趣的文章

[LINUX] 利用 usermod 修改使用者的參數和資料 使用指令 usermod 修改使用者的參數和資料

[Centos7] HTTPS/SSL憑證的SELINUX設置 把申請來的憑證檔放到指定的位置後,沒辦法啟動,怎麼辦?

[Centos8] linux 上的Base64加解密指令 在linux上很方便的指令可以加解密 base64

Centos7 安裝 docker-composer 及使用 docker compose 是使用docker的利器,可以讓很多的指令用文檔的方式載入。

[CentOS6] 設定 sendmail Centos6上設定sendmail,基本上sendmail會設定多半是為了寄系統信和收垃圾信(喂!!?)

[Centos7] 安裝sphinx+php7 在centos7上安裝sphinx,在PHP7上運作正確

我有話要說

>>

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

訪客留言

[無留言]

隨機好文

[Freebsd] 定時測試 ADSL 是否斷線並重連 中華電信 ADSL 雖有固定 ip,可是他卻會不定時「斷線」, 使用以下的 方法可以定時測試是否斷線,以及重新撥接。

PHP for sphinx 函式庫安裝 PECL/sphinx PHP>= 5.2.2 已經能原生支援 sphinx,可是預設的沒有裝,我們得自己裝才能用

[Windows7] 移除IE10及移除IE11 Windows7 不得已的情況要移除IE11或IE10怎麼做?

設計的工作絕不接受比價 拿買陽春麵的價格想買牛肉麵,寧願倒掉也不賣

[CodeIgniter 3] 資料庫的使用方法整理1/2 --Select的使用 [CodeIgniter 3] 資料庫的使用方法整理:Select的使用