55 lines
2.2 KiB
C#
55 lines
2.2 KiB
C#
using System;
|
|
using ln.skyscanner.entities;
|
|
using ln.types;
|
|
using ln.snmp;
|
|
using System.Collections.Generic;
|
|
using ln.snmp.types;
|
|
using ln.logging;
|
|
|
|
namespace ln.skyscanner.checks
|
|
{
|
|
public class Ubiquity : SkyCheck
|
|
{
|
|
public Ubiquity()
|
|
:base("ubiquity")
|
|
{
|
|
}
|
|
|
|
|
|
public override void Check(SkyChecker skyChecker, Node node)
|
|
{
|
|
foreach (URI snmpUri in node.FindURIs("snmp"))
|
|
{
|
|
using (SnmpInterface snmp = SnmpInterface.FromURI(snmpUri,skyChecker.SNMPEngine))
|
|
{
|
|
Sequence[][] ptp = snmp.snmpWalk(new string[] {
|
|
"1.3.6.1.4.1.41112.1.3.2.1.5",
|
|
"1.3.6.1.4.1.41112.1.3.2.1.6",
|
|
"1.3.6.1.4.1.41112.1.3.2.1.11",
|
|
"1.3.6.1.4.1.41112.1.3.2.1.14",
|
|
"1.3.6.1.4.1.41112.1.3.3.1.64",
|
|
"1.3.6.1.4.1.41112.1.3.3.1.66"
|
|
});
|
|
|
|
foreach (Sequence[] row in ptp)
|
|
{
|
|
skyChecker.WritePerfValue(this, "ptp_rx_capa", node, (double)((Integer)(row[0].Items[1])).LongValue);
|
|
skyChecker.WritePerfValue(this, "ptp_tx_capa", node, (double)((Integer)(row[1].Items[1])).LongValue);
|
|
skyChecker.WritePerfValue(this, "ptp_rx_pwr", node, (double)((Integer)(row[2].Items[1])).LongValue);
|
|
skyChecker.WritePerfValue(this, "ptp_tx_pwr", node, (double)((Integer)(row[3].Items[1])).LongValue);
|
|
|
|
skyChecker.WritePerfValue(this, "ptp_rx_rate", node, (double)((Integer)(row[4].Items[1])).LongValue); // ToDo: multiply 8 / delta T
|
|
skyChecker.WritePerfValue(this, "ptp_tx_rate", node, (double)((Integer)(row[5].Items[1])).LongValue); // ToDo: multiply 8 / delta T
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
public override bool IsValid(Node node)
|
|
{
|
|
return (node.Vendor != null) && node.Vendor.Equals("Ubiquity");
|
|
}
|
|
}
|
|
}
|