引言
Pandora FMS(Pandora灵活监控系统)是一款灵活、高度可扩展的监控软件,可以用来监控网络、服务器、应用程序和虚拟机等环境。Pandora FMS可以监控不同服务器操作系统和服务器应用系统(比如Web服务器、数据库和代理系统等)的状态及性能。Pandora FMS由服务器软件和监控代理组成。我在本教程中将介绍如何将Pandora FMS Server安装到CentOS 7上,以及如何在Ubuntu 15.04上添加监控代理。
前提条件
面向Pandora Server的CentOS 7 64位版本
面向Pandora代理的Ubuntu 15.04 64位版本
根权限
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上。该服务器将运行基于Web的Pandora用户界面,它将是核心地方,监控代理会连接到此处。
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权限。
chmod -R 777 /var/www/html/pandora_console/include
启动MariaDB和httpd
systemctl start mariadb
systemctl start httpd
从浏览器打开Pandora Server。
http://yourip/pandora_console/.
点击Next(下一步)。
![d07054f8b8572a9866b9a19094c3e80c.png](https://img2.php1.cn/3cdc5/39ff/1c8/bee9ef015f03ea4f.jpeg)
Pandora FMS
点击Yes, I accept licence terms.(是的,我接受许可证条款。)
![03c168c0b8892df5d5eabc882b2fa0f1.png](https://img2.php1.cn/3cdc5/39ff/1c8/d4c61de4e4f0b992.jpeg)
许可证
所有软件依赖项已安装,请为本教程选择“MySQL Database”(MySQL数据库)。
然后点击Next(下一步)。
![7597bed81cf26021635c455670aeee50.png](https://img2.php1.cn/3cdc5/39ff/1c8/fc763cc58c85e673.jpeg)
依赖项已安装
你将使用根权限,创建一个新的数据库,其名称为pandora。
点击Next(下一步)。
![166d4e21178502e0e83710500563d949.png](https://img2.php1.cn/3cdc5/39ff/1c8/d882f3d943d4424b.jpeg)
配置数据库
数据库配置已成功完成。请记下生成的随机性密码:dxowdqfx,因为下一步你要用到它。
点击Next(下一步)。
![79a16b9d08e58398c5fd6adcc523c175.png](https://img2.php1.cn/3cdc5/39ff/1c8/a8e6bd5ed2217766.jpeg)
数据库配置已成功完成
最后,Pandora控制台已安装,现在你可以用默认的登录信息来登录了。用户名= admin – 密码= pandora。
![eaa4ae3a5247e6ae34740bbf22d91c2e.png](https://img2.php1.cn/3cdc5/39ff/1c8/f6cf9712592c4cf0.jpeg)
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
现在登录进入到Pandora控制台。这是登录进入到Pandora控制台后的屏幕截图。
![0e7027ce62f5f9bcb3a6f514670f1baa.png](https://img2.php1.cn/3cdc5/39ff/1c8/1f88ef7c569b7b46.jpeg)
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服务器配置文件:
vi /etc/pandora/pandora_server.conf
在dbpass这一行添加生成的密码dxowdqfx。
![d60c300b8fe7102a22eaf309680fb12b.png](https://img2.php1.cn/3cdc5/39ff/1c8/c17cdcd6b3784df4.jpeg)
Pandora dbpass
然后启动Pandora服务器软件和Tentacle服务器软件。
/etc/init.d/pandora-server start
/etc/init.d/tentacle_serverd start
到了这一步,Pandora服务器已配置完毕,准备将监控的新主机添加到服务器。
将Pandora代理安装到Ubuntu 15.04上
在本教程的这个部分,你将把Pandora监控代理安装到Ubuntu 15.04上,并将它添加到Pandora服务器。
登录进入到Ubuntu服务器,运行该命令,成为根用户:
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,
![9a43e89fdf76dfcef5617e214e3e4873.png](https://img2.php1.cn/3cdc5/39ff/1c8/9593493c2b118375.jpeg)
Pandora代理
然后启动Pandora代理。
/etc/init.d/pandora_agent_daemon start
测试PandoraFMS
打开浏览器,登录进入到Pandora控制台。
http://192.168.43.187/pandora_console/
![d84ade3c77e8345f6b27cfee3585768a.png](https://img2.php1.cn/3cdc5/39ff/1c8/06da75271e709a3e.jpeg)
Pandora完成画面
你能看到:
IP地址为192.168.43.187的Pandora Server CentOS 7在运行。
IP地址为192.168.43.105的Ubuntu 15.04已受到监控。
结束语
Pandora FMS是一款功能强大的监控工具,可以用来监控服务器、网络和应用程序。它易于配置,并易于部署到服务器上。Pandora FMS可以监控不同的操作系统,比如Linux、Windows、HP-UX、Solaris和BSD,有一个完整的说明文档库。