My Onan 7000 generator will start and run for about 4 minutes and then cut off. Check the Oil and it is full and the oil switch was disconnected to check if the oil switch was bad, however it is ok. ...
When mine did that I found it was a loose fan belt and it was shutting down on overheat. The high temp sensor also has a history of failure and will cause the same shutdown.
Easy fix if you don't have to pull the gen set for access like I did.