mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 02:18:39 +00:00
Fix IPv6 in service check host (#13939)
* Add hostName cleaning to Clean * Apply RFC 5952 formatting to Clean::hostName output * Use more liberal cleaning for hostnames * Remove unwanted whitespace * Apply Clean::hostName() to all relevant fields * Fix docstring * Use IP::isValid inline * Update Clean.php * Update services.inc.php Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
parent
15feac7297
commit
a71ea964b6
@ -5,6 +5,7 @@ use LibreNMS\Alert\AlertRules;
|
||||
use LibreNMS\Config;
|
||||
use LibreNMS\RRD\RrdDefinition;
|
||||
use LibreNMS\Util\Clean;
|
||||
use LibreNMS\Util\IP;
|
||||
|
||||
function get_service_status($device = null)
|
||||
{
|
||||
@ -122,9 +123,9 @@ function poll_service($service)
|
||||
$update = [];
|
||||
$old_status = $service['service_status'];
|
||||
$service['service_type'] = Clean::fileName($service['service_type']);
|
||||
$service['service_ip'] = Clean::fileName($service['service_ip']);
|
||||
$service['hostname'] = Clean::fileName($service['hostname']);
|
||||
$service['overwrite_ip'] = Clean::fileName($service['overwrite_ip']);
|
||||
$service['service_ip'] = IP::isValid($service['service_ip']) ? $service['service_ip'] : Clean::fileName($service['service_ip']);
|
||||
$service['hostname'] = IP::isValid($service['hostname']) ? $service['hostname'] : Clean::fileName($service['hostname']);
|
||||
$service['overwrite_ip'] = IP::isValid($service['overwrite_ip']) ? $service['overwrite_ip'] : Clean::fileName($service['overwrite_ip']);
|
||||
$check_cmd = '';
|
||||
|
||||
// if we have a script for this check, use it.
|
||||
|
Loading…
Reference in New Issue
Block a user