mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
2013-05-10 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Tools.pm: Check that inet_aton does not return undef. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8118 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
2f31062b25
commit
3d656eb704
@ -1,3 +1,7 @@
|
|||||||
|
2013-05-10 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* lib/PandoraFMS/Tools.pm: Check that inet_aton does not return undef.
|
||||||
|
|
||||||
2013-05-07 Ramon Novoa <rnovoa@artica.es>
|
2013-05-07 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* lib/PandoraFMS/Tools.pm: Added a function to resolve hostnames.
|
* lib/PandoraFMS/Tools.pm: Added a function to resolve hostnames.
|
||||||
|
@ -1171,7 +1171,10 @@ sub cron_get_closest_in_range ($$) {
|
|||||||
sub resolve_hostname ($) {
|
sub resolve_hostname ($) {
|
||||||
my ($hostname) = @_;
|
my ($hostname) = @_;
|
||||||
|
|
||||||
return inet_ntoa(inet_aton($hostname));
|
$resolved_hostname = inet_aton($hostname);
|
||||||
|
return $hostname if (! defined ($resolved_hostname));
|
||||||
|
|
||||||
|
return inet_ntoa($resolved_hostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
# End of function declaration
|
# End of function declaration
|
||||||
|
Loading…
x
Reference in New Issue
Block a user