You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello.
I have a problem with hostnames like n1 and n10, because you using strpos when searching for hostname.
Maybe it would be better search for full name compare and if it fails find by substring:
Hello.
I have a problem with hostnames like n1 and n10, because you using strpos when searching for hostname.
Maybe it would be better search for full name compare and if it fails find by substring:
$host_found = 0;
$host_found_by_substr = 0;
foreach ( $ganglia_hosts_array as $ganglia_host ) {
if ( strcmp( $ganglia_host, $host ) === 0 ) {
$fqdn = $ganglia_host;
$host_found = 1;
break;
}
if ( strpos( $ganglia_host, $host ) !== false ) {
$fqdn_by_substr = $ganglia_host;
$host_found_by_substr = 1;
}
}
if ( $host_found !== 1 && $host_found_by_substr === 1 ) {
$host_found = 1;
$fqdn = $fqdn_by_substr;
}
The text was updated successfully, but these errors were encountered: