In wireless networks, multiple monitoring nodes are used to collect users’ transmission data in real time, which can be used for fault diagnosis and analytical feedback of the wireless network. Due to the limited number of monitoring nodes, key issues include how to optimize and schedule the channel resources of each node to cover more users, obtain more network data, and maximize the quality of network monitoring. In this paper, a channel allocation algorithm based on swarm intelligence—“discrete bacterial foraging optimization”—is proposed based on the classic bacterial foraging optimization algorithm. The position of each dimension in the iterative process is discretized to binary 0 or 1 to encode and express the channel allocation problem of wireless monitoring networks, and the channel allocation scheme is optimized by location updates guided by bacterial foraging. Many simulation and practical experiments have proved the effectiveness of the algorithm, and it also has low complexity and provable convergence. Compared with similar algorithms, this algorithm improves monitoring quality by 1.428% while boosting speed by up to 32.602%. The algorithm has lower complexity, higher performance, and can converge to the optimal solution at a faster rate.