dbroeglin/nagios_check — pull request #2 by shr3kst3r (2013-01-17 16:40:12+00:00)
Title: Modify the handling of @ symbol when specifying the check range

It looks like the @ symbol does not behave as defined in http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT. In the range code the @ symbol changed the range 10:20 from alerting on x < 10 or x > 20 to alerting on x <= 10 or x >= 20, when it should have change it to alerting on x >= 10 or x <= 20.

Because the spec is a bit difficult to understand, I generated this table.

Range
Generate an alert if x

10
x < 0 or x > 10, (x does not alert if x >= 0 or x <= 10)

@10
x >= 0 or x <= 10, (x does not alert if x < 0 or x > 10)

10:
x < 10, (x does not alert if x >= 10)

@10:
x >= 10, (x does not alert if x < 10)

~:10
x > 10, (x does not alert if x <= 10)

@~:10
x <= 10, (x does not alert if x > 10)

10:20
x < 10 or x > 20, (x does not alert if x >= 10 or x <= 20)

@10:20
x >= 10 and x <= 20, (x does not alert if x < 10 or x > 20)

So, with the above information, I changed the specs to match the above table. Then I went and modified the range code to handle the change in the specs.