Skip to content

Elasticman: An elasticsearch monitering and alerting tool

License

Notifications You must be signed in to change notification settings

gurbaj5124871/elasticman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elasticman

Elasticman: An elasticsearch monitoring and alerting tool

The elastiman constantly monitors the your elasticsearch cluster's health by checking the following:

  1. It checks the overall clusters health as if any of the node left the cluster or any shard is not avaliable.
  2. It checks over all the nodes present in the cluster following parameters:
    • CPU usage Alert
    • Memory usage alert
    • Disk space usage for all mounts on perticular node
    • Swap Memory alert
    • Open File Descriptors alert
    • Heap usage alert

Currenty Elasticman supports mail and slack integrations.

Usage:

Install the package npm:

npm i elasticman -g

Then, create a file called config.js and paste the following inside it:

module.exports = {
    // Elasticsearch Cluster Nodes uri's
    nodes: [
        'http://localhost:9200'
    ],
    // Number of seconds to wait in between health checks
    interval: 30,
    // Alerting CPU usage in percent
    maxCpuUsage: 50,
    // Cutoff Nodes memory in percentage
    maxAvailableMemoryInUse: 60,
    // Alerting data space in percentage (will calculate for all the mount storages)
    maxDataSpaceInUse: 80,
    // alerting OS swap memory in percentage
    maxSwapMemory: 50,
    // alerting open file descriptors in percentage
    maxOpenFileDescriptors: 80,
    // Alerting jvm heap size in percentage
    maxHeapUsed: 80,
    // SMTP configuration for sending alert e-mails (delete to disable)
    smtp: {
        host: 'smtp.gmail.com',
        port: 465,
        secure: true,
        auth: {
            user: 'username@gmail.com',
            pass: 'password'
        },
        address: 'username@gmail.com'
    },
    // Slack configuration for sending alert messages through webhook (delete to disable)
    slack: {
        channelUrl: 'https://hooks.slack.com/services/xxx/xxx/xxx',
        notifyMembers: ['gurbaj', 'singh'] // enter slack user names here
    }
};

Modify the configuration file according to your need:

smtp (optional) - the SMTP e-mail configuration for sending alerts (using Gmail, AWS SES, etc) • slack (optional) - the Slack webhook configuration for sending alert messages

Test the SMTP configuration by running:

elasticman --test-email

Test the Slack configuration by running:

elasticman --test-slack

Finally run elasticman from the same directory as your config.js or you can also provide the confing file's path by running the command elasticman -c <path to the config file>

If you want to keep your process running uninterrupted (recommended), it is advisable to use a process manager like PM2 or forever.

License

Apache 2.0