Post
Topic
Board Mining (Altcoins)
Re: [Awesome Miner] - Powerful Windows GUI to manage and monitor up to 200000 miners
by
patrike
on 27/03/2019, 21:36:46 UTC
Hi Patrike,

I'm trying to write a custom C# Script that sends a "reboot by IP" request. What is the way to get the host IP of a host that has triggered a Rule? Is it included in List?

I need to run a Script like this:

Code:
using System.Text;
using System.Net;
using System.Collections.Specialized;

public class ActionScript
{
private ContextProvider Context = ScriptManager.Context;

public bool Execute(List list)
{
foreach (var miner in list)
{
String ipToReset = // I need the IP of the miner that has triggered the rule or its host name

using (var wb = new WebClient())
            {
                var response = wb.DownloadString("http://xxx.xxx.xxx.xxx:xxx/?IP=" + ipToReset + "&RESET=");
            }
}
return true;
}
}
Please use the following. It will return the IP address or hostname you have configured for your miner.
Code:
string ipToReset = (miner as MinerBase).GetHostname();