Army and police units were placed on alert in the capital and major Greek cities today, apparently in response to an unsuccessful attempt in northern Greece to launch a military coup against the socialist government of Andreas Papandreou.

Sources in Athens, who had been reporting rumors of a coup attempt since early in the day, said that the opposition political parties were notified by the government that such an attempt had taken place and that it had been contained.

The same sources added that several Army officers stationed in the northern areas of Serres and Kavalla, near the Turkish border, had been arrested apparently in connection with the coup move.

Information was murky tonight, and it was not clear whether plans for a nationwide concerted coup had been set in motion and nipped or whether the plans had been discovered at the blueprint stage.

Dimitris Maroudas, government spokesman and press undersecretary, denied in a statement issued tonight "all rumors associated with" the Army and police alert. He said the alert constituted "a routine readiness exercise."

Similar rumors of restlessness within the Army against the Papandreou government had circulated last year, several months after the October 1981 victory of the Greek socialists in general elections which ended close to half a century of almost uninterrupted rightist rule.

An Army "readiness exercise" was also invoked at that time to counter rumors of untoward military movements and reports that Papandreou, who is also minister of defense, spent several days in the Pentagon--as the defense ministry is referred to here--riding out the crisis.

The events of this weekend, which like those of last year will probably never be completely clarified, have once more touched a raw nerve in Greeks who still have not forgotten the experience of the colonels' junta of the 1960s and early '70s.

A group of colonel-rank officers overthrew Andreas Papandreou's father, George, a center liberal, in 1967. The junta collapsed in 1974 after attempting a coup in Cyprus which brought Greece and Turkey to the verge of war.

Ever since the socialist government came to power, there has been speculation about the reaction of the Greek Army. The government was elected on the strongly anti-western platform of pulling out of NATO and closing down U.S. bases in Greece as well as strengthening links with East Bloc countries.

Rumors on the coup attempt followed the departure this weekend, after a four-day state visit to Greece, of Soviet Prime Minister Nikolai Tikhonov and coincided with the end of the fourth round of talks on the future of the U.S. bases on Greek soil. Papandreou remains committed to dismantle those bases.

Nevetheless it had been believed that so far Papandreou had enjoyed the general support of the Army. As defense minister he has pushed for pay raises and housing allowances for the military. Through a sweeping clearing of the promotions ladder last year he was also seen to have brought in new, loyal officers to the middle Army ranks and to have established his own men at the chiefs of staff level.