Bring a large pot of lightly salted water to a boil. Cook spaghetti in the boiling water, stirring occasionally until cooked through but firm to the bite, about 12 minutes. Drain.
Heat 1 tablespoon oil in a skillet over medium heat; cook and stir eggs in the hot oil until set and scrambled, about 5 minutes.
Heat remaining 2 tablespoons oil in a separate skillet over medium-high heat; saute onion, mushrooms, peas, and carrots until onion is browned, about 10 minutes. Add pasta to onion mixture and toss. Add eggs and mix well. Sprinkle Parmesan cheese, salt, and pepper over pasta mixture and toss.