HI,
How do i compare the values of two (or more) channels in the Sensor Factory and alert if they return different numbers.
Details:
I have a checksum that runs on a database table, it returns a number, this checksum runs on what should be identical copies of this database.
so i have Channel Definition
#4:NS4SUM channel(5087,2) #5:NS5SUM channel(5088,2)
and i want to go into error state when channel(5087,2) <> channel(5088,2)
I tried
Status Definition
#1:Comparison (channel(5087,2) - channel(5088,2)) = 0
or
Status Definition
#1:Comparison (channel(5087,2) <> channel(5088,2))
or
Status Definition
#1:Comparison (channel(5087,2) != channel(5088,2))
and none of them went into error state when the channels reported differnt values. How can this be done? Also, can i compare 4 channel values and go into error state if any of the values differ from the others?
Thanks,
-chuck
Article Comments
Attention: This article is a record of a conversation with the Paessler support team. The information in this conversation is not updated to preserve the historical record. As a result, some of the information or recommendations in this conversation might be out of date.
Can you provide more details beyond "what you are doing is wrong" to help me solve my problem?
Jun, 2012 - Permalink
Okay, you cannot use the Status-Definition field for such calculations. So, why not creating a 3rd channel with
#3:Comparison (channel(5087,2) - channel(5088,2))
and then setting Error-Limits on this channel so that everything below and above 0 sets the sensor into an Error state?
Jun, 2012 - Permalink
Thanks, that was helpful.
For documentation purposes:
I wanted to make sure a (small) mysql database table was being replicated properly, so i created a MySQL sensor on each database that did a query like this:
select SUM(name + content) from records
this returns a number that is used in a Sensor Factory channel definition where i compare the two values by subtracting.
The sensor numbers are 5099 and 5096 and the channels (as listed under mysql channels tab 'Value ID') were both 2.
- 1:Table1vsTable4 (channel(5099,2) - channel(5096,2))
This value should always be 0, so setting the sensor factory sensor to alert when channel Table1vsTable4 was greater or less than 0 worked great.
Jun, 2012 - Permalink
Hello,
the Status-Definition field can only handle expressions with the STATUS(...)-command, not the normal channel-definition formulas.
best regards.
Jun, 2012 - Permalink