The caterpillars on green onions may be beet armyworm, cotton bollworm and other pests. You can use emamectin, indoxacarb, chlorantraniliprole, flubenzuron, tetrachlorantraniliprole, Bacillus thuringiensis, etc. Add a little silicone to the agent for spray control. Pay attention to alternating medication.
Now that I have gotten into it, the effect may not be very good.