Addhost.php parameters for a "ping-only" device

Hi,

we use to add a new ping only device with the following command:

./addhost.php -P 10.10.10.27 “” “Hardware_string”

Is it also possible to set a customized “System Name” string using the above command syntax (we are using IP not FQDN) ?

Thank you in advance

welcome to LibreNMS. As far as I know you cannot set the system name string through ./addhost.php
I looked at the add_host_tips file in my librenms directory and there doesn’t seem to be an option for this.

As far as I know and understand, librenms uses a hostname field that can be either the hostname or the IP address of the system. If you’re going to use hostname, you’re going to need to either have an entry in DNS or add your hosts to /etc/hosts to correlate names to IP addresses.

I hope this helps in some small way.

Hi Richards,

thank you very much for your detailed reply.
It would be useful to be able to manually add this information but I also understain it’s a limitation related to the missing DNS. In the meanwhile I’m adding the info by hand.

I use just IP for my network devices and they aren’t in DNS. I’m just used to seeing everything as IP addresses, plus within the SNMP data we put the building location so that helps to further identify the hardware. Having maps and such helps but not in the physical sense.

If you want to refer to your devices by a name or something, I would just throw them into your /etc/hosts file.
192.168.1.1 switch1
192.168.1.2 switch2
192.168.1.3 switch3

and so on and then add them in libre using the names that you specified in the /etc/host file. There’s probably a smoother way of doing this from command line in linux with a script where it accepts an IP and hostname, writes to etc/hosts and then takes the hostname and runs it into ./addhost.php as a variable.

Eventually we decided to use “sysName”. We manually put the info because the devices doesn’t have SNMP capabilities.
Thanks for your tips