[精讚] [會員登入]
1725

[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

你可能感興趣的文章

[Rocky9] 負載平衡器Haproxy安裝及設定 負載平衡器Haproxy安裝及設定,這次的範例是透過本機的一個埠背後連到數台資料庫伺服器。

TFTP Server 安裝及使用 讓設備的網路設定檔或是韌體經由TFTP拷備出來,操作的方法

[Centos] 安裝及設定docker docker 是一個應用程式的容器,相對於vm是作業系統的容器。此篇整理基本安裝及設定。

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

[bc] linux 的計算機 bc 設定小數位數、計算π、次方根 linux 的計算機 bc 設定小數位數、計算π、次方根

EXCEL+phpPgAdmin 使用phpPgAdmin 匯出資料 直接使用phpPgAmin下載資料的方法

我有話要說

>>

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

訪客留言

[無留言]

隨機好文

[MAC] 截取螢幕畫面的方法 截取螢幕畫面的方法,在MAC中叫作螢幕快照,英文是screenshot

Linux shell 的date表示法 linux下SHELL中的date表示法

精讚的版面變化 ▓此文僅作為舊文的記錄▓ 這篇文章為了紀念改版完成而撰寫。 原本的部落格是民國97年的作品,那時還是用舊有的技術來寫,很

[NetBeans] 使用git複製別人的專案 NetBeans使用git複製別人的專案及版本控制

[Bootstrap] Datepicker使用/Bootstrap日期選日期選擇器的使用 Bootstrap日期選日期選擇器的使用