Moodle show hostname and IP address

You might have a need to show the hostname/IP address of the server that a Moodle is running on, for example if you are setting up load balancing. 

Here’s one way to do this with minimal code changes:

lib/outputrenders.php

Find the login_info function

Right at the end before return $loggedinas add this code:

// BEGIN: MOODLE CUSTOMISATION
$loggedinas .= '<p>You are on '.gethostname().' ('.$_SERVER['SERVER_ADDR'].')</p>';
// END: MOODLE CUSTOMISATION