John Anderson Gilruth was born on 17 February 1871 at Auchmithie, near Arbroath, Forfarshire, Scotland, the son of Ann Anderson and her husband, Andrew Gilruth, a farmer. A schoolteacher before marriage, his mother strongly influenced him toward academic excellence. He attended the village school at Auchmithie and high schools at Arbroath and Dundee. He spent two years as a legal clerk in Arbroath before his father allowed him to go to veterinary college in Glasgow in 1887. John excelled, topping all subjects at the examinations of the Royal College of Veterinary Surgeons, and was admitted to membership of the college in 1892.
Gilruth was sought out and recruited by the agent general for New Zealand in 1893 on behalf of the colony's recently formed Department of Agriculture. As a bright young graduate he had the skills in the areas of bacteriology and pathology that were vital to the rapidly growing agricultural economy.
The young veterinarian took an innovative approach to his duties. Initially based in Dunedin, he toured, lectured and produced pamphlets for farmers, his early work covering actinomycosis (lumpy jaw), black-leg and tuberculosis. After only two years in New Zealand he convinced the government of the value of sending him to the Institut Pasteur in France for a year's training, and came back by October 1896 to the newly created post of chief veterinary officer. He began advocating comprehensive meat inspection for export works and abattoirs, and this was achieved with the passing of the Slaughtering and Inspection Act in 1900. By 1902 Gilruth had the distinction of being responsible for 23 veterinarians: the largest group of state veterinarians in the southern hemisphere.
In 1895 there were outbreaks of anthrax in various parts of the North Island and Gilruth diagnosed the first outbreak at Ohaupo. He identified the source as unsterilised imported bone fertilisers, and in his annual reports over the next decade he waged a campaign to have all imported bone manures sterilised. He was successful in 1905 when inspectors were stationed in India and Australia, the origin of bone-based fertilisers.
As a consequence of a bubonic plague alarm in New Zealand in 1900, Gilruth and Dr J. M. Mason of Otaki were appointed health commissioners to investigate the outbreak. Both men had skills in pathology. Gilruth diagnosed plague in Auckland rats and his findings were subsequently upheld by the Institut Pasteur. The commissioners' report was instrumental in the formation of the Department of Public Health in 1900, to which Gilruth was appointed pathologist while continuing with his responsibilities in agriculture. He further highlighted the connection between human and animal health in his work on bovine tuberculosis. Although he began using the tuberculin test in 1904, it was to be more than 20 years before the disease was to be seriously investigated.
The most enduring monument to Gilruth's work in New Zealand is the Wallaceville laboratory and associated farm near Upper Hutt. The laboratory, which was opened in 1905 after a decade of unsatisfactory accommodation in central Wellington, had facilities for longer-term veterinary diagnostic work and research.
From 1900 Gilruth had spent considerable periods overseas recruiting new stock inspectors, visiting other quarantine and meat inspection facilities and undertaking a second course at the Institut Pasteur. Meanwhile, he grew increasingly frustrated with his political masters in New Zealand. In 1904 the premier had failed to pass on an offer from the imperial government for a position as chief veterinary officer in Transvaal, South Africa, at twice his New Zealand salary. He discovered the default upon his return in 1907. This, coupled with the government's reluctance to establish a fully funded animal research facility, led him to seek prospects elsewhere. In 1908 Gilruth resigned to become the first professor and director at the University of Melbourne Veterinary School and associated research institute in Australia.
His energy and tenacity provided a vigorous beginning for the institute. He was made an honorary doctor of veterinary science by the University of Melbourne in 1909. Gilruth's membership in 1911 of a mission to investigate the Northern Territory led in February 1912 to his appointment as administrator there. His task was to encourage development, which he did by assisting agriculture and mining and the construction of a meatworks. His autocratic style was controversial, however, and on 17 December 1918 frustration with his administration peaked with the 'Darwin Rebellion', when locals flouted his authority. He was recalled in February 1919 and his closest advisers were replaced. A commission of inquiry accused him of irregular practices and impropriety, but this was later largely discredited.
For a decade Gilruth struggled as a private veterinary consultant. In 1929 he became acting chief and in 1933 permanent chief of the Division of Animal Health in the Council for Scientific and Industrial Research. In this position Gilruth regained his zest for research and his reputation as one of Australia's finest veterinarians.
In 1933 he was elected president of the Australian Veterinary Association and in 1936 he was made an honorary member. He had an extensive list of published articles to his name and was held in very high esteem at the time of his death at South Yarra, Melbourne, on 4 March 1937. Gilruth was survived by his wife, Jeannie McLean McKay (whom he had married at Dunedin on 20 March 1899), two daughters and a son. His name is commemorated in Australia in Gilruth Plains, a research station near Cunnamulla, Queensland, in the Gilruth Prize of the Australian Veterinary Association, and by an avenue named after him in Darwin.