Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to add multiple alarms to a check #36

Open
sleenen opened this issue Feb 4, 2016 · 13 comments
Open

Ability to add multiple alarms to a check #36

sleenen opened this issue Feb 4, 2016 · 13 comments

Comments

@sleenen
Copy link

sleenen commented Feb 4, 2016

It seems I can only add 1 alarm to a check, I'd like the ability to add more alarms to the same check (for example send a mail, but also send an SMS)

Is this already possible? If not, this would be a great feature imo.

@martinb3
Copy link
Contributor

martinb3 commented Feb 4, 2016

I think you might be describing notification plans, not alarms?

@sleenen
Copy link
Author

sleenen commented Feb 4, 2016

I don't think so. I can add multiple alarms in the control panel, using a different notification method

@martinb3
Copy link
Contributor

martinb3 commented Feb 4, 2016

Do you also use different criteria for each alarm?

@martinb3
Copy link
Contributor

martinb3 commented Feb 4, 2016

You can send an email and an SMS using a notification plan on a single alarm, is why I ask. You don't need two alarms to send notifications to email and SMS.

@sleenen
Copy link
Author

sleenen commented Feb 4, 2016

I do yes. For instance I'd like an email when filesystem is 85% full and 90%, but a text message on 90% and 95%.

@martinb3
Copy link
Contributor

martinb3 commented Feb 4, 2016

Gotcha. Thank you for clarifying that. I'll mark this issue as an enhancement :)

@sleenen
Copy link
Author

sleenen commented Feb 4, 2016

Thank you, would be a great feature imo. More control over alarms that way.

@james-ai
Copy link

james-ai commented May 3, 2016

Is this feature on the roadmap? I'd be happy to put some time in if required.

@martinb3
Copy link
Contributor

martinb3 commented May 3, 2016

I'd be glad to review this and merge it, if someone wanted to work on a PR for it. Thanks!

@james-ai
Copy link

james-ai commented May 4, 2016

Update: Just realised some arguments weren't being passed through to the template which is why the below didn't work. Ignore this.

Where's the documentation on how the check/alarm yaml file in /etc/rackspace-monitoring-agent.conf.d/ should look?

I've tried the following to no avail:

disabled: false
label: Filesystem
period: 90
timeout: 30
type: agent.filesystem
details:
  target: /
alarms:
  alarm-disk-use:
    label: Filesystem use on /
    notification_plan_id: npTechnicalContactsEmail
    criteria: |
      if (percentage(metric['used'], metric['total']) >  ) {
        return new AlarmStatus(CRITICAL, 'Disk usage is above %, #{used} out of #{total}');
      }
      if (percentage(metric['used'], metric['total']) >  ) {
        return new AlarmStatus(WARNING, 'Disk usage is above %, #{used} out of #{total}');
      }
      return new AlarmStatus(OK, 'Disk usage is below your warning threshold of %, #{used} out of #{total}');
  alarm-inode-use:
    label: Inode use on /
    notification_plan_id: npTechnicalContactsEmail
    criteria: |
      if (percentage(metric['free_files'], metric['files']) < 20) {
        return new AlarmStatus(CRITICAL, 'Less than 20% free inodes');
      }

      if (percentage(metric['free_files'], metric['files']) < 30) {
        return new AlarmStatus(WARNING, 'Less than 30% free inodes');
      }

      if (percentage(metric['free_files'], metric['files']) > 30) {
        return new AlarmStatus(OK);
      }

@martinb3
Copy link
Contributor

martinb3 commented May 4, 2016

@james-ai
Copy link

Do we want to pre-define a number of alarms for users to switch on/off individually or do we want them to supply their own alarm templates which are then incorporated into the agent's yaml file?

@martinb3
Copy link
Contributor

I think we should add some additional alarms via templates, but not provide control over switching them off and on. That way, once someone is ready to customize, they can simply just go with their own template and have access to everything (vs. tons of settings to wade through). How does that sound?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants