Heserver domain name

Working on a licensing server project and noticed that exeout sends out “heserver” as domain name.

Is there any way to send a custom domain name instead of heserver? Maybe users computer name or something else? Anything that would make the domain unique to each user would be ideal.

Can’t really rely on users local IP or would be easy fix for me.

Any input greatly appreciated.

1 Like

You could use the unique system ID generated? Read “Tutorial: how to send a unique computer ID to a remote server” at
http://www.exeoutput.com/help/customheaders#tutorial-how-to-send-a-unique-computer-id-to-a-remote-server

Yes, have been looking at that.

No doubt it would work but was hoping to modify the “domain name” as system working with has code in place to handle. Would save me many hours from modifying licensing server code.

So I assume by your reply there is no way to modify the sent domain “heserver”?

Thanks!

6 days without response. I only dream of getting 6 days off:)

No, “heserver” is built-in because it’s the built-in protocol we use. Maybe in a future update?
6 days off? It’s some vacation…

I do not think you get my sense of humor. Was just kidding my friend.

Oh, that is sad for me. Certainly be nice to have ability to set custom domain name + unique string. Or even heserver+[unique computer ID]. This would ensure each user has own unique domain name.

Thanks!

There are so many ways to generate a unique id, I do not see the need for it, even because it hides the heserver.

With php itself you can generate a unique id, using example hardware information:

<?php
        //cpu stat
        $prevVal = shell_exec("cat /proc/stat");
        $prevArr = explode(' ',trim($prevVal));
        $prevTotal = $prevArr[2] + $prevArr[3] + $prevArr[4] + $prevArr[5];
        $prevIdle = $prevArr[5];
        usleep(0.15 * 1000000);
        $val = shell_exec("cat /proc/stat");
        $arr = explode(' ', trim($val));
        $total = $arr[2] + $arr[3] + $arr[4] + $arr[5];
        $idle = $arr[5];
        $intervalTotal = intval($total - $prevTotal);
        $stat['cpu'] =  intval(100 * (($intervalTotal - ($idle - $prevIdle)) / $intervalTotal));
        $cpu_result = shell_exec("cat /proc/cpuinfo | grep model\ name");
        $stat['cpu_model'] = strstr($cpu_result, "\n", true);
        $stat['cpu_model'] = str_replace("model name    : ", "", $stat['cpu_model']);
        //memory stat
        $stat['mem_percent'] = round(shell_exec("free | grep Mem | awk '{print $3/$2 * 100.0}'"), 2);
        $mem_result = shell_exec("cat /proc/meminfo | grep MemTotal");
        $stat['mem_total'] = round(preg_replace("#[^0-9]+(?:\.[0-9]*)?#", "", $mem_result) / 1024 / 1024, 3);
        $mem_result = shell_exec("cat /proc/meminfo | grep MemFree");
        $stat['mem_free'] = round(preg_replace("#[^0-9]+(?:\.[0-9]*)?#", "", $mem_result) / 1024 / 1024, 3);
        $stat['mem_used'] = $stat['mem_total'] - $stat['mem_free'];
        //hdd stat
        $stat['hdd_free'] = round(disk_free_space("/") / 1024 / 1024 / 1024, 2);
        $stat['hdd_total'] = round(disk_total_space("/") / 1024 / 1024/ 1024, 2);
        $stat['hdd_used'] = $stat['hdd_total'] - $stat['hdd_free'];
        $stat['hdd_percent'] = round(sprintf('%.2f',($stat['hdd_used'] / $stat['hdd_total']) * 100), 2);
        //network stat
        $stat['network_rx'] = round(trim(file_get_contents("/sys/class/net/eth0/statistics/rx_bytes")) / 1024/ 1024/ 1024, 2);
        $stat['network_tx'] = round(trim(file_get_contents("/sys/class/net/eth0/statistics/tx_bytes")) / 1024/ 1024/ 1024, 2);
        //output headers
        header('Content-type: text/json');
        header('Content-type: application/json');
        //output data by json
        echo    
        "{\"cpu\": " . $stat['cpu'] . ", \"cpu_model\": \"" . $stat['cpu_model'] . "\"" . //cpu stats
        ", \"mem_percent\": " . $stat['mem_percent'] . ", \"mem_total\":" . $stat['mem_total'] . ", \"mem_used\":" . $stat['mem_used'] . ", \"mem_free\":" . $stat['mem_free'] . //mem stats
        ", \"hdd_free\":" . $stat['hdd_free'] . ", \"hdd_total\":" . $stat['hdd_total'] . ", \"hdd_used\":" . $stat['hdd_used'] . ", \"hdd_percent\":" . $stat['hdd_percent'] . ", " . //hdd stats
        "\"network_rx\":" . $stat['network_rx'] . ", \"network_tx\":" . $stat['network_tx'] . //network stats
        "}";
        ?>

There are many possibilities, let the developer work on more important things.
It is only an opinion, Don’t take it personally.

Good luck.

Never will take it personal. Each for their own Wayos. I retired from teaching after 28 years and had to listen to everyones opinion. If everyone had the same opinion about the way things should be, a lot of good things would never happen:)

Opps, on mobile and hit something that submitted…

Thank you for the script and info @wayos

1 Like

I’m sorry, only now that I’ve been to see that only works on linux.
This one I tested and works normal on local server (win).

I think with this example you can learn to work with system information, using php exec. ^^

No problem @wayos. Kind of thought would not work but I have been wrong more than right, lol. I started learning programming back in the 70’s (DOS) and never tinkered with PHP until 2009.

I just think being able to send a custom domain name would be beneficial to everyone at some point. For instance: I am working on a licensing server and can receive domain name “heserver” via curl. If exeout could simply append some type of unique ID along with the domain name, make things simple to restrict usage of the software.

Sure there are many other uses in long run.

Not trying to hide “heserver”, just make it unique:) Also, I certainly do not wish to muddy the development of exeout - only suggesting possible useful features.

Cheers!

1 Like