French (colons) were already frustrated with the rats, the rats were entering their houses.
So the rat hunt was started by the french so that rats can be eradicated. Imagine where rats were entering your house in masses and you were hiring a worker to remove them. That's was happened in Hanoi.
The rat hunt proved to be beneficial for the native citizens of Vietnam. Rat hunt was a failure and the rats continued to create havoc.
This caused a bubonic plague the next year.