To monitor Node JS Applications we need to configure Node JS and Single agents. These two agents should run in the same machine.
- Single Agent
- Node JS Agent
1. Login into Applicare console, go to Download Agents screen and download SingleAgentWindows (For Windows), SingleAgentLinux (For Linux). Copy the downloaded file to the machine where agent is to be deployed.
2. Unzip the downloaded file.
3. a.) Execute the deploynodejsagent.bat in Administrator mode inside the ApplicareSingleAgent.zip extracted directory, After executing, the message "Enter any open port for Applicare Agent" will appear in the command window and enter any open port in it.
b.) Then enter the Nodejs home path where the application is running.
c.) After the agent is successfully installed the message will appear as below shown.
4. Go to NodeJS Application home path and paste the below code in the first line of main file (usually called server.js or app.js).
var applicareConfig = require('./agent.config.js');
var applicare = require('applicare-agent')(applicareConfig);
5. Restart the Node JS server.
6. Go to SingleAgent home directory and execute the command based on the OS.
For Windows
- To start in command mode
- Execute startNodeJsAgent
- To start in task scheduler mode
- Execute createNodeJsAgentTask
For Linux
- To start in command mode
- Execute ./startNodeJsAgent
- To start in background mode
- Execute nohup ./startNodeJsAgent &
- To start as a service
- Execute ./installNodeJsAgentService
Comments
0 comments
Article is closed for comments.