Ejemplo n.º 1
0
        /** 20180409.  Control Version en CMEDIA */
        static void SetCurrentSwVersion()
        {
            if (Settings.Default.SNMPEnabled == 1)
            {
                System.Threading.Tasks.Task.Factory.StartNew(() =>
                {
                    System.Threading.Thread.Sleep(5000);

                    VersionDetails version = new VersionDetails("versiones.json");
                    /** Se añade el componente CMEDIA */
                    version.version.Components.Add(new VersionDetails.VersionDataComponent()
                    {
                        Name  = "Hardware de Audio",
                        Files = new List <VersionDetails.VersionDataFileItem>()
                        {
                            new   VersionDetails.VersionDataFileItem()
                            {
                                Path = _HwManager.HwManagerType + " #1",
                                Date = _HwManager.SwDate(0),
                                Size = _HwManager.SwVersion(0),
                                MD5  = ""
                            },
                            new   VersionDetails.VersionDataFileItem()
                            {
                                Path = _HwManager.HwManagerType + " #2",
                                Date = _HwManager.SwDate(1),
                                Size = _HwManager.SwVersion(1),
                                MD5  = ""
                            },
                            new   VersionDetails.VersionDataFileItem()
                            {
                                Path = _HwManager.HwManagerType + " #3",
                                Date = _HwManager.SwDate(2),
                                Size = _HwManager.SwVersion(2),
                                MD5  = ""
                            },
                            new   VersionDetails.VersionDataFileItem()
                            {
                                Path = _HwManager.HwManagerType + " #4",
                                Date = _HwManager.SwDate(3),
                                Size = _HwManager.SwVersion(3),
                                MD5  = ""
                            }
                        }
                    });
                    /** Se actualiza el string de version */
                    SnmpStringObject.Get(Settings.Default.CurrentSwVersionOid).Value = version.ToString();
                });
            }
        }
Ejemplo n.º 2
0
 public void PduSetReceived_handler(string oid, ISnmpData data)
 {
     if (QueryOid.Contains(oid))
     {
         /** Tengo que escribir en Properties.Settings.Default.OidRespuesta la Oid Base (fila)
          * de la tabla correspondiente al equipo */
         string oid_equipo = equipments.OidEquipo(data.ToString());
         SnmpStringObject.Get(AnswerOid).Value = oid_equipo;
     }
     else
     {
         /** Tengo que avisar que hay cambios... */
         NotifyExternalChange?.Invoke(equipments.EquipmentName(oid));
     }
 }
Ejemplo n.º 3
0
 /** 20170309. AGL. Supervision Estado Ntp Client */
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 static void NtpClientSupervisor_tick(object sender, ElapsedEventArgs e)
 {
     NtpClientSupervisor.Enabled = false;
     try
     {
         _Logger.Trace("NtpClientSupervisor_tick IN");
         using (NtpClientStatus ntpc = new NtpClientStatus(NtpClientStatus.NtpClient.Windows))
         {
             SnmpStringObject.Get(Settings.Default.NtpClientStatus_Oid).Value = String.Join("##", ntpc.Status.ToArray());
             _Logger.Trace("NtpClientSupervisor_tick OUT {0}", String.Join("##", ntpc.Status.ToArray()));
         }
     }
     catch (Exception x)
     {
         _Logger.Error("NtpClientSupervisor_tick Exception: {0}", x.Message);
     }
     finally
     {
         NtpClientSupervisor.Interval = 60000;
         NtpClientSupervisor.Enabled  = true;
     }
 }