Статьи

Начало работы с Hyperic 4.5 с открытым исходным кодом

Hyperic — это мощный и ценный инструмент для вашего рассмотрения, если вам нужны Management и Monitor, и даже он предлагает вам воспользоваться другими важными функциями в своих приложениях Java Enterprise. Кроме того, Hyperic может работать с vFabric и Cloud Foundry.

Это первая из многих статей, основанных на этом инструменте. Поэтому первая статья должна быть такой, как вы ожидаете, скачать и установить.

Hyperic предлагает две версии для загрузки: Enterprise и Open Source . Разница заключается в дополнительных функциях, которые предлагают Enterprise, чем Open Source

В этих сериях я буду работать с обеими версиями, чтобы показать вам возможности каждой из них и, наконец, призвать вас рассмотреть вариант покупки версии Enterprise . Я начну с версии с открытым исходным кодом .

 

Хорошо пойдем !

Шаг 01: Загрузка установщиков сервера и агента

Вы можете перейти на домашнюю страницу Hyperic, и у вас есть два способа получить программное обеспечение. В любом случае вы должны попасть на одну и ту же целевую страницу.

Первый способ — кликнуть прямо в меню «Ссылка на скачивание» , где вы сможете увидеть обе версии на ваш выбор. Даже эта страница показывает вам функции, доступные для каждого.

Второй способ — просто наведите указатель мыши на меню «Ссылка для загрузки» и подождите, чтобы показать обе версии, и, наконец, нажмите на любую из них.

В любом случае, и поскольку я сказал, что мы собираемся начать с версии с открытым исходным кодом , вы должны прибыть в редакцию Download Hyperic HQ с открытым исходным кодом . Заполните форму и нажмите кнопку « Загрузить сейчас» .

После этого у вас есть две программы на ваше рассмотрение:

  • Hyperic Server Package — ядро ​​мониторинга и пользовательский интерфейс, позволяющий управлять всей ИТ-инфраструктурой с одного центрального компьютера.
  • Пакет Hyperic Agent — для каждой платформы, которую вы хотите отслеживать, требуется, чтобы «агент» отправлял отчеты на Hyperic-сервер (т. Е. Если вы хотите отслеживать Apache в Linux и Apache в Solaris, вам нужно загрузить как Linux, так и Solaris пакеты агентов).

Последняя и стабильная версия доступна 4.5

Ниже приведены некоторые снимки целевой страницы.

Рисунок 01: Шаг 1 — Загрузите Hyperic Server Package

Рисунок 02: Шаг 2. Загрузите пакет (ы) Hyperic Agent

Даже у вас есть последний шаг о документации, показать ниже

Рисунок 03: Шаг 3 — Установите и настройте

Для установщиков Hyperic Server Package и Hyperic Agent Package я буду использовать Linux для 32 бит . Имена файлов соответственно:

  • Hyperic-HQ-инсталлятор-4,5-x86-linux.tar.gz
  • Hyperic-HQ-агент-4,5-x86-linux.tar.gz

Что касается Linux Я работаю с Fedora Core 15 , я предполагаю, что вы уже установили и настроили последнюю версию Java, доступную от Oracle. Это Java SE Development Kit 6, обновление 29

Я начну работать с файлом сервера. Это hyperic-hq-installer-4.5-x86-linux.tar.gz

Шаг 02: Распакуйте файл сервера

Откройте свой Первый терминал. Я буду работать над своим собственным каталогом /home/Section1/whiteroom/springsource/hyperic/4.5 . Считайте это место похожим на наш корневой каталог. Поэтому оттуда я создам сервер каталогов только для распаковки и установки. Кстати, не обязательно имеет такие же имена каталогов, как у меня. Перейдите к серверу каталогов, чтобы распаковать пакет hyperic-hq-installer-4.5-x86-linux.tar.gz .

Поэтому в каталоге /home/Section1/whiteroom/springsource/hyperic/4.5/server у нас должен быть новый каталог с именем hyperic-hq-installer-4.5 . Вы должны получить в этом новом каталоге следующие файлы, показанные ниже

Рисунок 04: hyperic-hq-installer-4.5-x86-linux.tar.gz распакован

Поймите, у нас есть даже два других упакованных файла: hyperic-hq-agent-4.5-x86-linux.tar.gz и server-4.5.tar.gz . Как быстрое введение, на самом деле от них мы можем установить Сервер и Агент .

Шаг 03: Выполнение сценария установки

В первом терминале перейдите к этому новому каталогу hyperic-hq-installer-4.5 и выполните следующую команду chmod + x setup.sh, а затем выполните скрипт setup.sh , вы должны получить следующее в своем терминале

[Section1@localhost hyperic-hq-installer-4.5]$ chmod +x setup.sh
[Section1@localhost hyperic-hq-installer-4.5]$ ./setup.sh
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 Installation...
Choose which software to install:
1: Hyperic HQ Server
2: Hyperic HQ Agent
You may enter multiple choices, separated by commas.

Я выберу вариант 1, потому что хочу начать работу с сервером, пока в этом процессе он запрашивает целевой каталог и пароль. Ну, целевой каталог для установки будет /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5, а для простоты пароль будет springsource . Ниже все вместе.

You may enter multiple choices, separated by commas.
1
HQ server installation path [default '/home/hyperic']:
/home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5
Enter an encryption key to use to encrypt the database password.:
springsource

После того, как записать эти значения вы собираетесь получить следующий вывод

Loading install configuration...
Install configuration loaded.
Preparing to install...
Validating server install configuration...
Checking server webapp port...
Checking server secure webapp port...
Verifying admin user properties
Validating server DB configuration...
Installing the server...
Unpacking server to: /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5...
Creating server configuration files...
Copying binaries and libraries to server installation...
Copying server configuration file...
Copying server db-upgrade files...
Copying server libs...
Setting up server database...

Now login to another terminal as root and execute this script:

    /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/installer/data/hqdb/tune-os.sh

This script sets up the proper shared memory settings to run the
built-in database.

Press Enter after you run the script to continue this installation.

Шаг 04: Устанавливает правильные настройки общей памяти для запуска встроенной базы данных

Это имя шага происходит от окончательных указаний, показанных на шаге 03 .

This script sets up the proper shared memory settings to run the
built-in database.

Другое важное указание, показанное на шаге 03 :

Now login to another terminal as root and execute this script:

    /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/installer/data/hqdb/tune-os.sh

Therefore open a Second terminal. Dont forget you must work here with root privilegies.

[Section1@localhost hyperic-hq-installer-4.5]$ su
Contraseña: 
[root@localhost hyperic-hq-installer-4.5]# cd /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/installer/data/hqdb
[root@localhost hqdb]# 

BTW contraseña=password. Just to be curious, lets see what files we have on this directory

[root@localhost hqdb]# ls
conf  pgsql.tar.gz  tune-os.sh
[root@localhost hqdb]# 

Then execute the script tune-os.sh

[root@localhost hqdb]# ./tune-os.sh
/etc/sysctl.conf does not define kernel.shmmax, adding it
	
Tuning completed successfully!
	
[root@localhost hqdb]# 

Thats all for this step

Step 05: Executing the setup script

Recall that the last indication show on Step 03 was Press Enter after you run the script to continue this installation.. Recall again this indication is shown on the first terminal, do it and you should see the follow long final output.

Press Enter after you run the script to continue this installation.


Setting up JDBC driver...
Copying database files...
Configuring database...
Loading taskdefs...
Taskdefs loaded
Starting repopulation of configuration table...
Starting built-in database...
Waiting for built-in database to start (on port 9432)...
Preparing database...
Loading taskdefs...
Taskdefs loaded
Loading taskdefs...
Taskdefs loaded
Loading taskdefs...
Taskdefs loaded
Waiting for server to stop...
Stopping built-in database...
Built-in database stopped.
Installing the server JRE ...
Unpacking JRE x86-linux-1.6.tar.gz to: /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/server-4.5...
Setting permissions on server binaries...
Fixing line endings on text files...
--------------------------------------------------------------------------------
Installation Complete:
  Server successfully installed to: /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/server-4.5
--------------------------------------------------------------------------------


 You can now start your HQ server by running this command:

  /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/server-4.5/bin/hq-server.sh start

 Note that the first time the HQ server starts up it may take several minutes
 to initialize.  Subsequent startups will be much faster.

 Once the HQ server reports that it has successfully started, you can log in
 to your HQ server at: 

  http://localhost.localdomain:7080/
  username: hqadmin
  password: hqadmin

 To change your password, log in to the HQ server, click the "Administration"
 link, choose "List Users", then click on the "hqadmin" user.


Setup completed.
A copy of the output shown above has been saved to:
  /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/installer/logs/hq-install.log

Deleting temporary JRE
[Section1@localhost hyperic-hq-installer-4.5]$ 

If you check the ouput shown above, it indicate that the installation was done on the directory server-4.5, where it is located within our directory hyperic-hq-installer-4.5. Therefore, until this point we practically unpacked the file server-4.5.tar.gz creating the directory server-4.5. Below the final result of this process.

Figure 05: directory hyperic-hq-installer-4.5

Just to be curious lets see the files contained within the directory server-4.5. It is show in the follow image

Figure 06: directory server-4.5

Step 06: Starting The Server

In the previous Step 05 we have the follow indication

 You can now start your HQ server by running this command:

  /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/server-4.5/bin/hq-server.sh start

Then open a Third terminal and move to the indicated directory /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/server-4.5/bin/ and execute the script with the suggested argument hq-server.sh start. BTW, is not necessary has root privilegies

[Section1@localhost bin]$ ./hq-server.sh start
Starting HQ Server...
[Section1@localhost bin]$ 

Step 07: Working with Hyperic

Again, from Step 05 we have the follow indication

Once the HQ server reports that it has successfully started, you can log in
 to your HQ server at: 

  http://localhost.localdomain:7080/
  username: hqadmin
  password: hqadmin
 

OK, open your favorite Web Browser and use the follow URL http://localhost.localdomain:7080/. You should see the follow image

Figure 07: Opening Hyperic’s Login Page

Once you write the username and password you must see the follow image

Figure 08: Hyperic’s Welcome Page

If you want change the default password, from Step 05 we have the follow indication

 To change your password, log in to the HQ server, click the "Administration"
 link, choose "List Users", then click on the "hqadmin" user.

Step 08: Shutdown The Server

Until this point we have a successful instalation and startup of the Hyperic 4.5 Open Source‘s Server.

If you want to shutdown the server, just execute the follow script with the indicated argument hq-server.sh stop

[Section1@localhost bin]$ ./hq-server.sh stop
Stopping HQ Server...
Waiting for HQ Server to exit...
Stopped HQ Server.
[Section1@localhost bin]$ 

Step 09: Install The Agent

Now is the turn to install the Agent, we can do this returning to our first terminal, if you closed it by mistake afterwards to shutdown the server, open a new terminal and go to /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5. Then again execute the script setup.

[Section1@localhost hyperic-hq-installer-4.5]$ ./setup.sh
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 Installation...
Choose which software to install:
1: Hyperic HQ Server
2: Hyperic HQ Agent
You may enter multiple choices, separated by commas.

Now we must choice the option 2, and thats all. Below the final result of this process

You may enter multiple choices, separated by commas.
2
HQ agent installation path [default '/home/hyperic']:
/home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5
Loading install configuration...
Install configuration loaded.
Preparing to install...
Validating agent install configuration...
Installing the agent...
Looking for previous installation
Unpacking /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/hyperic-hq-agent-4.5-x86-linux.tar.gz to: /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/agent-4.5...
Setting permissions on agent binaries...
Fixing line endings on text files...
--------------------------------------------------------------------------------
Installation Complete:
  Agent successfully installed to: /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5
--------------------------------------------------------------------------------
You can now start your HQ agent by running this command:

       /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/agent-4.5/bin/hq-agent.sh start

Setup completed.
A copy of the output shown above has been saved to:
  /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/installer/logs/hq-install.log

Deleting temporary JRE
[Section1@localhost hyperic-hq-installer-4.5]$ 

Therefore, until this point we practically unpacked the file hyperic-hq-agent-4.5-x86-linux.tar.gz creating the directory agent-4.5. Below the final result of this process.

Figure 09: directory hyperic-hq-installer-4.5

Just to be curious lets see the files contained within the directory agent-4.5. It is show in the follow image

Figure 10: directory agent-4.5

Step 10: Startup The Agent

From the previous Step 09 final output, we have the follow indication

You can now start your HQ agent by running this command:

       /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/agent-4.5/bin/hq-agent.sh start

Then open a Fourth terminal and move to /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/agent-4.5/bin/ and execute the follow script with the indicated argument hq-agent.sh start. Below the execution.

[Section1@localhost hyperic-hq-installer-4.5]$ cd  /home/Section1/whiteroom/springsource/hyperic/4.5/server/hyperic-hq-installer-4.5/agent-4.5/bin/
[Section1@localhost bin]$ 

[Section1@localhost bin]$ ./hq-agent.sh start
Starting HQ Agent...
[ Running agent setup ]
What is the HQ server IP address: 127.0.0.1
Should Agent communications to HQ always be secure [default=no]: yes
What is the HQ server SSL port [default=7443]: 
- Testing secure connection ... Failure

Mmmm, a Testing secure connection … Failure???. Why?. That’s correct, in Step 08 I executed the script to shutdown the server, therefore in such terminal proceed to startup the server again. Read the Step 06 to know where and how start it. Once done this, lets try again

[Section1@localhost bin]$ ./hq-agent.sh start
Starting HQ Agent...
[ Running agent setup ]
What is the HQ server IP address: 127.0.0.1
Should Agent communications to HQ always be secure [default=no]: yes
What is the HQ server SSL port [default=7443]: 
- Testing secure 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.34]: 
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
    1320779560575-3116430871852762436-4839775377226105482
- Informing agent of new HQ server
- Validating
- Successfully setup agent
[Section1@localhost bin]$ 

Is important to know that only the first time we start the Agent some values are required. Just check the output above again

Until this point we have a successful instalation and startup of the Hyperic 4.5 Open Source‘s Agent.

Step 11: Shutdown The Agent

To turn off your PC, you must shutdown first the Agent and then the Server. For the Agent just execute the follow script with the argument indicated hq-agent.sh stop

[Section1@localhost bin]$ ./hq-agent.sh stop
Stopping HQ Agent...
Stopped HQ Agent.
[Section1@localhost bin]$ 

To Stop de Server just read the Step 08

Step 12: Setting Setup (Optional)

If you for any reason you want change some configuration done for the Agent. You must use again the script hq-agent.sh. See below the execution of this command.

[Section1@localhost bin]$ ./hq-agent.sh
Usage: ./bundles/agent-4.5/bin/hq-agent.sh { start | stop | restart | status | dump | ping | setup }

Lets work with the setup argument

[Section1@localhost bin]$ ./hq-agent.sh setup
Unable to setup agent: Unable to connect to 127.0.0.1:2144: Connection refused
The Agent must be running prior to running setup
[Section1@localhost bin]$ 

Lets see what return with the status argument

[Section1@localhost bin]$ ./hq-agent.sh status
HQ Agent is not running.
[Section1@localhost bin]$

For both cases we have practically got the same message about the Agent is not running. OK, we proceed to startup it.

[Section1@localhost bin]$ ./hq-agent.sh start
Starting HQ Agent...
[Section1@localhost bin]$ 

Lets work with the setup argument again

[Section1@localhost bin]$ ./hq-agent.sh setup
[ Running agent setup ]
What is the HQ server IP address: 127.0.0.1
Should Agent communications to HQ always be secure [default=no]: yes
What is the HQ server SSL port [default=7443]: 
- Testing secure 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.34]: 
What port should HQ use to contact the agent [default=2144]: 
- Agent is already setup for HQ @ https://127.0.0.1:7443/lather
Would you like to re-setup the auth tokens [default=no]: yes
- Received temporary auth token from agent
- Registering agent with HQ
- HQ gave us the following agent token
    1320782468294-7630720779988242626-607376425292238385
- Informing agent of new HQ server
- Validating
- Successfully setup agent
[Section1@localhost bin]$

It is almost the same interaction shown on Step 10, we have a new line Would you like to re-setup the auth tokens [default=no]: yes and practically the rest is the same.

Lets see what return with the status argument again

[Section1@localhost bin]$ ./hq-agent.sh status
HQ Agent is running (PID:5230).
Current agent bundle: agent-4.5
Server IP address: 127.0.0.1
Server (SSL) port: 7443
Agent listen port: 2144
[Section1@localhost bin]$

Some considerations

Until this point we have installed the Server and Agent for a same machine. What happen if we have a node or other PC to be monitored?. Even more if you recall the Step 01 we downloaded two files and we only used only the first.

  • hyperic-hq-installer-4.5-x86-linux.tar.gz
  • hyperic-hq-agent-4.5-x86-linux.tar.gz

Dont forget when we unpacked the file hyperic-hq-installer-4.5-x86-linux.tar.gz we work around with some scripts that work directly wih these files hyperic-hq-agent-4.5-x86-linux.tar.gz and server-4.5.tar.gz

Therefore, next, we will cover how install the Agent in a stand alone option in other machine. For quickly purposes, I will do this in the same machine.

Step 13: Unpack The Agent File

Open your fifth terminal. Recall my root directory /home/Section1/whiteroom/springsource/hyperic/4.5. I will create the directory agent only for unpack and installation purposes. BTW, is not mandatory has the same directories names like me. Proceed to move to the directory agent to unpack the package hyperic-hq-agent-4.5-x86-linux.tar.gz.

Therefore in the location /home/Section1/whiteroom/springsource/hyperic/4.5/agent we must have a new directory named hyperic-hq-agent-4.5. You should get within this new directory the follow files shown below

Figure 11: hyperic-hq-agent-4.5-x86-linux.tar.gz unpacked

Step 14: Startup The Agent

From our actual location /home/Section1/whiteroom/springsource/hyperic/4.5/agent, proceed to move to hyperic-hq-agent-4.5/bin and simply execute the follow script with the argument indicated hq-agent.sh start . Recall the Server must be running!

[Section1@localhost bin]$ ./hq-agent.sh start
Starting HQ Agent...
[ Running agent setup ]
What is the HQ server IP address: 127.0.0.1
Should Agent communications to HQ always be secure [default=no]: yes
What is the HQ server SSL port [default=7443]: 
- Testing secure 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.34]: 
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
    1320782468294-7630720779988242626-607376425292238385
- Informing agent of new HQ server
- Validating
- Successfully setup agent
[Section1@localhost bin]$ 

Is important know the IP of the server and the port used by it

Again is important to know that only the first time we start the Agent some values are required. Just check the output above again. You would wondered by you are must again make this setup when it has been done on Step 10. The answer is simply. We are working with other installer. I mean an Agent is already included within the Server and this one is stand alone.

Step 15: Shutdown The Agent

Just execute the follow script with the argument indicated hq-agent.sh stop

[Section1@localhost bin]$ ./hq-agent.sh stop
Stopping HQ Agent...
Stopped HQ Agent.
[Section1@localhost bin]$ 

Final Notes:

Congratulations!!!. You have learned how adquire Hyperic Open Source 4.5 on Server and Agent presentations. And respectively how install, configure and startup each one.

You have learned too how install and startup the Agent stand alone.

In the follow articles I will you show you some interaction with Hyperic Server

You can read this article in my Blog here