Developers

Collecting Node Stats from an OmniEngine using OmniScript

A place for developers to exchange information about extending OmniPeek, and ask technical questions about plugins on MyPeek, scripting, and programming.
Spacepacket
Posts: 78
Joined: Thu May 22, 2008 9:36 am

Collecting Node Stats from an OmniEngine using OmniScript

Postby Spacepacket » Wed Jun 16, 2010 6:05 pm

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.

Spacepacket
Posts: 78
Joined: Thu May 22, 2008 9:36 am

RE: Collecting Node Stats from an OmniEngine using OmniScrip

Postby Spacepacket » Thu Jun 17, 2010 1:58 pm

For a more complete sample, check this out:

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


Return to “Developers”

Who is online

Users browsing this forum: No registered users and 2 guests