Page 1 of 1

Collecting Node Stats from an OmniEngine using OmniScript

Posted: Wed Jun 16, 2010 6:05 pm
by Spacepacket
In other posts, we have demonstrated how to connect to and create captures in an OmniEngine from a script. Here, we have some code to get the node stats for a particular capture. This is how we do it in OmniMapper, where we aggregate nodes from multiple OmniEngine, and map them to the Google Map.

#import "EPRCmdAPI.tlb" rename("value", "val")
hr = spCmdMgr->Connect( L"localhost", inSettings.GetPort(), 30000 );

EPRCmdAPI::IPeekRemoteNodeListPtr spRemoteNodeListPtr;
spRemoteNodeListPtr = m_spRemoteCmdMgr->GetNodeListAll( m_bstrCapture);
long nCount = spRemoteNodeListPtr->GetCount();

for (int i =0; i < nCount; i++)
{
EPRCmdAPI::IPeekSimpleNodeStatPtr spNode = spRemoteNodeListPtr->GetItem( i );
_bstr_t bstrIP = spNode->GetIPAddr();
UInt32 nIP = inet_addr( bstrIP );
UInt32 nPacketsReceived = spNode->GetPacketsSent();

// do something really cool with the IP and stats
}

Of course, this can be done from any language that supports COM bindings. If you have a sample you would like to share, please post it to this forum.

RE: Collecting Node Stats from an OmniEngine using OmniScrip

Posted: Thu Jun 17, 2010 1:58 pm
by Spacepacket
For a more complete sample, check this out:

https://mypeek.wildpackets.com/view_sub ... php?id=108