如何借助Pandora FMS監(jiān)控CentOS和Ubuntu服務(wù)器?
譯文引言
Pandora FMS(Pandora靈活監(jiān)控系統(tǒng))是一款靈活、高度可擴展的監(jiān)控軟件,可以用來監(jiān)控網(wǎng)絡(luò)、服務(wù)器、應(yīng)用程序和虛擬機等環(huán)境。Pandora FMS可以監(jiān)控不同服務(wù)器操作系統(tǒng)和服務(wù)器應(yīng)用系統(tǒng)(比如Web服務(wù)器、數(shù)據(jù)庫和代理系統(tǒng)等)的狀態(tài)及性能。Pandora FMS由服務(wù)器軟件和監(jiān)控代理組成。我在本教程中將介紹如何將Pandora FMS Server安裝到CentOS 7上,以及如何在Ubuntu 15.04上添加監(jiān)控代理。
前提條件
•面向Pandora Server的CentOS 7 64位版本
•面向Pandora代理的Ubuntu 15.04 64位版本
•根權(quán)限
•CentOS 7 IP:192.168.43.187
•Ubuntu 15.04 IP:192.168.43.105
我們在本教程中完成的操作如下:
•安裝Pandora FMS所需的必要程序包。
•禁用SELinux和firewalld。
•將Pandora Server安裝到CentOS 7上
•將Pandora代理安裝到Ubuntu 15.04上
•測試
安裝必要程序包
***步是將Pandora FMS軟件所需的必要程序包安裝到我們的CentOS Server上。該服務(wù)器將運行基于Web的Pandora用戶界面,它將是核心地方,監(jiān)控代理會連接到此處。
yum install mariadb-server httpd mod_php php-gd php-mysql php-mbstring xorg-x11-fonts-misc graphviz php-snmp php-pear php-ldap xorg-x11-fonts-75dpi graphviz perl-Sys-Syslog perl-libwww-perl perl-XML-Simple perl-XML-Twig net-snmp-utils perl-NetAddr-IP perl-IO-Socket-INET6 perl-Socket6 perl-Net-Telnet nmap perl-JSON perl-Encode-Locale net-snmp-perl perl-CPAN
CentOS基本軟件庫中沒有wimc程序包,于是我們使用wget命令來下載它,然后手動安裝它。
cd /tmp
wget http://softlayer-dal.dl.sourceforge.net/project/pandora/Tools%20and%20dependencies%20%28All%20versions%29/RPM%20CentOS%2C%20RHEL/wmic-4.0.0tp4-0.x86_64.rpm
rpm -ivh wmic-4.0.0tp4-0.x86_64.rpm
禁用SELinux:
sed -i -e 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
并停止firewalld:
systemctl stop firewalld
將Pandora FMS安裝到CentOS 7上
第1步:配置MariaDB/MySQL。
systemctl start mariadb
mysql_secure_installation
Set root password? [Y/n] Y
TYPE YOUR PASSWORD
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
第2步:安裝Pandora控制臺。
下載并安裝Pandora控制臺:
cd /tmp
wget http://sourceforge.net/projects/pandora/files/Pandora%20FMS%205.1/SP1Final/RHEL_CentOS/pandorafms_console-5.1SP1-1.noarch.rpm
rpm -ivh pandorafms_console-5.1SP1-1.noarch.rpm
為Pandora Server配置文件授予777權(quán)限。
chmod -R 777 /var/www/html/pandora_console/include
啟動MariaDB和httpd
systemctl start mariadb
systemctl start httpd
從瀏覽器打開Pandora Server。
http://yourip/pandora_console/.
點擊Next(下一步)。
Pandora FMS
點擊Yes, I accept licence terms.(是的,我接受許可證條款。)
許可證
所有軟件依賴項已安裝,請為本教程選擇“MySQL Database”(MySQL數(shù)據(jù)庫)。
然后點擊Next(下一步)。
依賴項已安裝
你將使用根權(quán)限,創(chuàng)建一個新的數(shù)據(jù)庫,其名稱為pandora。
點擊Next(下一步)。
配置數(shù)據(jù)庫
#p#
數(shù)據(jù)庫配置已成功完成。請記下生成的隨機性密碼:dxowdqfx,因為下一步你要用到它。
點擊Next(下一步)。
數(shù)據(jù)庫配置已成功完成
***,Pandora控制臺已安裝,現(xiàn)在你可以用默認的登錄信息來登錄了。用戶名= admin – 密碼= pandora。
Pandora管理員界面
在登錄到pandora之前,你需要更名/var/www/html/pandora_console目錄中的文件install.php。
mv /var/www/html/pandora_console/install.php /var/www/html/pandora_console/install_backup.php
現(xiàn)在登錄進入到Pandora控制臺。這是登錄進入到Pandora控制臺后的屏幕截圖。
Pandora
第3步:安裝Pandora Server。
下載和安裝Pandora Server。
cd /tmp
wget http://sourceforge.net/projects/pandora/files/Pandora%20FMS%205.1/SP1Final
/RHEL_CentOS/pandorafms_server-5.1SP1-1.noarch.rpm
rpm -ivh pandorafms_server-5.1SP1-1.noarch.rpm
編輯Pandora服務(wù)器配置文件:
vi /etc/pandora/pandora_server.conf
在dbpass這一行添加生成的密碼dxowdqfx。
Pandora dbpass
然后啟動Pandora服務(wù)器軟件和Tentacle服務(wù)器軟件。
/etc/init.d/pandora-server start
/etc/init.d/tentacle_serverd start
到了這一步,Pandora服務(wù)器已配置完畢,準(zhǔn)備將監(jiān)控的新主機添加到服務(wù)器。
將Pandora代理安裝到Ubuntu 15.04上
在本教程的這個部分,你將把Pandora監(jiān)控代理安裝到Ubuntu 15.04上,并將它添加到Pandora服務(wù)器。
登錄進入到Ubuntu服務(wù)器,運行該命令,成為根用戶:
sudo -
然后下載代理,并安裝到Ubuntu上:
cd /tmp
wget http://softlayer-
ams.dl.sourceforge.net/project/pandora/Pandora%20FMS%205.1/SP1Final/Debian
_Ubuntu/pandorafms.agent_unix_5.1SP1.deb
dpkg -i pandorafms.agent_unix_5.1SP1.deb
編輯Pandora代理配置文件,
vi /etc/pandora/pandora_agent.conf
在server_ip這一行添加Pandora Server IP地址:192.168.43.187,
Pandora代理
然后啟動Pandora代理。
/etc/init.d/pandora_agent_daemon start
測試PandoraFMS
打開瀏覽器,登錄進入到Pandora控制臺。
http://192.168.43.187/pandora_console/
Pandora完成畫面
你能看到:
IP地址為192.168.43.187的Pandora Server CentOS 7在運行。
IP地址為192.168.43.105的Ubuntu 15.04已受到監(jiān)控。
結(jié)束語
Pandora FMS是一款功能強大的監(jiān)控工具,可以用來監(jiān)控服務(wù)器、網(wǎng)絡(luò)和應(yīng)用程序。它易于配置,并易于部署到服務(wù)器上。Pandora FMS可以監(jiān)控不同的操作系統(tǒng),比如Linux、Windows、HP-UX、Solaris和BSD,有一個完整的說明文檔庫。