Difference between revisions of "SNMP and PowerShell"

Jump to navigation Jump to search
155 bytes added ,  07:14, 29 August 2012
m
Minor update to intro
m (→‎Example Usage: Typo correct)
m (Minor update to intro)
Line 1: Line 1:
== Overview ==
== Overview ==
This page covers using PowerShell as an SNMP client, so that you can poll/probe/interrogate SNMP servers (be they servers, network devices, UPS's, etc).
'''All of the scripts below utilises the [http://sharpsnmplib.codeplex.com/ #SNMP (SharpSNMP) Suite] for .NET/Mono.'''  Its an open source  
'''All of the scripts below utilises the [http://sharpsnmplib.codeplex.com/ #SNMP (SharpSNMP) Suite] for .NET/Mono.'''  Its an open source  
[[Acronyms#S|SNMP]] library that supports .NET 3.5 and 4.0, which means that you can use it with PowerShell.  The library has a wide range of functionality and the scripts below just cover what I consider to be the core of what you might want to do with PowerShell.
[[Acronyms#S|SNMP]] library that supports .NET 3.5 and 4.0, which means that you can use it with PowerShell.  The library has a wide range of functionality and the scripts below just cover what I consider to be the core of what you might want to do with PowerShell.
Line 18: Line 20:


=== Generic Objects ===
=== Generic Objects ===
In order to use the library you need to be able to create generic objects, which doesn't work in PowerShell v1.  Its meant to be fixed in v2, but I've not got it to work (probably because I don't actually understand what they are really. So I've used the [http://www.leeholmes.com/blog/2006/08/18/creating-generic-types-in-powershell/ workaround by Lee Holmes].
In order to use the library you need to be able to create generic objects, which doesn't work in PowerShell v1.  Its meant to be fixed in v2, but I've not got it to work (probably because I don't actually understand what they are really. So I've used this [http://www.leeholmes.com/blog/2006/08/18/creating-generic-types-in-powershell/ workaround by Lee Holmes].


The function below is Lee Holmes' work wrapped into a function...
The function below is Lee Holmes' work wrapped into a function...

Navigation menu