I'm trying to monitor system up time by using #snmp (Lextm.SharpSnmpLib.9.0.1) and C#.
Here's my code:
public int GetUptime()
{
var uptimeMessage = new GetNextRequestMessage(0, VersionCode.V1, new OctetString("public"),
new List<Variable>
{
new Variable(new ObjectIdentifier(Oids.SystemUpTime))
});
var response = uptimeMessage.GetResponse(10000, _agentEndPoint);
var ticks = response.Pdu().Variables[0].Data.ToString();
return int.Parse(ticks);
}
But i'm getting a CS0103 error when trying to get .Data property for a response of type TimeTicks.
Here's the Inspection Window of VS2015
If this is not a bug, how can i access raw ticks value using #snmp ?