本文出自:dogdogcom.blog.51cto.com
公司使用的监控系统是Hyperic HQ 4.5,由于之前没用过过,周末自己尝试安装一次,这样会深刻一点。
Hyperic HQ 4.5可以监控的东西非常的多。
网上找了半天,居然没找到几个关于这软件的安装配置教程,不要说功能详解了,唯一找到的中文文档竟然要收费。。。。
摸了半天终于配出来了。下面就开始讲一下安装和配置的过程。。
1.首先搭建好LAMP架构
yum install httpd mysql-server
2.配置mysql
进入mysql
mysql> create user 'hq'@'localhost' identified by 'hq';
mysql> create database HQ; #这个要注意,要大写HQ
mysql> grant all on HQ.* to 'hq'@'localhost';
下载服务端和客户端(这个也是找了半天的--!)
http://ftp2.ie.netbsd.org/mirrors/download.sourceforge.net/pub/sourceforge/h/project/hy/hyperic-hq/Hyperic%204.5.1/Hyperic%204.5.1-GA/
#tar xvf hyperic-hq-installer-4.5.1-x86-64-linux.tar
#useradd hq
#chown hq:hq cd hyperic-hq-installer-4.5.1 #因为安装这个不能用ROOT安装
#mkdir /home/hyperic
#chown hq:hq /home/hyperic -R #后面安装默认是这个,如果没有这目录安装会失败。除非你自己自定义。
#su - hq #切换到hq用户安装
#cd hyperic-hq-installer-4.5.1
#./setup -full
[hq@localhost hyperic-hq-installer-4.5.1]$ ./setup.sh -full Unpacking JRE to temporary directory /tmp/jre Please ignore references to missing tools.jar Unable to locate tools.jar. Expected to find it in /tmp/lib/tools.jar Loading taskdefs... Taskdefs loaded Initializing Hyperic HQ 4.5.1 Installation... Choose which software to install: 1: Hyperic HQ Server 2: Hyperic HQ Agent You may enter multiple choices, separated by commas. 1 选择安装服务器 HQ server installation path [default '/home/hyperic']: What port should the HQ server's web-based GUI listen on for http communication? [default '7080']: What port should the HQ server's web-based GUI listen on for secure https communication? [default '7443']: Enter the base URL for the HQ server's web-based GUI [default 'http://jiankong.dog.com:7080/']: Enter the email address that HQ will use as the sender for email messages [default 'hqadmin@dog.com']: Choices: 1: HQ Built-in Database 2: Oracle 10g/11g 3: PostgreSQL 4: MySQL Enterprise / Community Server 5.x The HQ built-in database is provided for EVALUATION PURPOSES ONLY. For production use, MySQL or Oracle is recommended. What backend database should the HQ server use? [default '1']:4 选择mysql Enter the JDBC connection URL for the MySQL Enterprise / Community Server 5.x database [default 'jdbc:mysql://localhost:3306/HQ']: Enter the username to use to connect to the database: hq 登陆数据库的用户名 Enter the password to use to connect to the database.: (again): 登陆数据库的密码hq Enter an encryption key to use to encrypt the database password.: abcdefg 密码 What should the username be for the initial admin user? [default 'hqadmin']: 登陆监控系统的用户名默认hqadmin What should the password be for the initial admin user?: (again): 输入密码 Values do not match What should the password be for the initial admin user?: (again): What should the email address be for the initial admin user? [default 'hqadmin@dog.com']: 默认
安装完启动服务:
# /home/hyperic/server-4.5.1/bin/hq-server.sh start #这个忘记了使用ROOT还是hq用户启动的,自己试试。
切换到root用户运行
# netstat -ntl 可以看到7080端口
这时候,服务器就配置成功了,访问http://IP:7080 登入刚刚设置的用户名和密码就可以进入了。
-------------------------------------
客户端设置
tar xvf hyperic-hq-agent-4.5.1-x86-64-linux.tar 下载地址查看上面
cd 解压目录 bin 下
[root@localhost bin]# ./hq-agent.sh setup
root@localhost bin]# ./hq-agent.sh setup [ Running agent setup ] What is the HQ server IP address: 192.168.1.11 这个是服务器IPShould Agent communications to HQ always be secure [default=no]: What is the HQ server port [default=7080]: - Testing insecure connection ... Success What is your HQ login [default=hqadmin]: What is your HQ password: What IP should HQ use to contact the agent [default=192.168.1.146]: 自动搜出本机IP What port should HQ use to contact the agent [default=2144]: - Received temporary auth token from agent - Registering agent with HQ - HQ gave us the following agent token 1304880316310-7629219473865430919-2070226055442958355 - Informing agent of new HQ server - Validating - Successfully setup agent [root@localhost bin]# ./hq-agent.sh restart
好啦,这时候客户端也启动了。
等大概30秒我们在访问服务器网站http://192.168.1.11:7080 刷新一下
会自动搜出刚刚的客户端的。
点Resources -browse 可以列出添加的客户端。如上图:
点进去可以看到客户机的状态,如下图:
-----------------------------------------------------------------------------------
报警
点击ALERT--configure-new
这样就可以设置负载大于6就警告
添加报警的邮箱。。。要发邮件必须启动sendmail
建议设置139 或yeah.net邮箱。这两个都不拒绝没反响解析的邮件的。其他例如 yahoo都收不到的。
好啦。其他的自己摸索,我也是自己摸索了一天搞出来的。有什么好的发现欢迎留言。
转载于:https://blog.51cto.com/dogdogcom/561893