Anchor | ||||
---|---|---|---|---|
|
Note |
---|
To do the server configuration setup refer Server Configuration (server-config.json) |
Info |
---|
Agents are the tools data collectors of Insights. These are python snippets which connects to Devops DevOps tools and collect data using REST protocol. Each agents needs to be registered in system (Postgres DB, agent_configuration table) to start collecting data. Agent management screen in Admin tab helps manage agent registration, update, start, stop, UninstallManagement section under 'Configuration' helps to Add / Change Status / Edit / Delete Agents. When Insights product is installed, one of the important steps in is to installed install Agent Daemon. This is daemon process running on server where you want to run your tools agents. Daemon agents Agents helps Insights in agent registration, update, uninstallAdding / Changing Status / Editing / Deleting Agents. Daemon agent Agent needs connectivity to RabbitMQ. It is very critical that you make sure essential to ensure that agent Daemon is running (generally preferably on server 2, but can be anywhere you decide) before you start registering agent or as per the requirement) prior to registering an Agent from Insights UI (Admin tabUnder Configuration). We recommend to take latest artifacts for PlatformService.war , PlatformEngine.jar and UI app. NOTE - Current out-of-box agent daemon and agents support Windows and , RHEL 7.x, CentOS 7.5.x and Ubuntu 16.04 OS. For other OS flavors, one need to follow specific instructions given below in Other OS section. Agent Daemon is available in doc root at - httphttps://platform.cogdevopsgithub.com/insights_install/release/latest/CognizantOneDevOps/Insights/releases/download/v9.5/agentdaemon.zip Follow below installation instructions for Daemon agent configuration. |
Expand |
Daemon Agent Configuration and Execution
On Agent server
anchor- Create a folder at desired location to hold AgentDaemon and Tools agent code. For Example - On Windows D:\\Agents
- Set up environment variable INSIGHTS_AGENT_HOME pointing to above folder
- Create the following folders under the environment variable path $INSIGHTS_AGENT_HOME
AgentDaemon and
PlatformAgents - For example - D:\\Agents\\AgentDaemon and D:\\Agents\\PlatformAgents
- Provide executable and write permissions to these folders
- Download agentdaemon.zip from
- /CognizantOneDevOps/Insights/releases/download/v9.5/agentdaemon.zip and extract it inside AgentDaemon folder. Make sure folder structure starts with "com" and not "agentdaemon"
- Update config.json for following highlighted fields
Panel |
---|
{ "baseExtractionPath": " $INSIGHTS%Path%(INSIGHTS_AGENT_HOME)/PlatformAgents", "insightsTimeZone": "Asia/Kolkata", "loggingSetting": { "logLevel": "WARN" }, "mqConfig": { "host": "127.0.0.1", "password": "guest", "user": "guest", "exchange": "iSight", "agentExchange":"iAgent" }, "publish": { "health": "AGENT.DAEMON.HEALTH" }, "isDebugAllowed": false, "subscribe": { "agentPkgQueue": "INSIGHTS.AGENTS.PACKAGE" }, "timeStampFormat": "%Y-%m-%dT%H:%M:%SZ", "toolsTimeZone": "GMT" } |
Create AgentDaemon as service -
RHEL 7.x/Ubuntu/CentOS OS
- Use installdaemonagent.sh to create OS specific AgentDaemon service and provide OS input while running the script.
- Service name is "InSightsDaemonAgent"
Info |
---|
installdaemonagent.sh currently supports LinuxRHEL 7.x, Ubuntu 16.04 and CentOS 7.5.x, might need to update it based on other OS types and versions. |
Windows OS
- Install nssm utility on Agent server (which is part of Insights installation package )
- Run installdaemonagent.bat provided inside ..\\Agents\\AgentDaemon folder
- It will create Windows daemon agent service with name "DaemonAgent"
- Validate whether service has been installed and started successfully
Once agent daemon start running successfully, it should have creates a queue in RabbitMQ with name 'INSIGHTS.AGENTS.PACKAGE'
Expand | ||||
---|---|---|---|---|
| ||||
On Application/Platform server (Tomcat) info | ||||
Please note the docrootURL - http://platform.cogdevops.com/insights_install/release |
Info |
---|
Please note the Git rpo URL - Browse URL: https://github.com/CognizantOneDevOps/Insights/releases |
Panel |
---|
"agentDetails": { |
- Make sure that server-config.json has the following section
Panel |
---|
"messageQueue": { "host": "localhost", "user": "iSight", "password": "iSight", "prefetchCount" : 5 } |
Offline agent registration
- Inside offlineAgentPath, create folder and give it some version like v1.0 or same version which you are planning to manually download from docroot github release https://github.com/CognizantOneDevOps/Insights/tags url.
- Inside version folder create agent specific folders like "git", "jenkins", "jira" same as that of docroot
- Download individual agent zip from docroot github releases(https://github.com/CognizantOneDevOps/Insights/tags) and unzip them in respective agent folders
- Make sure folder structure is starting from com/cognizant/....
For Example typical structure assuming offlineAgentPath as "D://download//agents" --
"D:\\download\\agents\v1.0\git\com\cognizant..."
"D:\\download\\agents\v1.0\jenkins\com\cognizant..."
Deploy new PlatformService WAR
Run below SQL query to register Daemon Agent using PostgreSQL pgAdmin tool (Administration tool or SQL developer for PostgreSQL)
Update highlighted value '{"key":"value"}' in below query with daemon config.json.
panelRemove unique constraint on unique_key column and execute below query -
INSERT INTO public.agent_configuration(id, agent_id, agent_json, agent_key, agent_status, agent_version,data_update_supported, os_version, tool_category, tool_name,unique_key, update_date) VALUES (0, 0,'{"key":"value"}','daemon-1523257126' ,'' ,'' , FALSE,'' , 'DAEMONAGENT', 'AGENTDAEMON', '
daemon-1523257126', current_date);
- Register all required agents using Agent management tab in Admin screen. Follow Agent Management
- Run latest new updated Insights Engine Jar
- Validate all agents are running successfully and collecting data
title | Steps to upgrade older version of agents management |
---|
1. Stop all existing running agents
2. Very Important - Note down the time (including seconds) when you stopped individual agents. This time will be used while registering agents using UI.
3. Take backup of existing agent code including tracking.json
4. Let Insights Engine consume all queues data. Verify all the queues have 0 pending data
5. Shut down Insights Engine.
6. Undeploy PlatformService WAR
7. Take back up of AGENT_CONFIGURATION table in PostgreSQL
8. DELETE all records from AGENT_CONFIGURATION table in PostgreSQL (using PostgreSQL pgAdmin tool (Administration tool or SQL developer for PostgreSQL)) after taking backup
9. Deploy new PlatformService WAR and verify it has created below new columns in AGENT_CONFIGURATION table -
- agent_key
- agent_status
- agent_version
- os_version
10. Run SQL DDL script using PostgreSQL pgAdmin tool (Administration tool or SQL developer for PostgreSQL) –
Panel |
---|
ALTER TABLE public.agent_configuration ADD CONSTRAINT agentKeyUnique UNIQUE(unique_key); |
11. Execute below SQL query in PostgreSQL to register Daemon Agent (using PostgreSQL pgAdmin tool (Administration tool or SQL developer for PostgreSQL)) -
Update highlighted value '{"key":"value"}' in below query with Daemon agent config.json.
Panel |
---|
INSERT INTO public.agent_configuration(id, agent_id, agent_json, agent_key, agent_status, agent_version,data_update_supported, os_version, tool_category, tool_name,unique_key, update_date) VALUES (0, 0,'{"key":"value"}','daemon-1523257126' ,'' ,'' , FALSE,'' , 'DAEMONAGENT', 'AGENTDAEMON', 'daemon-1523257126', current_date); |
12. Follow Agent 2.0 installation steps
13. Register all required agents using Agent management tab in Admin screen. Follow Agent Management
- In this screen we will have the opportunity to edit the agent config json. Please make sure to get relevant fields from existing config json.
- Upload agent tracking.json (step #2 above) during registration . This will make sure your data is collected from last run date.
14. Run latest updated Insights Engine Jar
15. Validate all agents are running successfully and collecting data as usual- .
- Once configuration of Daemon Agent is done, please refer following section to configure an Agent:
Expand | ||
---|---|---|
| ||
|
Info |
---|
Other OS Running an application as a OS service differs based on Unix flavor. For Exampleexample, Linux RHEL it runs from /etc/init.d folder, in Ubunut it runs from /etc/systemd/system. Hence to run agent daemon and agents on OS other than Windows and RHEL 7.x Insights supported OS version, follow below steps.
If you have successfully run agents on OS other than Windows or RHEL 7.xcurrently supported OS version, we will encourage you to check-in those files in Github repository to help others. |
Back to Top Section