473,804 Members | 3,716 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SNMP GEt using WMI

Dan
Does anyone have any samples or references to get me started with WMI for collecting SNMP information? Any help is appreciated.

Thanks,
Dan
Nov 20 '05 #1
5 6828


Nov 20 '05 #2
Dan
I found the following example for use with windows scripting. I made some minor tweeks to get it to compile in vb.net. Question; is it considered bad form to be using 'CreateObject' in .net? Is there a more .net recommended way of doing the same thing?

Thanks,
Dan
Dim strTargetSnmpDe vice As String = "127.0.0.1"
Dim strTargetSnmpCo mmunity As String = "public"

Dim objWmiLocator As Object = CreateObject("W bemScripting.SW bemLocator")
Dim objWmiServices As Object = objWmiLocator.C onnectServer("" , "root\snmp\loca lhost")

Dim objWmiNamedValu eSet As Object = CreateObject("W bemScripting.SW bemNamedValueSe t")
objWmiNamedValu eSet.Add("Agent Address", strTargetSnmpDe vice)
objWmiNamedValu eSet.Add("Agent ReadCommunityNa me", strTargetSnmpCo mmunity)

Dim colSystem = objWmiServices. InstancesOf("SN MP_RFC1213_MIB_ system", , objWmiNamedValu eSet)

For Each objSystem As Object In colSystem
Console.WriteLi ne("sysContact : " & objSystem.sysCo ntact & vbCrLf & "sysDescr: " & objSystem.sysDe scr & vbCrLf & "sysLocatio n: " & objSystem.sysLo cation & vbCrLf & "sysName: " & objSystem.sysNa me & vbCrLf & "sysObjectI D: " & objSystem.sysOb jectID & vbCrLf & "sysService s: " & objSystem.sysSe rvices & vbCrLf & "sysUpTime: " & objSystem.sysUp Time)
Next

Console.Read()

"Dan" wrote:
Does anyone have any samples or references to get me started with WMI for collecting SNMP information? Any help is appreciated.

Thanks,
Dan

Nov 20 '05 #3
Dan this is only to prevent that everone opens again and again your double
message.
I have no answer on this one, however you have posted it twice.
Nov 20 '05 #4
There is a free download to add WMI classes to Server Explorer. Look at:
http://msdn.microsoft.com/library/de...erExplorer.asp

"Dan" <Da*@discussion s.microsoft.com > wrote in message
news:A6******** *************** ***********@mic rosoft.com...
Does anyone have any samples or references to get me started with WMI for collecting SNMP information? Any help is appreciated.
Thanks,
Dan

Nov 20 '05 #5
Have a look at the System.Manageme nt namespace.
_______________ _______________ ________
The Grim Reaper

"Dan" <Da*@discussion s.microsoft.com > wrote in message
news:DC******** *************** ***********@mic rosoft.com...
I found the following example for use with windows scripting. I made some minor tweeks to get it to compile in vb.net. Question; is it considered bad
form to be using 'CreateObject' in .net? Is there a more .net recommended
way of doing the same thing?
Thanks,
Dan
Dim strTargetSnmpDe vice As String = "127.0.0.1"
Dim strTargetSnmpCo mmunity As String = "public"

Dim objWmiLocator As Object = CreateObject("W bemScripting.SW bemLocator") Dim objWmiServices As Object = objWmiLocator.C onnectServer("" , "root\snmp\loca lhost")
Dim objWmiNamedValu eSet As Object = CreateObject("W bemScripting.SW bemNamedValueSe t") objWmiNamedValu eSet.Add("Agent Address", strTargetSnmpDe vice)
objWmiNamedValu eSet.Add("Agent ReadCommunityNa me", strTargetSnmpCo mmunity)
Dim colSystem = objWmiServices. InstancesOf("SN MP_RFC1213_MIB_ system", , objWmiNamedValu eSet)
For Each objSystem As Object In colSystem
Console.WriteLi ne("sysContact : " & objSystem.sysCo ntact & vbCrLf & "sysDescr: " & objSystem.sysDe scr & vbCrLf & "sysLocatio n: " &
objSystem.sysLo cation & vbCrLf & "sysName: " & objSystem.sysNa me & vbCrLf &
"sysObjectI D: " & objSystem.sysOb jectID & vbCrLf & "sysService s: " &
objSystem.sysSe rvices & vbCrLf & "sysUpTime: " & objSystem.sysUp Time) Next

Console.Read()

"Dan" wrote:
Does anyone have any samples or references to get me started with WMI for collecting SNMP information? Any help is appreciated.
Thanks,
Dan

Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
10045
by: Matthew Bell | last post by:
Hi, I'm looking for a high-performance SNMP manager toolkit (SNMPv1 / v2, GET / GETNEXT / GETBULK) I can use with Python on Windows2K/XP. I wonder if anyone has got any suggestions? Commercial software is fine, as it's for a specialised in-house application. I've tried PySNMP which, while a fine piece of code (I've learnt a lot looking through it!), it's fairly CPU intensive in my application. I've also tried using UCDSNMP via...
1
3993
by: dan byers | last post by:
hey everyone, i'm working on a system to monitor devices through SNMP. i'm using the Net::SNMP modules by D.Town. i try to load the snmp session request with a set of OIDs to make the system run through the large set of queries faster. the problem i'm seeing is that if the request method does the request, and one particular index doesn't exist on the device, the entire request bails and no results are returned, thus skipping over any...
3
5328
by: Kevin Ingram | last post by:
Is it possible to connect to devices and read SNMP data with ASP? I did a search and all I could find was utilities for sale to do it, wondered if it can be done using straight ASP. We are using InterDev 6, IIS5 on W2KServer. Thanks!
0
1669
by: Chris | last post by:
For the IBM DB2 Development following this group. SNMP is coming back in a big way. Changes in Version 2c and adoptions of Version 3 are ushering in the adoption of SNMP back into the enterprise. Your customers are going to be asking for the inclusion of SNMP back into the monitoring suite. I'm not just talking about sending piddly SNMP traps. I mean the "real meat" stats you get out of your DB2 instances (physical-to-logical layout,...
0
1275
by: ramgce2003 | last post by:
Dear all... We have an NMS Software(Created by using GUI(Window) based application in VC++) already used to comminicate to our SNMP Agent Note::: 1. Consider NMS Software(actas a client) running one one PC and SNMP Agent(act as a server) may be just another PC. 2. If I run the NMS Software, it will send SNMP request to SNMP
2
2372
by: Sleurhutje | last post by:
Hi, I need to add SNMP functionality to an existing app. I need to be able to read specific real-time data from another system using SNMP traps. Anyone know a good sample or libs that can do this?
4
4230
by: Oliver | last post by:
Hi group: I'm running FreeBSD 6.2 with PHP5.2.4. I get this error when I try to start PHP: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613-debug/snmp.so' - Cannot open "/usr/local/lib/php/20060613-debug/snmp.so" in Unknown on line 0 Any ideas?
1
2080
by: idoha | last post by:
Hi, I am trying to determine the SNMP status on remote machine. I need to distinguish between two possible options, where the SNMP is not active: 1)When the SNMP listener is not active on a certain port (default is 161). This is caused when the SNMP service is off or when it listens to port other than 161. 2)When the communityString is incorrect. I have been trying to use NET::SNMP and send a get request. The problem is that it...
1
4186
by: Dirk Van de moortel | last post by:
{ OOPS, posted this to moderated group perl.cpan.discuss as well, so it can take a while to get through, if it gets through at all Otherwise sorry for duplicate posting } We need to set up a server 2003 (or a win XP system) to accept and act upon traps sent out from a storage system. Responding to various error conditions, this system can be fully configured to send traps.
7
3525
by: moon1 | last post by:
how will I change the code the 1st code according to the 2nd one? 1st code sub snmpGet(@) { # Assign arguments my ($deviceName)=$_; # Device name to read from my ($community)=$_; # SNMP Community String my ($timeout)=$_; # Timeout value for SNMP-GET request my ($type)=$_; # SNMP Object Type
0
9707
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.