Virtually the entire Israeli government went on strike today as the country, no longer absorbed by the war in Lebanon, turned its attention to its underlying economic problems.

Israel's giant labor federation, the Histadrut, called the two-day strike to pressure the government to reach a new wage agreement to replace the one that expired last April.

Histadrut officials said there was almost 100 percent participation in the strike, which affected about 400,000 workers and closed national and municipal government offices, schools, health and welfare agencies and publicly owned companies, and resulted in the cancellation of all but news programs on the state-run radio and television networks.

In all, more than a third of Israel's labor force took the day off and is scheduled to be on strike Wednesday as well.

The rare general strike of public employes also climaxed a series of labor disputes that has been building here as the government tries to curb inflation, which is nearing 140 percent, and workers seek to keep up with the growing costs.

Teachers at Israel's universities walked off the job last week to protest the government's refusal to pay them "wage erosion" compensation because of inflation that was awarded by an arbitration committee. The government contended that the committee had exceeded its authority in making the award.

On Sunday, civilian employes of the Israeli Defense Forces staged their first strike in history, staying away from their jobs for one day in a dispute over a cost-of-living allowance.

The next day, Foreign Ministry employes got a one-day jump on their government colleagues by striking to demand extra compensation equal to that received by workers in the Defense Ministry and some other agencies, and to protest the possibility that a political appointee rather than a career diplomat will be named ambassador to London. The strike also affected Israeli embassies and consulates around the world.

The topsy-turvy world of Israeli labor relations took one more twist last night when the government and the university teachers settled their dispute. As a result, the teachers were back in their classrooms today while librarians, secretaries and other support personnel were home as part of the general strike.

The basic issue in all these cases is money, but the conflict is also exacerbated by an underlying political tension between the Histadrut, which is controlled by the opposition Labor Party, and the ruling conservative Likud bloc. The two-day strike, said one Israeli who is familiar with such disputes, is an attempt by the Histadrut to demonstrate that it still holds the allegiance of workers, despite government taunts to the contrary, and could paralyze the government in a later showdown.

The two sides fought a preliminary skirmish in newspaper advertisements published Sunday, with the Histadrut urging participation in the strike and the government asserting that it represented the workers' "real interests." By all appearances, the labor federation carried the day today. At the normally busy government press center, all of the offices were closed except one occupied by uniformed personnel of the Army spokesman's office.

Wages, like almost everything else in the Israeli economy, are indexed to the rapidly escalating cost of living, allowing most Israelis generally to keep pace with inflation. But the country's consumer price index rose by 8.4 percent in October alone and at the present rate is projected at a record 138 percent over last year's consumer prices by the end of 1982.

As a result of the record inflation, real wages have declined despite the indexing system. In addition, Israelis this year have been hit with some tax increases imposed to pay for part of the cost of the war in Lebanon.

Still, there has been no sign of a serious downturn in the Israeli economy, and no absence of shoppers, some brandishing newly issued 500-shekel banknotes, another concession to inflation, in the stores of Jerusalem, Tel Aviv and other cities.

The Finance Ministry has offered workers an 18 percent wage increase, 10 percent of which it has already unilaterally granted. The labor federation is seeking a 23 percent overall wage increase and is also resisting a government attempt to alter the cost-of-living provisions in the wage agreement.

At the Foreign Ministry, Zeev Suffot, head of the employes' union, said the unusual one-day strike of the diplomats resulted from mounting frustration that they are not granted special "service increments" that routinely go to employes of the Defense Ministry, the Knesset (parliament), the treasury and other agencies.

Suffot said that, more than any other civilian government employes, Israeli diplomats posted abroad risk death and injury, as evidenced by the attempted assassination of ambassador to Britain Shlomo Argov, whose shooting in June set off the chain of events leading to the Israeli invasion of Lebanon.

Foreign Ministry employes are also upset by reports that the government intends to name a political appointee as Argov's replacement, a move that would require the government to finesse its agreement with the Foreign Ministry workers' union that no more than 15 ambassadorial posts will be filled by political appointees.