Jump to content


Photo
- - - - -

help for useing SNMP in labview


  • Please log in to reply
31 replies to this topic

#1 zyh7148

zyh7148

    3 more posts to go.

  • Members
  • 7 posts

Posted 15 March 2009 - 07:26 AM

Hi, hello!

I have one devie which is used for monitoring the water leaking in my project. But the data of this device is only monitored in web browser, which is not compatible with our software frame of labview. The vendor of this device only provides the MIB file of SNMP protocol. If I want to integrate DAQ system of this device in our software frame of labview, are there good ways? Or who sends me the free SNMP Toolkit of labview?
My E-mail is zyh7148@yahoo.com.cn
Thank you!



#2 Mark Yedinak

Mark Yedinak

    Extremely Active

  • Premium Member
  • 422 posts
  • Location:Huntley, IL
  • Version:LabVIEW 2011
  • Since:1997

Posted 15 March 2009 - 05:46 PM

*
POPULAR

Here is a basic SMNPv1 implementation I wrote years back. This code can be improved a bit but for basic communications it works well.http://lavag.org/top...dpost__p__65199


---
Mark Yedinak - Certified LabVIEW Architect and LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot

#3 Maca

Maca

    Very Active

  • Members
  • PipPipPip
  • 65 posts
  • Location:Rockhampton Australia
  • Version:LabVIEW 2009
  • Since:2002

Posted 15 March 2009 - 07:01 PM

I have previously used Net-SNMP ( http://www.net-snmp.org/ ) with system exec calls.



#4 zyh7148

zyh7148

    3 more posts to go.

  • Members
  • 7 posts

Posted 18 March 2009 - 10:13 AM

QUOTE (Mark Yedinak @ Mar 14 2009, 04:25 PM)

Here is a basic SMNPv1 implementation I wrote years back. This code can be improved a bit but for basic communications it works well.


Thank you very much!
Is this software toolkit used for SNMPv3? Are there difference between SNMPv1 and SNMPv3? Please send me some example of this software tookit.
Thanks!



#5 Donald

Donald

    Very Active

  • Members
  • PipPipPip
  • 71 posts

Posted 18 March 2009 - 11:53 AM

There are also some quit cheap activeX toolkits available on the net that can be interfaced in LabVIEW.



#6 Phillip Brooks

Phillip Brooks

    The 500 club

  • Members
  • PipPipPipPipPip
  • 749 posts
  • Location:Boston, MA
  • Version:LabVIEW 8.6
  • Since:1999

Posted 18 March 2009 - 11:56 AM

QUOTE (zyh7148 @ Mar 17 2009, 04:52 AM)

Thank you very much!
Is this software toolkit used for SNMPv3? Are there difference between SNMPv1 and SNMPv3? Please send me some example of this software tookit.
Thanks!


The main difference between SNMPv1 & v3 is that v3 adds security (authentication, data integrity and encryption).



Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T


#7 Mark Yedinak

Mark Yedinak

    Extremely Active

  • Premium Member
  • 422 posts
  • Location:Huntley, IL
  • Version:LabVIEW 2011
  • Since:1997

Posted 18 March 2009 - 04:15 PM

QUOTE (zyh7148 @ Mar 17 2009, 03:52 AM)

Thank you very much!
Is this software toolkit used for SNMPv3? Are there difference between SNMPv1 and SNMPv3? Please send me some example of this software tookit.
Thanks!


There a couple of examples in the library file. This version supports only SNMPv1. With minor modifications it could support SNMPv2 which mainly added the GET-BULK-PDU. As mentioned previously in this thread SNMPv3 adds security to the protocol. Adding support for SNMPv3 would require a little bit more effort. However, if you are only doing simple GET requests, this version should work with your SNMP agent, even if it supports SNMPv3. SNMPv3 agents will still support SNMPv1 messages. From what you described you needed to do this code should work for you.


---
Mark Yedinak - Certified LabVIEW Architect and LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot

#8 ChrisClark

ChrisClark

    Active

  • Members
  • Pip
  • 22 posts
  • Version:LabVIEW 2010
  • Since:1990

Posted 18 March 2009 - 04:49 PM

If you need SNMPv3, and the agent you are talking to has authentication and/or encryption turned on, it will take you some weeks of work to write that code. Using Net-SNMP with System Exec.vi seems like your best free option, though I have not tried this personally. SNMP Toolkit for LabVIEW at snmptoolkit.com costs $995.00 but is a native LabVIEW Toolkit with one .dll for MIB compilation and a second .dll for SNMPv3 encryption and has been used successfully for many v3 projects.



#9 zyh7148

zyh7148

    3 more posts to go.

  • Members
  • 7 posts

Posted 19 March 2009 - 07:08 AM

QUOTE (Mark Yedinak @ Mar 17 2009, 02:54 PM)

There a couple of examples in the library file. This version supports only SNMPv1. With minor modifications it could support SNMPv2 which mainly added the GET-BULK-PDU. As mentioned previously in this thread SNMPv3 adds security to the protocol. Adding support for SNMPv3 would require a little bit more effort. However, if you are only doing simple GET requests, this version should work with your SNMP agent, even if it supports SNMPv3. SNMPv3 agents will still support SNMPv1 messages. From what you described you needed to do this code should work for you.


Thanks for your answer, I learn about your software toolkit and I'm going to working on my code soon. If I have other problems about SNMP during my work, I have to need your help.
Thank you very much!



#10 Lorenzo

Lorenzo

    Are we there yet?

  • Members
  • 5 posts

Posted 04 April 2009 - 10:08 AM

Hello,

I would like communicate with a system in SNMPv1. I download the files "snmp communication.zip" in this topic.
My knowleadges in the SNMP communication are very limited and I don't know how I can establish a communication with the system.

I attached the MIB of my system.

Someone could explain me how can I communicate with my system ?
Could you give me an example ?

Thanks for your answers.



#11 Mark Yedinak

Mark Yedinak

    Extremely Active

  • Premium Member
  • 422 posts
  • Location:Huntley, IL
  • Version:LabVIEW 2011
  • Since:1997

Posted 04 April 2009 - 07:22 PM

QUOTE (Lorenzo @ Apr 3 2009, 03:47 AM)

Hello,

I would like communicate with a system in SNMPv1. I download the files "snmp communication.zip" in this topic.
My knowleadges in the SNMP communication are very limited and I don't know how I can establish a communication with the system.

I attached the MIB of my system.

Someone could explain me how can I communicate with my system ?
Could you give me an example ?

Thanks for your answers.



Unfortunately the MIB document that you posted is not syntactically correct. It would not be able to be parsed correctly by any MIB compiler. With that said I can say that the base OID for your MIB objects will be 1.3.6.1.4.1.9999.x. I should also note that unless you are with the company Zerna, Koepper & Partner (Egbert Casper, cas&zkp.de) you should not be using an enterprise number of 9999. Enterprise numbers are registered with the IANA (Internet Assigned Numbers Authority). You can request an enterprise number here. Registering a number is free. If you are on an isolated network you will not encounter any problems but it is always best to play by the rules. Anyway, manually compiling your MIB document is not very easy and it appears that some of your definitions are incomplete. Therefore I cannot give you specific OID values for items in your MIB. From what I can see I assume they want the OID for the dcIdentManufacturer to be 1.3.6.1.4.1.9999.1.1.1.0. dcIdentModel would then be 1.3.6.1.4.1.9999.1.1.2.0 and so on. dcPowerSystemBusbarVoltage is most likely 1.3.6.1.4.1.9999.1.2.1.0.

I would suggest that you look at the MIB Walk (SNMP MIB Walk.vi) example that I included in the library I posted. This will walk the complete MIB of an agent and it will list al avialable OIDs for that the agent. It may not return a value for every element in the mIB since it is legal for a element to be defined but the agent not contain it. Once you see the specific elements supported by the agent you can work with the other VIs in the library to set or get specific elements. The only VIs you will need to use directly from your code are SNMP Get Random Port.vi (it will use the first available local UDP port which minimizes conflicts on your local machine), to open the UDP port and them SNMP Close Port.vi to close it when you are finished. Then you can use Set SNMP Item(s).vi and Get SNMP Item(s).vi to set or get specific OIDs in your agent. You can also use the basic PDU primatives of SNMP Get Next.vi, SNMP Get Request.vi, SNMP Set Request.vi, SNMP Get Response.vi and if required SNMP Get Trap.vi. The remaining VIs in the library should not be called directly.

If you have other questions once you look at this let me know.


---
Mark Yedinak - Certified LabVIEW Architect and LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot

#12 Mark Yedinak

Mark Yedinak

    Extremely Active

  • Premium Member
  • 422 posts
  • Location:Huntley, IL
  • Version:LabVIEW 2011
  • Since:1997

Posted 04 April 2009 - 08:25 PM

QUOTE (Lorenzo @ Apr 3 2009, 03:47 AM)

Hello,

I would like communicate with a system in SNMPv1. I download the files "snmp communication.zip" in this topic.
My knowleadges in the SNMP communication are very limited and I don't know how I can establish a communication with the system.

I attached the MIB of my system.

Someone could explain me how can I communicate with my system ?
Could you give me an example ?

Thanks for your answers.


Unfortunately the MIB document that you posted is not syntactically correct. It would not be able to be parsed correctly by any MIB compiler. With that said I can say that the base OID for your MIB objects will be 1.3.6.1.4.1.9999.x. I should also note that unless you are with the company Zerna, Koepper & Partner (Egbert Casper, cas&zkp.de) you should not be using an enterprise number of 9999. Enterprise numbers are registered with the IANA (Internet Assigned Numbers Authority). You can request an enterprise number here. Registering a number is free. If you are on an isolated network you will not encounter any problems but it is always best to play by the rules. Anyway, manually compiling your MIB document is not very easy and it appears that some of your definitions are incomplete. Therefore I cannot give you specific OID values for items in your MIB. From what I can see I assume they want the OID for the dcIdentManufacturer to be 1.3.6.1.4.1.9999.1.1.1.0. dcIdentModel would then be 1.3.6.1.4.1.9999.1.1.2.0 and so on. dcPowerSystemBusbarVoltage is most likely 1.3.6.1.4.1.9999.1.2.1.0.

I would suggest that you look at the MIB Walk (SNMP MIB Walk.vi) example that I included in the library I posted. This will walk the complete MIB of an agent and it will list al avialable OIDs for that the agent. It may not return a value for every element in the mIB since it is legal for a element to be defined but the agent not contain it. Once you see the specific elements supported by the agent you can work with the other VIs in the library to set or get specific elements. The only VIs you will need to use directly from your code are SNMP

QUOTE (Lorenzo @ Apr 3 2009, 03:47 AM)

Hello,

I would like communicate with a system in SNMPv1. I download the files "snmp communication.zip" in this topic.
My knowleadges in the SNMP communication are very limited and I don't know how I can establish a communication with the system.

I attached the MIB of my system.

Someone could explain me how can I communicate with my system ?
Could you give me an example ?

Thanks for your answers.


Unfortunately the MIB document that you posted is not syntactically correct. It would not be able to be parsed correctly by any MIB compiler. With that said I can say that the base OID for your MIB objects will be 1.3.6.1.4.1.9999.x. I should also note that unless you are with the company Zerna, Koepper & Partner (Egbert Casper, cas&zkp.de) you should not be using an enterprise number of 9999. Enterprise numbers are registered with the IANA (Internet Assigned Numbers Authority). You can request an enterprise number here. Registering a number is free. If you are on an isolated network you will not encounter any problems but it is always best to play by the rules. Anyway, manually compiling your MIB document is not very easy and it appears that some of your definitions are incomplete. Therefore I cannot give you specific OID values for items in your MIB. From what I can see I assume they want the OID for the dcIdentManufacturer to be 1.3.6.1.4.1.9999.1.1.1.0. dcIdentModel would then be 1.3.6.1.4.1.9999.1.1.2.0 and so on. dcPowerSystemBusbarVoltage is most likely 1.3.6.1.4.1.9999.1.2.1.0.

I would suggest that you look at the MIB Walk (SNMP MIB Walk.vi) example that I included in the library I posted. This will walk the complete MIB of an agent and it will list al avialable OIDs for that the agent. It may not return a value for every element in the mIB since it is legal for a element to be defined but the agent not contain it. Once you see the specific elements supported by the agent you can work with the other VIs in the library to set or get specific elements. The only VIs you will need to use directly from your code are SNMP

QUOTE (Lorenzo @ Apr 3 2009, 03:47 AM)

Hello,

I would like communicate with a system in SNMPv1. I download the files "snmp communication.zip" in this topic.
My knowleadges in the SNMP communication are very limited and I don't know how I can establish a communication with the system.

I attached the MIB of my system.

Someone could explain me how can I communicate with my system ?
Could you give me an example ?

Thanks for your answers.


Unfortunately the MIB document that you posted is not syntactically correct. It would not be able to be parsed correctly by any MIB compiler. With that said I can say that the base OID for your MIB objects will be 1.3.6.1.4.1.9999.x. I should also note that unless you are with the company Zerna, Koepper & Partner (Egbert Casper, cas&zkp.de) you should not be using an enterprise number of 9999. Enterprise numbers are registered with the IANA (Internet Assigned Numbers Authority). You can request an enterprise number here. Registering a number is free. If you are on an isolated network you will not encounter any problems but it is always best to play by the rules. Anyway, manually compiling your MIB document is not very easy and it appears that some of your definitions are incomplete. Therefore I cannot give you specific OID values for items in your MIB. From what I can see I assume they want the OID for the dcIdentManufacturer to be 1.3.6.1.4.1.9999.1.1.1.0. dcIdentModel would then be 1.3.6.1.4.1.9999.1.1.2.0 and so on. dcPowerSystemBusbarVoltage is most likely 1.3.6.1.4.1.9999.1.2.1.0.

I would suggest that you look at the MIB Walk (SNMP MIB Walk.vi) example that I included in the library I posted. This will walk the complete MIB of an agent and it will list al avialable OIDs for that the agent. It may not return a value for every element in the mIB since it is legal for a element to be defined but the agent not contain it. Once you see the specific elements supported by the agent you can work with the other VIs in the library to set or get specific elements. The only VIs you will need to use directly from your code are SNMP


---
Mark Yedinak - Certified LabVIEW Architect and LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot

#13 Lorenzo

Lorenzo

    Are we there yet?

  • Members
  • 5 posts

Posted 07 April 2009 - 03:29 PM

Hello,

Thank you for your answer.

I posted the right MIB of the system.

If I understood, I must enter 1.3.6.1.4.1.1356.1.1 in "START MIB WALK WITH OID (1):" and "END MIB WALK WITH OID:" in the SNMP MIB WALK.VI to see all the dcIdent data available.
Is it true ?



#14 Mark Yedinak

Mark Yedinak

    Extremely Active

  • Premium Member
  • 422 posts
  • Location:Huntley, IL
  • Version:LabVIEW 2011
  • Since:1997

Posted 07 April 2009 - 04:36 PM

QUOTE (Lorenzo @ Apr 6 2009, 09:08 AM)

Hello,

Thank you for your answer.

I posted the right MIB of the system.

If I understood, I must enter 1.3.6.1.4.1.1356.1.1 in "START MIB WALK WITH OID (1):" and "END MIB WALK WITH OID:" in the SNMP MIB WALK.VI to see all the dcIdent data available.
Is it true ?


Yes, starting your MIB walk at 1.3.6.1.4.1.1356.1.1 will get you the elements under the dcIndent branch. If you also set the END to the same OID than your MIB walk will only return 1 item. The way a MIB walk works is that you use the SNMP GET-NEXT PDU to request the element immediately folllowing the OID given. If you want to walk all of the elements in the upsman MIB then set your start value to 1.3.6.1.4.1.1356.1 and leave the END unset. If the agent is working correctly you should see all of the elements the agent currently contains. An agent that is working correctly will return a nosuchname error for the GET-NEXT of the last item. The GET-NEXT walks the MIB in lexigraphical order. If you would like to walk only the dcIdent branch then set the start OID to 1.3.6.1.4.1.1356.1.1 and the end OID to 1.3.6.1.4.1.1356.1.2.


---
Mark Yedinak - Certified LabVIEW Architect and LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot

#15 Lorenzo

Lorenzo

    Are we there yet?

  • Members
  • 5 posts

Posted 08 April 2009 - 01:44 PM

Hello,

It's OK. Now I can communicate with my system and see all the elements contained in the agent.

Thank you very much for your help...



#16 chinafpga

chinafpga

    Enough LAVA to be dangerous

  • Members
  • 4 posts
  • Location:Shanghai University,China
  • Version:LabVIEW 8.6
  • Since:2009

Posted 28 August 2009 - 03:36 AM

Here is a basic SMNPv1 implementation I wrote years back. This code can be improved a bit but for basic communications it works well.


Sorry.How can I find your download link?
Do it yourself !!!


#17 chinafpga

chinafpga

    Enough LAVA to be dangerous

  • Members
  • 4 posts
  • Location:Shanghai University,China
  • Version:LabVIEW 8.6
  • Since:2009

Posted 31 August 2009 - 06:02 AM

Here is a basic SMNPv1 implementation I wrote years back. This code can be improved a bit but for basic communications it works well.



Hello,could you tell me how to download your SNMP source cold?I could not find your download link.Posted Image


Do it yourself !!!


#18 Mark Yedinak

Mark Yedinak

    Extremely Active

  • Premium Member
  • 422 posts
  • Location:Huntley, IL
  • Version:LabVIEW 2011
  • Since:1997

Posted 31 August 2009 - 06:32 PM

Here it is.

Attached Files


---
Mark Yedinak - Certified LabVIEW Architect and LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot

#19 dgordon380

dgordon380

    I've come back for more.

  • Members
  • 2 posts
  • Version:LabVIEW 8.6
  • Since:2009

Posted 31 August 2009 - 06:36 PM

THANKS!

#20 chinafpga

chinafpga

    Enough LAVA to be dangerous

  • Members
  • 4 posts
  • Location:Shanghai University,China
  • Version:LabVIEW 8.6
  • Since:2009

Posted 01 September 2009 - 11:29 AM

Here it is.

Nice to meet you,sir.I'am a yang man.I'am a FPGA lover.Thank you very much.
Do it yourself !!!