Mick
Mick I'm one of the co-founders of WebTuna Software.

How can I capture the Web server machine name

How can I capture the Web server machine name

If the web application you are monitoring has multiple frontend web servers and you would like to see performance broken down by servername then you can have the webtuna.js capture the servername by overriding the JavaScript function wt.server with your own function to get it from the application and return it to WebTuna.

The JavaScript function needs to be called wt.server and needs to be declared somewhere in the page so that it exists at the point the where the onload handler is called.

Capture Severname PHP example

This example code will capture the Servername so it can be seen by WebTuna. Note the servername capture code must come after the line which calls webtuna.js. You may need to modify src to point to the location where you copied the webtuna.js.

1
2
3
4
5
6
7
8
9
10
//NEED SOME SERVER SIDE CODE TO GET THE SERVERNAME AND SET IT AS A JAVASCRIPT VARIABLE
<script type="text/javascript" src="https://cdn.webtuna.com/webtuna.js"></script>
 
<script type="text/javascript">
        var wt_server = '<?php echo gethostname(); ?>';
        wt.server = function ()
        {
                return wt_server;
        };
</script>