Prerequisites
To monitor Node.js Applications, You need to configure both Node.js and Single agent. Ensure that both are running on the same machine:
- Single Agent
- Node.js Agent
Monitoring
1. Login into the Applicare console, go to the Download Agents screen, and download the appropriate agents: SingleAgentWindows for Windows, SingleAgentLinux for Linux. Then, transfer the download file to the machine where the agent will be deployed.
2. Extract the contents of the downloaded file.
3a. 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.
3b. Enter the Node.js home path where the application is running.
3c. Once the agent is successfully installed, You will see a message similar to the one shown below.
4. Navigate to the Node.js application home directory and insert the following code at the beginning of the 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 the SingleAgent home directory and execute the command based on the OS.
7a. For Windows:
- To start in command mode: execute startNode.jsAgent
- To start in task scheduler mode: execute createNode.jsAgentTask
7b. 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
Please sign in to leave a comment.