After the monitoring service Opmanager is up scripts returns exit code zero and shows correct values. But after several hours after that the same scripts returns exit code 4 and stop collecting the data.
This problem can be solved only by restarting the monitoring service.