Boil the spaghetti in salted water, drain. Heat the oil in a pan, sauté the onion, then add all the other ingredients except the parmesan, season with salt and pepper. When the vegetables are soft, add the spaghetti and mix well with the sauce. Sprinkle with parmesan.