Hi folks,
this is my very first question in this forum. I am stumbling over how to design a Calculated Item for a specific case that I need. It's a Cisco device we are talking about.
I have two items that fetch values by SNMP:
- "sysUpTime" - uptime of a a system in 100ths of seconds, with a custom multiplier of 0.01 set so that in fact this value is the amount of seconds the device is "UP", fetched every 5 minutes.
- "lastConfigChange" - the value of "sysUpTime" at the moment of the last configuration change, also fetched every 5 minutes.
as a formula, this would look something like that:
now("sysUpTime") - last("sysUpTime") + last("lastConfigChange")
What I need is a value that indicates either the unixtime that defines the exact date and hour when the configuration change was issued, or the amount of seconds that this event was ago. Preferably, the first.
So, basically I can calculate it in the following manner:
Unix-Timestamp NOW() (in seconds) MINUS "sysUpTime" PLUS "lastConfigChange" gives me the point in time that the configuration change happened.
My problem now is that this value will vary depending on which of the items is calculated when. If I generate a calculated item that realizes the above mentioned logic, it will not be exact: sysUpTime increases by 5 minutes every time the check is issued, so that the correct way to calculate the exact time of config change would be something like:
Unix-Timestamp of last poll of "sysUpTime" MINUS "sysUpTime" PLUS "lastConfigChange"
This, in theory should give a defined result that only changes if "lastConfigChange" changges, not moving up and down depending on the current time.
Now, I have no idea whether it is possible how to access the "time of last poll" of an item from within a calculated item formula. Any ideas? Any suggestions to solve this differently?
Thanks a lot!
Christian
this is my very first question in this forum. I am stumbling over how to design a Calculated Item for a specific case that I need. It's a Cisco device we are talking about.
I have two items that fetch values by SNMP:
- "sysUpTime" - uptime of a a system in 100ths of seconds, with a custom multiplier of 0.01 set so that in fact this value is the amount of seconds the device is "UP", fetched every 5 minutes.
- "lastConfigChange" - the value of "sysUpTime" at the moment of the last configuration change, also fetched every 5 minutes.
as a formula, this would look something like that:
now("sysUpTime") - last("sysUpTime") + last("lastConfigChange")
What I need is a value that indicates either the unixtime that defines the exact date and hour when the configuration change was issued, or the amount of seconds that this event was ago. Preferably, the first.
So, basically I can calculate it in the following manner:
Unix-Timestamp NOW() (in seconds) MINUS "sysUpTime" PLUS "lastConfigChange" gives me the point in time that the configuration change happened.
My problem now is that this value will vary depending on which of the items is calculated when. If I generate a calculated item that realizes the above mentioned logic, it will not be exact: sysUpTime increases by 5 minutes every time the check is issued, so that the correct way to calculate the exact time of config change would be something like:
Unix-Timestamp of last poll of "sysUpTime" MINUS "sysUpTime" PLUS "lastConfigChange"
This, in theory should give a defined result that only changes if "lastConfigChange" changges, not moving up and down depending on the current time.
Now, I have no idea whether it is possible how to access the "time of last poll" of an item from within a calculated item formula. Any ideas? Any suggestions to solve this differently?
Thanks a lot!
Christian


Comment