The background. I'm taking a numeric value from an SNMP GET of the UpTime Counter and doing a Tune up of the value to present the original TimeTicks along with a more human readable values. So my %Reply% after the Tune UP actually looks more like this
Ticks: 52154 | Seconds: 521 | Minutes: 8 | Hours: 0 since last reboot
The above is easy. I've got that part.
However I want the UPTIME test to tell me when a device rebooted.
So I'm started with this:
['%Reply%' getnumber 1]
This is perfect I get the 52154 back. Remember %Reply% when used in Tune up, is the previous test cycle Reply, which is exactly what I want!
However I cannot seem to do anything else with that extracted number. When I try the following variations I get a 'Error in Expression'
[%SuggestedReply% - '%Reply%' getnumber 1]
[%SuggestedReply% - ['%Reply%' getnumber 1]]
[%SuggestedReply% - ('%Reply%' getnumber 1)]
I'm looking for the difference between the numbers and if it's less than Zero, I can confident the device rebooted. Granted this won't catch all device reboots but most and will work for my purposes.
I just cannot seem to determine the correct syntax. Can you help?
Ultimately I'll be using something like this: Bold being where I cannot get it to work
if ([%SuggestedReply% - '%Reply%' getnumber 1] < 0) Ticks: [%SuggestedReply%] | Seconds: [%SuggestedReply% div 100] | Minutes: [%SuggestedReply% div 6000] | Hours: [%SuggestedReply% div 360000] **REBOOTED**; else Ticks: [%SuggestedReply%] | Seconds: [%SuggestedReply% div 100] | Minutes: [%SuggestedReply% div 6000] | Hours: [%SuggestedReply% div 360000] since last reboot;
Alternatively, if I could do math in a Mail Template, I may be able to move all of this logic to the Mail Template, but the last I knew I couldn't do this kind of math in a Mail Template body.
Also, I found that the following from your documentation examples does NOT work
('wordA wordB 21.10,15.00' getnumber 2) NOTE the wrapping in parenthesis. it appears it really needs square bracks [ ] However that example with parenthesis was taken directly from the HTML Help documentation for HM in the Tune Up section. You may want to fix that
