Scan network SNMP from terminal/CLI

Hello all!

Im looking for a CLI tool to scan a network for available targets using SNMP, and set IP.

I have seen some of the good work @christoph.hilchenbac has done hilch (Christoph Hilchenbach)

Is this still the best option for PVI6 targeting AR6?

Looking for advice.

Thanks all

BR
Carl

Hi,

as I know, yes.
I’m not aware of any other way except of using the PVI SNMP line.
This line is still supported with PVI6 (B&R Online Help), but I think you need to exchange the PVICOM.lib and .h when (re)building the .exe to the 6.x versions to use the tool with PVI6 environment only (so when no PVI4 is available).
But that’s just a guess, Christoph will know that better I swear :wink:

Best regards!

2 Likes

Hi,

i already started linking brsnmp with the PVI6 lib/dll.

I did not publish it yet since we face an issue with PVI6.x (QCAS-4517) which will be solved in PVI 6.5.2.

On the other hand there is no disadvantage in using brsnmp with PVI4 in combination with AR6, I don’t see any restrictions.

Unfortunately, SNMP is often disabled on controllers based on AR6, as this is the default setting for AS6.

It may therefore be necessary to rely more on the ANSL line in the future.

+++

Many IT administrators get nervous when unfamiliar *.exe files are used.
In another post, I showed that a combination of sockets and ANSL can also be used to perform a network scan using Python.

1 Like

Hi,

thanks for that update!!
Just for my clarification: I totally agree that e.g. scanning for ANSL port (or using your posted solution doing much more then just scanning, like it very much!) will be the more reliable way for future.
But for a scenario “setting a temporary IP address to bring a brandnew PLC into the network for initial commissioning”, there’s still no way around the PVI SNMP line, am I right?

BG Alex

Many thanks. I tried running browse_for_targets in Pvi.py and I could find targets but it did not give me the IP-adress. That doesnt really matter for my use case though.

I still have to try the set_ip script but I figure that’ll work also then. Ill get back.

Edit: Im trying to solve “first commissioning” so as @alexander.hefner said it has to be SNMP? Also, SNMP is always available in BOOT MODE is it not?

absolutely Ales, there is not other way.

1 Like

yep, you would need SNMP and this is always available in BOOT mode.

In BOOT mode the CPU enters the Onboard AR with SNMP enabled.

For this the well known brsnmp.exe is the simplest solution (or AS).

1 Like

Many thanks, it work like a charm. :sunny:

PS C:\projects\Tools\brsnmp_exe> ./brsnmp.exe --details
[
{
"targetTypeDescription":"X90CP154.60-S1",
"serialNumber":"29A..",
...
...
...
... and so on
}
]

yep. Please also refer to the examples e.g. how to setup a PLC via network by help of RUC.