Search code examples
phpipdevicehardware-infrastructure

Get Server Information using PHP


I have 'n' numbers of internal private IP address in my organization which are not identified. I want to find information regarding those unidentified IP address like what is the hostname, what kind of device it is (server, router, switch etc) and any other information that will be helpful.

I am planning to use PHP to get the hostname of the server using the following code:

<?php echo gethostbyaddr($ipAddress); ?>

How can I find other informations about the IP address.

Note: Ideas other than PHP are also welcome.


Solution

  • Check this please: https://serverfault.com/questions/329686/find-information-for-local-ip-address

    nmap might be what you are looking for.

    Another way would be to use CURL, either as PHP or in form of a shell command like here: shell script: get server info from curl

    mobiledetect will not help you here, since its purpose is to detect wether a device accessing a server is a desktop, tablet or phone.

    Regards,

    Stefan