Thanks for the reply's.
I had a go with the scripts but running into issues with the callback. I am getting 'TypeError: Cannot read property "length" from undefined at line: 16'.
var foxesCBHandler = function(status, headers, content)
{
var data = JSON.parse(content);
data = data.result; //lets get the info we want.
for (var pnt in CONTEXT_POINTS) //list of points in context
{
for(var i=0; i<data.length; i++) //loop through available values.
{
if(this[pnt].xid === data[ i ].deviceName) //items match
{
this[pnt].set(data[ i ].diStatus, Date.parse(data[ i ].readDate) ); //set value and time
break; //finished, next context pt!
}
}
}
}
I'm rather new to javascript so not sure what the issue is there. The JSON i am requesting is:
{"slot":0,"io":{"di":[
{"diIndex":0,"diMode":0,"diStatus":0},
{"diIndex":1,"diMode":0,"diStatus":0},
{"diIndex":2,"diMode":0,"diStatus":0},
{"diIndex":3,"diMode":0,"diStatus":0}
]}}
I am just looking to pull the DiStatus.
Matt, i am using the Moxa IoLogic. I can give that a look although have never used SNMP before. Have you set them up before with SNMP in the past? I'm not too sure of the configuration for it.
Zaphod