Sri Kalahasti is one of the Panchabhuta Kshetras where Shiva is worshipped as Vayu Lingeswara, the others being Tiruvannamalai(Fire), Chidambaram(Space), Kanchi(Earth) and Jambukeswara(Water).
It gets it's name from the story that Shiva was worshipped here by a spider(Sri), snake(Kala) and elephant(Hasti). The spider used to weave webs around the Shiva Linga here. While the snake used to fetch precious stones and place it on the Shiva linga, the elephant used to worship it with water and flowers.
One day the snake seeing the elephant remove the stones it placed, bit the elephant. As the elephant rolled over in agony, it crushed the snake under it, as both died. The spider too passed away, and Shiva pleased with their devotion, blessed the three, leading to name of Sri Kalahasti.
The most well known story associated with Sri Kalahasti though is that of Kannapa, the tribal hunter, regarded as one of Shiva’s greatest devotees and is one of the 64 Nayanars.
Kanappa or Thinna, was believed to be a reincarnation of Arjuna himself. During the exile, Arjuna once prayed for the powerful Pasupathastra, in order to test his devotion, Shiva appeared as a Kirata(tribal) along with Parvati and his Ganas. Seeing a boar wreck havoc, both shot arrows killing it at the same time, and soon a duel broke out over who shot it. However Arjuna was ultimately overcome by Shiva himself, and then realized that the Kirata was none other than Mahadev himself.
Shiva pleased with Arjuna's devotion gave him the Pasupathastra, and also blessed Arjuna saying he would be reborn again as one of his greatest devotees, who was none other than Thinna. Thinna was the son of Raja Naga Vyadha, a tribal chieftain at Vutukuru near Sri Kalahasti, like most of his tribe, he was an expert hunter, and his father was a staunch devotee of Shiva himself.
While hunting, he found the linga of Shri Kalahasti, and began to worship it daily. However being a hunter, he had no knowledge of the rituals. He poured water on the Shiva Linga from his mouth, and would offer meat of the animal he hunted daily. Shiva however accepted whatever Thinna gave to him, as it was with sincere devotion and a pure heart. And one day decided to test his devotion with his divine power.
The Shiva Linga began to ooze blood from one of the eyes, and Thinna sensing that the eye had been injured, tried his best to stop it, placing leaves over it. However the Shiva Lingam still continued to bleed. Thinna then plucked out one of his eyes and placed it over the bleeding eye. While the bleeding stopped, the other eye now began to bleed. Now if he were to take out his remaining eye, he would not know the exact spot.
So placing his leg over the spot of the bleeding eye, Thinna proceeded to pluck out his other eye. And that is when Shiva appeared before him moved by his sincere devotion and faith. Shiva not only restored Thinnan's eye, he also blessed him to be one of the 64 Nayanars and he got the name of Kannappa for offering his eyes. He later merged into the Shiva Lingam, attaining salvation.
The illiterate tribal hunter Thinna who took out his own eyes for Shiva himself and was blessed by Mahadeva to be one of the Nayanars. His story is narrated as part of Sri Kaalahasti purana.