Avoid add host on autodiscovery

Is there anyway to avoid some kind of devices to de added during auto discovery by hostname for example?
Ihave configured to do autodiscovery only by snmp with an specific community and i do not know why some printers that do not have that community configurec are added.
I can not configure a net exception as them are on same subnet as network devices.
A regex policy after reverse dns lookup that applies on the dns record of the device will be perfect.
any idea?
thanks for all

You can do subnet using /32 as prefix, that means only that IP will not be added.

https://docs.librenms.org/Extensions/Auto-Discovery/#exclusions

$config['autodiscovery']['nets-exclude'][] = '192.168.0.1/32'; <-- That will prevent 192.168.0.1 from being added.

Ok, thanks. The issue is that the ip is not always the same and I should add every device one by one.
Can´t be done by hostname? Like if the hostname matches a regexp do not add?
Thanks in advance.

I dont know, sorry.

BTW, Im still thinking on how a device with different snmp credentials is being added…

Are you sure the configured snmp credentials in config.php doesnt have the device credentials?

Yes, It is quite annoying.

Device has no SNMP configuration and says that is using public by default but it looks that responses to every community I send a query with.

[root@SLX00010966 librenms]# snmpwalk -v1 -c public99 10.25.32.98 sysDescr
SNMPv2-MIB::sysDescr.0 = STRING: HP ETHERNET MULTI-ENVIRONMENT,ROM none,JETDIRECT
[root@SLX00010966 librenms]# snmpwalk -v1 -c anything 10.25.32.98 sysDescr
SNMPv2-MIB::sysDescr.0 = STRING: HP ETHERNET MULTI-ENVIRONMENT,ROM none,JETDIRECT
[root@SLX00010966 librenms]# snmpwalk -v1 -c none 10.25.32.98 sysDescr
SNMPv2-MIB::sysDescr.0 = STRING: HP ETHERNET MULTI-ENVIRONMENT,ROM none,JETDIRECT

Don´t know if it is a normal behaviour but I have discovered a lot of printers so…

Are setting your snmp community strings in your config.php

Oh, fantastic, a device that replies to all communities… You should talk to the vendor about that.

From LibreNMS view I dont think you can stop that.

Maybe add all your printers and then bulk disable them?

@Kevin_Krumm he doesnt want the printers to be auto-discovered, but printers change IP from time to time, so blocking by IP is not a solution. Also, as the printers reply to whatever community you set up, auto-discovery will always add them…

1 Like

ok, I will take a look for periodic script that disables printers. Do you think will be very difficult to avoid adding host based on hostname? To open a Feature Request.

Btw, what is the difference between disable or ignore the device. If I disable the devices the discovered ports, sensors, grapsh, remains, will it keep polling?

Thanks for all.

With disable, poller/discovery will be totally disabled for that device.

Ignore will poll/discover but will not generate any alert