The target is to get current agent status. I have this very simple code ti begin with:
Endpoint statServerEndpoint = new Endpoint("StatServer_Routing_1a", "XXXXXXXXXX", XXXX); // i have taken the real values from cme in my code.
StatServerProtocol statServerProtocol = new StatServerProtocol(statServerEndpoint);
statServerProtocol.ClientId = 1; // is this a random value that i give?
statServerProtocol.ClientName = "StatServer_Routing_1a"; // that is the name of the stat server basically
try
{
statServerProtocol.Open();
}
catch (Exception e)
{
Console.WriteLine("exception: " + e);
}
var requestOpenStatistic = RequestOpenStatistic.Create();
requestOpenStatistic.StatisticObject = StatisticObject.Create();
requestOpenStatistic.StatisticObject.ObjectId = "CurrentAgentState"; // what is the object's configuration id? where to find it?
requestOpenStatistic.StatisticObject.ObjectType = StatisticObjectType.Agent;
requestOpenStatistic.StatisticObject.TenantName = "Environment";
requestOpenStatistic.StatisticObject.TenantPassword = "";
requestOpenStatistic.StatisticMetric = StatisticMetric.Create();
requestOpenStatistic.StatisticMetric.StatisticType = "CurrentAgentState";
requestOpenStatistic.StatisticMetric.TimeProfile = "Default";
requestOpenStatistic.Notification = Notification.Create();
requestOpenStatistic.Notification.Mode = NotificationMode.NoNotification;
Console.WriteLine("Sending:\n{0}", requestOpenStatistic);
var response =
statServerProtocol.Request(requestOpenStatistic);
Console.WriteLine("Received:\n{0}", response);
statServerProtocol.BeginClose();
Not sure about the Object Id . In my Stat Server / Options i have an object called CurrentAgentState.
Tenant Password : should this be the password to login to cme?
It goes through the whole code and i get the response.
The result is that in the response i get the Event error <1>: Tenant "Environment" not found .
What can possibly be wrong here? Can you give me some hints?