All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
There is nothing wrong with using the electric insect killer in order to kill harmful insects as long as the insect will be killed by electric shock not by burning. Killing by electric shocks is the fastest means of killing and therefore it does not go against the command regarding killing in a good manner as it was narrated by Shaddaad ibn Aws that the Prophet, sallallaahu ‘alayhi wa sallam, said: "... so if you have to kill, kill in a good manner..." [Muslim]
It is worth noting that it is not permissible to use the electric devices that burn insects since there is evidence in Sharee'ah that torturing with fire is prohibited. Ibn ‘Abbaas narrated that the Prophet, sallallaahu ‘alayhi wa sallam, said: "Do not punish with Allaah's punishment (fire)." [Al-Bukhari]
Al-Bazzaar reported from Abu Ad-Dardaa' that the Prophet, sallallaahu ‘alayhi wa sallam, said: “No one may punish with fire except the Lord of fire.”
For more benefit, kindly refer to Fatwa 87681.
Allaah Knows best.