Unable to add service with hostname via the API

Hi All,

I’ve been experimenting with the Nagios plugin functionality of LibreNMS and have run into a bit of a sang with adding services via the API.

When adding a service via the GUI I am able to use an FQDN in place of an an IP Address, however, when doing the same though the API I receive the following: is not a valid IP address.

I dug through the code and commented out the following in: includes/html/api_functions.inc.php
/if (!filter_var($data[‘ip’], FILTER_VALIDATE_IP)) {
// return api_error(400, ‘service_ip is not a valid IP address.’);
//}

which works, however, will obviously break automatic updates. Wondering if this is by design (to have the API and GUI behave differently) or if it’s something that could be fixed in a future release?

Can you check if your install is up to date ?
(./validate.php) ?

It seems that this issue was already corrected a few days/weeks ago.

Thanks! Did an update by removing my changes and manually running ./daily.sh and confirmed I can add services with a hostname now.