Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

adding ability to create calulcated items #12

Open
wants to merge 3 commits into from

1 participant

@joshbronson

No description provided.

Josh Bronson and others added some commits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 17, 2013
  1. adding ability to create calulcated items

    Josh Bronson authored
Commits on May 1, 2013
  1. bug fix for calculated types

    Josh Bronson authored
  2. fix for difference item

    Josh Bronson authored
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/rubix/models/item.rb
View
4 lib/rubix/models/item.rb
@@ -86,6 +86,7 @@ def self.value_code_from_value value
zabbix_attr :history
zabbix_attr :trends
zabbix_attr :status
+ zabbix_attr :formula
zabbix_attr :frequency
def initialize properties={}
@@ -131,7 +132,8 @@ def create_params
p[:trends] = trends.to_i if trends
p[:status] = self.class::STATUS_CODES[status] if status
p[:delay] = frequency if frequency
- if multiply_by && multiply_by.to_f != 0.0
+ p[:params] = formula if formula && type == :calculated
+ if multiply_by && multiply_by.to_f != 0.0 && formula.nil?
p[:multiplier] = 1
p[:formula] = multiply_by.to_f
end
Something went wrong with that request. Please try again.