elasticman

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i elasticman

Weekly Downloads

3

Version

1.0.2

License

Apache-2.0

Unpacked Size

75.9 kB

Total Files

10

Last publish

Collaborators

  • raga