Pop up for CPU, Memory and Disk space use in Ignition

So I am having some difficulties with a couple of projects on some client machines and I want to gather data while a program is running, however, the terminals do not have keyboards or mice, so I created a screen that shows the IP address and Hostname in a pop up when they tap on a certain area. I would also like to inclued Memory and CPU Utilization.

I know there is a python module called psutil, but I don’t know how to install that to even write a script using it.

Any ideas???

You can use Java’s ManagementFactory:


mem = MF.getMemoryMXBean()
mbs = MF.getOperatingSystemMXBean()

print 'Heap Mem. Usage:'
print mem.heapMemoryUsage
print '-----------------------------'
print 'Non-heap Mem. Usage:'
print mem.nonHeapMemoryUsage
print '-----------------------------'

print 'CPU Load:', mbs.getSystemCpuLoad()*100
print 'Total Memory:', mbs.getTotalPhysicalMemorySize()
print 'Free Memory', mbs.getFreePhysicalMemorySize()

On my system it gives this output:

init = 67108864(65536K) used = 232776248(227320K) committed = 433586176(423424K) max = 954728448(932352K)
-----------------------------
Non-heap Mem. Usage:
init = 2555904(2496K) used = 126014448(123060K) committed = 128778240(125760K) max = -1(-1K)
-----------------------------
CPU Load: 11.6751559705
Total Memory: 16103546880
Free Memory 8257544192
3 Likes