According to my notes; the onamatopoeic name Upupa is originally (Ancient) Greek, known at least since Aristotle (Hist. anim IX: 15).
The Swedish name härfågel [här (army/troop) + fågel (bird)], in Old Swedish written här-fughl (a k a Hor-fogel), is supposedly originating from the old German Heervogel [today Wiedehopf], and it is known as härfågel (in this certain spelling) in Swedish litterature since at least 1713 (by Sahlstedt, also as such by Linnaeus 1731, in his Methodus avium Sveticarum, publ. 1907).
Note that Swedish Bird fauna has changed remarkably since the days of Linnaeus. The Hoope was breeding regularly in Southern Sweden all until the mid-1800's, and it is beleived to have been fairly common in the Southernmost parts of the country, in about the same time (at least in the Province Skåne, and on the Island Öland). With a rapid decline, all over, in the following decades. Today it's a (minor) rarity in Sweden, an unfrequent (but still somewhat frequent) vagrant, breeding only occasionally (often years apart).
As Linnaeus grew up in the early 1700's, in Råshult, Småland, not far away (only about twelve kilometers) from the northern border of/to Skåne, it's fairly possible, even likely, that he'd met this bird himself in the surroundings of his Childhood home (we certainly know that Rollers Coracias garrulus bred close by, in those days).
Either way, and (as correctly noted earlier in this thread) it's sound was truly (in Swedish folklore/popular belief) taken as an omen of war, (bad harvest) and starvation (as in when the troops passed by, empying every barn along their way). The call itself hoo - hoo - hoo - hoop was here (at least in the province Småland, Southern Sweden, where I grew up) interpreted (just like Niels told us) as: Upp, upp, ut, ut (Up, up, out, out)!
Up and out (and away) ... either; to hide, or work (even harder), alt. join in (join the troops).
In various old Swedish dialects the Hoopoe has been called (among several other totally irrelevant, or all unrelated names): uppfugel, or opp-fågel, popparegök ('Poping Guckoo'), etc., etc. , alt oppopp, or simply popp.
And; just for the fun of it; the same old Hoopoe was even earlier, prior to being called härfågel in Swedish, a k a vipa (at least as early as in the 1400's). A name for centuries shared with the very vipa istself, i.e. today's tofsvipa (the Lapwing Vanellus vanellus – clearly from their mutual head plumes). In Forsius's (Swedish) Physica 1611 the Hoopoe is simply called Upupa (in Swedish), with the straight forward, explainatory remark: "Upupa är icke wijpa" [Upupa is not wijpa (alt. vipa, the Lapwing)], equally explained in Latin: Upupa longe alia est avis Non Upupa sed Vanellus latine dictur. Well, that's good to know.
The old German 'Heervogel' is, according to some linguists, related to Horvogel mening Kotvogel (Dung-bird), somewhat in line with the equally old French 'coq puant' (Stench cock/rooster), names given simply as it apparently seemed connected to, as it most often was seen/ urned up, on dunghills, or in paddocks rich of manure (read: insects/food).
In today's French it's name is (less insulting) simply Huppe fasciée.
In any case, the Swedish name härfågel has absolutely nothing (contrary to what a or any Non-Swedish speakers might believe) to do with the Swedish word här (which simply means: here), that's just another similar/same-looking word, of no relevance what-so-ever to the härfågel (Hoopoe) itself, regardless of where or wherever it turn, turned, or turns up, neither here (här), nor there (där), on dunghills, or not.
Well, this turned out far longer than I expected, but that's about all I have in my notes about the härfågel (Hoopoe) ...
Enjoy!
Björn