Possible that the hose off the top of the gas cap is meant to pull gas out of an auxualliry tank. How big is your gas tank on the gen?
On little generators that have fuel pumps and 1 gallon tanks it is common to use a 2nd tank. The hose connects them. As the gen burns fuel it sucks gas out of the generator tank and at the same time sucks gas out of the connected aux tank. When the aux tank is empty it just sucks air out of the aux tank then starts to use up all the fuel in the generator's tank.This method gives the user of a little generator a lot longer run time between fillups.
If this is what your hose was for then just remove it, or get a new gas cap as that one might have been altered and damaged so cant go back to new.
Also, if gen has sat, then critters maybe made a nest inside the case. No pics, so not sure, but high-end gens like Onan are enclosed in a box, and the air is forced over the cyclinder head and that cools it. If there is a critter nest on the cylinder head then your motor is over-heating and shutting down as a fail-safe.
Take the cover off the generator and have a look.
You need good air flow.