During the wedding of Siva with Parvathi in the Mount Kailas, the entire population, Devas and Rishis had gathered & hence the Northern land dipped down, unable to bear the weight.
Lord Siva asked Sage Agasthiar to go to the Podhigai ranges in the Southern land in order to balance the weight. (Agasthiar was very short in stature but his might was so great). Agasthiar was sad that he could not stay & witness the Lord's wedding. Siva granted that he would still be able to see the wedding from the South. From within his matted locks, he took river Cauvery & filled it in Agasthiar's kamandalam (spouted pot), bidding Cauvery to flow wherever Agasthiar pointed. Agasthiar reached the south & travelled to various Siva Sthalams.
Surapaduman was an asura, who had immense power. Indra had run away in fear from his Indralogam, reached Sirgazhi in the southern regios of India & prayed to Lord Siva. He created a beautiful garden & worshipped Lord Siva with the flowers from his garden.
But soon, Lord Varuna in fear of Surapaduman did not shower rains & Indran's garden & in fact the whole land suffered from lack of water. Sage Narada, told Indran of the river Cauvery that Lord Siva had once filled in Agasthiar's kamandalam. Indran prayed to Lord Ganesha for his help.
Ganesha took the form of a crow & sat on Agasthiar's kamandalam & toppled it. Agasthiar lifted his hands to shoo off the crow. River Cauvery, took it as a signal for her & began to flow.
The crow took the form of a small boy. Agasthiar started chasing the boy trying to strike him on his head with his knuckles. Ganesha took his original form. Agasthiar was saddened that he had tried to strike Lord Ganesha. He started striking his forehead with his knuckles. Ganesha stopped him & granted that everybody who worshipped him in this manner would be blessed with wisdom.
Another version of the same story - Ponni, as Cauvery was originally called, was disrespectful to Agasthiar when he came down south. To teach her a lesson, Agasthiar imprisoned the entire river in his kamandalam.
Ganesha on sage Narada's request came in the form of a crow and toppled the kamandalam & set the river free. Ponni was then given a new name, Cauvery (Kaveri).
Story of Agasthyar - Cauvery
Story of Gajamugasuran
There was an asura called Gajamugasuran. He did deep penance and worshipped Lord Siva, who granted him several boons, by which he became extremely powerful. He put the Devas and rishis to great trouble. He forced the Devas to do 1008 Thoeppukaranams in the morning, 1008 in the afternoon and 1008 in the evening. (Thoepukaranam means to sit down and stand up holding one's ears with crossed hands, left ear with right hand & right ear with left hand).
The Devas prayed to Lord Siva to rescue them from this evil asura. Lord Siva sent Lord Vinayaga to overcome Gajamugasuran. Vinayagar went with several weapons such as bow & arrow, sword, axe, etc. However, since Gajamugasuran had been granted the boon that he be destroyed by no weapon, none of these weapons used by Lord Vinayaga were effective. Vinayagar broke off his right tusk and used it to kill Gajamugasuran. Gajamugasuran still rushed at Vinayaga in the form of a mooshikam (small mouse). Vinayagar crushed the ego and vanity of Gajamugasuran and sat on the mooshikam. The humbled Gajamugasuran bowed before Vinayagar, who accepted the mooshikam as his vahana.
Lord Vinayaka is the source of everlasting wisdom. He crushed ego and vanity and reduced it to the size of a mooshikam and used it as his vahana. Lord Vinayagar can be pleased by doing Thoepukaranam.