Oli Kultar
2013-09-20 13:25:07 UTC
Oli Kultar [http://community.zenoss.org/people/opawlik] created the discussion
"displaying memory available OID on Windows Servers in percentage"
To view the discussion, visit: http://community.zenoss.org/message/74728#74728
--------------------------------------------------------------
Hi,
Please give me advice step by step how to display memory available OID on Windows Servers in percentage? I know there is transform option for that. I have pasted below code to Tranform field: Event->Event_Classes->Classes->Perf/CPU->Transform
import re
match = re.search('threshold of Free Memory [^:]+: current value ([\d\.]+)', evt.message)
if match and device:
   avail = float(match.groups()[0]) * 1024
   total = device.hw.totalMemory
   percent_used = (1 - (avail / total)) * 100
   evt.summary = "Memory threshold exceeded: current value %3.1f%%" % (percent_used)
but it doesn't work at all. What is the problem?
Oli
--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74728#74728]
Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
"displaying memory available OID on Windows Servers in percentage"
To view the discussion, visit: http://community.zenoss.org/message/74728#74728
--------------------------------------------------------------
Hi,
Please give me advice step by step how to display memory available OID on Windows Servers in percentage? I know there is transform option for that. I have pasted below code to Tranform field: Event->Event_Classes->Classes->Perf/CPU->Transform
import re
match = re.search('threshold of Free Memory [^:]+: current value ([\d\.]+)', evt.message)
if match and device:
   avail = float(match.groups()[0]) * 1024
   total = device.hw.totalMemory
   percent_used = (1 - (avail / total)) * 100
   evt.summary = "Memory threshold exceeded: current value %3.1f%%" % (percent_used)
but it doesn't work at all. What is the problem?
Oli
--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74728#74728]
Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]