Formula Expressions
Formula Expressions offer added flexibility in monitoring SNMP Metrics.
For example, if your environmental monitor returns the temperature of the server room in Celsius, you can convert this metric to Fahrenheit.
Or you could measure the uptime of a server or device by converting TIMETICKS to hours. (TIMETICKS are hundredths of a second.)
Or you could add together several SNMP metrics to get a total traffic figure.
Example 1: Celsius To Fahrenheit
Let’s take our first example, converting temperature from Celsius to Fahrenheit. To do so, we need to take Celsius, multiply it by 1.8, then add 32.
Configure your SNMP Rule to retrieve the Celsius figure. Instead of configuring a threshold (such as Rule Is Broken If Greater Than 25), select the As A Specific Variable box, and enter CELSIUS in the field. Click OK.
Next, click the Insert button to add a second line to the SNMP Rule. Select the radio button next to Formula Expression, then click the Select New Formula button.
To create the formula we need, use the buttons on Screen C46C. We need to multiply Celsius by 1.8, then add 32 to get the desired degrees Fahrenheit.
Click the open parenthesis ( button to insert the parenthesis, then select CELSIUS and click the Var button. (This last action inserts “$Var_CELSIUS” into the Expression field.) Click the asterisk * button to indicate multiplication, click in the field to the right of the Const button, enter 1.8, then click the Const button.
Click the close parenthesis ) button to enclose this part of the formula. Click the plus sign + button, click in the field to the right of Const, enter 32, then click the Const button. Click OK to complete the formula expression.
On the SNMP Rule Criteria screen (R11C), enter a name for our new formula, such as “FAHRENHEIT”.
As before, we have the options to set thresholds — such as Greater Than 77 — or to Retrieve Performance Data For Argent Predictor Only. Both of these are now relative to the number calculated by our formula.
Example 2: Converting Timeticks To Hours
One timetick is one-hundredth of a second.
To convert timeticks into hours, we divide the timeticks by 100 (to get the number of seconds), then by 3,600 (the number of seconds in an hour) — in other words, we divide timeticks by 360,000.
Configure your SNMP Rule to retrieve the timetick figure. Instead of configuring a threshold (such as Rule Is Broken If Greater Than 500), select the As A Specific Variable box, and enter TIMETICKS in the field. Click OK.
Next, click the Insert button to add a second line to the SNMP Rule. Select the radio button next to Formula Expression, then click the Select New Formula button.
To create the formula we need, use the buttons on Screen C46C. We need to divide timeticks by 360,000 to get the desired hours figure.
Select TIMETICKS and click the Var button. (This action inserts “$Var_TIMETICKS” into the Expression field.) Click the slash / button to indicate division, click in the field to the right of the Const button, enter 360000, then click the Const button again.
Click OK to complete the formula expression.
On the SNMP Rule Criteria screen (R11C), enter a name for our new formula, such as “TimeticksToHours”.
As before, we have the options to set thresholds — such as Greater Than 2 — or to Retrieve Performance Data For Argent Predictor Only. Both of these are now relative to the number calculated by our formula.
Example 3: Total Packets Per Second
Most switches record the number of incoming packets per second, as well as outgoing packets per second.
To see the total transferred packets per second, it’s just simple addition of the two variables.
Total Packets Per Second = Incoming + Outgoing Packets Per Second
To start, configure your SNMP Rule to retrieve the incoming packets per second figure. Instead of configuring a threshold (such as Rule Is Broken If Greater Than 50), select the As A Specific Variable box, and enter INPACKETS in the field. Click OK.
Next, click the Insert button to add a second line to the SNMP Rule.
Configure this line to retrieve the outgoing packets per second figure. Again, select the As A Specific Variable box, and enter OUTPACKETS in the field. Click OK.
Click on the Insert button to add a third line to the SNMP Rule.
Select the radio button next to Formula Expression, then click the Select New Formula button.
To create the formula we need, use the buttons on Screen C46C. We need to add the incoming packets per second with the outgoing packets per second to get the desired total transferred packets per second figure.
Select INPACKETS and click the Var button. (This action inserts “$Var_TIMETICKS” into the Expression field.) Click the plus + button to indicate addition, then select OUTPACKETS and click the Var button.
Click OK to complete the formula expression.
On the SNMP Rule Criteria screen (R11C), enter a name for our new formula, such as “TotalPacketsPerSecond”.
As before, we have the options to set thresholds — such as Greater Than 100 — or to Retrieve Performance Data For Argent Predictor Only. Both of these are now relative to the number calculated by our formula.