Beispiel #1
0
 public void startMonitoring()
 {
     hintsCpu = 0;
     hintsRam = 0;
     while (monitoringStatus)
     {
         string toSend = "mntsts";
         float  cpu    = getCPUCounter();
         cpu = (float)Math.Round(cpu, 2);
         float ram = getRAMAvailable();
         toSend += cpu.ToString();
         toSend += " ";
         toSend += ram.ToString();
         toSend += " ";
         if (cpu >= warningCpu)
         {
             hintsCpu++;
         }
         else
         {
             hintsCpu = 0;
         }
         if (hintsCpu == warningTime)
         {
             toSend  += "y";
             toSend  += " ";
             hintsCpu = -60 + warningTime;
         }
         else
         {
             toSend += "n";
             toSend += " ";
         }
         if (ram <= warningRAM)
         {
             hintsRam++;
         }
         else
         {
             hintsRam = 0;
         }
         if (hintsRam == warningTime)
         {
             toSend  += "y";
             toSend  += " ";
             hintsRam = -60 + warningTime;
         }
         if (monitoringStatus)
         {
             networkingServerClass.sendCommand(toSend, "c0mm@nds t0 r3c3iv3 %!4");
         }
     }
     //networkingServerClass.sendCommand("stpmnt", "c0mm@nds t0 r3c3iv3 %!4");
     //ACI ESTE PROBLEMA SECOLULUI , SI AM REMEDIAT-O
 }
Beispiel #2
0
 public void messageToClient(string message)
 {
     networkingServerClass.sendCommand("messag" + message, "c0mm@nds t0 r3c3iv3 %!4");
 }