/// <summary>
 /// Invokes the message received event handler.
 /// </summary>
 /// <param name="e">The <see cref="Lextm.SharpSnmpLib.Messaging.MessageReceivedEventArgs"/> instance containing the event data.</param>
 private void InvokeMessageReceived(TrapV1MessageReceivedEventArgs e)
 {
     var handler = MessageReceived;
     if (handler != null)
     {
         handler(this, e);
     }
 }
Exemple #2
0
        /// <summary>
        /// Invokes the message received event handler.
        /// </summary>
        /// <param name="e">The <see cref="Lextm.SharpSnmpLib.Messaging.MessageReceivedEventArgs"/> instance containing the event data.</param>
        private void InvokeMessageReceived(TrapV1MessageReceivedEventArgs e)
        {
            var handler = MessageReceived;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemple #3
0
 private void ListenerTrapV1Received(object sender, TrapV1MessageReceivedEventArgs e)
 {
     LogMessage(string.Format(CultureInfo.InvariantCulture, StrSends, DateTime.Now, e.Sender, e.TrapV1Message.ToString(Objects)));
 }
Exemple #4
0
        private void WatcherTrapV1Received(object sender, TrapV1MessageReceivedEventArgs e)
        {
            logger.Info("Trap recived");

            logger.Debug(e);
            foreach (Variable variable in e.TrapV1Message.Scope.Pdu.Variables)
            {
                logger.DebugFormat("Trap var: {0}", variable);
            }

            var testModel = new TestModel();

            //testModel.TestId = Convert.ToInt32(e.TrapV1Message.Scope.Pdu.Variables[0].Data.ToString());
            //testModel.IpDest = e.TrapV1Message.Scope.Pdu.Variables[1].Data.ToString();
            //testModel.Status = e.TrapV1Message.Scope.Pdu.Variables[2].Data.ToString();
            //testModel.IpSrc = e.TrapV1Message.Scope.Pdu.Variables[3].Data.ToString();

            if (TrapRecived != null)
            {
                TrapRecived.Invoke(this, testModel);
            }
        }
Exemple #5
0
 private static void WatcherTrapV1Received(object sender, TrapV1MessageReceivedEventArgs e)
 {
     Console.WriteLine("TRAP version {0}; {1}", e.TrapV1Message.Version, e.TrapV1Message);
 }
Exemple #6
0
 private static void WatcherTrapV1Received(object sender, TrapV1MessageReceivedEventArgs e)
 {
     Console.WriteLine(e.TrapV1Message);
 }