Quantcast
Viewing all articles
Browse latest Browse all 630

displaying memory available OID on Windows Servers in percentage

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

 



Viewing all articles
Browse latest Browse all 630

Trending Articles