Skip to content

Nodejs Script to put the utilised heap memory of Apacheds Java Process into Cloudwatch

Notifications You must be signed in to change notification settings

piu28/apacheds_used_heap_to_cloudwatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

apacheds_used_heap_to_cloudwatch

The script can be used to put the Utilized Heap Memory of a Java Process as Cloudwatch Metric.

Setup

  • Java Process is running for ApacheDS Service.
  • An IAM Role has been attached to the EC2 Server which will allow the server to put metric in Cloudwatch.
  • Node v8.11 is installed.

Usage

  • Clone the Repo.
  • Install npm dependencies.
    • npm install aws-sdk child_process
  • Ensure jstat tool is installed.
    • yum install java-1.8.0-openjdk-devel
  • Execute: node used_heap_to_cloudwatch.js

Cron

I have scheduled the script using CronJob. The following command can be used in crontab:

* * * * * node ..../used_heap_to_cloudwatch/used_heap_to_cloudwatch.js >> /var/log/cron_used_heap_to_cloudwatch.log 2>&1

The script will execute every minute and put the used heap memory to the Cloudwatch metric. The names can be modified in the script.

From the AWS Console, an alarm can be configured for the graphed UsedHeap Metric that can be used to get notified if the Java Process is utilising more heap memory. Alarm

About

Nodejs Script to put the utilised heap memory of Apacheds Java Process into Cloudwatch

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published