Exemple #1
0
        public async Task ShouldExecuteSNMPWalkResultAndGetOIDs()
        {
            var oids = await _service.Handle(new WalkQuery("public", "1.3.6.1.2.1.1", IPAddress.Loopback, 161));

            CollectionAssert.IsNotEmpty(oids);
            Assert.That(oids, Has.One.With.Property("Id").EqualTo("1.3.6.1.2.1.1.6.0"));
        }
Exemple #2
0
        public async Task SetupAsync()
        {
            _settingsRepositoryMock = new Mock <ISettingsRepository>();
            _settingsRepositoryMock.Setup(x => x.GetSettings()).ReturnsAsync(new Settings());

            _service = new SNMPServices(new LoggerFactory(), new BashCommand(), _settingsRepositoryMock.Object);

            await _service.Handle(configuration);

            await _service.Handle(aesUser);

            await _service.Handle(desUser);

            await Task.Delay(5000);
        }
Exemple #3
0
        public async Task <IActionResult> SetupSNMP(SNMPConfiguration configuration)
        {
            try
            {
                await _services.Handle(configuration);
            }
            catch (ProcessException ex)
            {
                ViewData["Error"] = ex.Message;
            }

            return(View(configuration));
        }