Mass Deleteing hosts in LibreNMS

Mass Deleteing hosts in LibreNMS

I recently worked on a network where we re-piped around four hundred hosts. These four hundred hosts were being monitored by LibreNMS. The question is how to delete this many hosts.

I credit https://www.incredigeek.com/home/librenms-bulk-delete/ for this tutorial. I will only add that I used Excel instead of the MySQL database. I knew the IP range, so I opened Excel and created an IP list. I then pasted this into a text file named remove_ip.lst. If the host does not exist, it will simply skip it and say, “Host doesn’t exist!”

Screenshot

In case the above link goes away, the code is

for i in `cat ~/remove_ip.lst`; do sudo /opt/librenms/delhost.php $i; done

j2networks family of sites
https://j2sw.com
https://startawisp.info
https://indycolo.net
#packetsdownrange #routethelight

Leave a Reply