Custom plugin unreliable

Made 2 plugins that monitor CPU and memory. but they are unreliable. It comes in OK… but then you refresh it and it says Unable to read the output? and then after a while the OK will come again…

Any ideas?

Thanks, Eva