Powershell – SNMP custom commands on Windows

powershellsnmpwindows-server-2008

For a while I've monitored UNIX/Linux servers using SNMP. Modifying the snmpd.conf file and adding something like

view systemview included .1.2.3.4.5.6.789
pass .1.2.3.4.5.6.789 /bin/bash /bin/myscript.sh

lets me run custom scripts to SNMP OID's. I have a powershell script in Windows and I need to do the same, how/where do I configure and set this up?

Box is Windows Server 2008 (I think R2)

Best Answer

As far as I know the only method to do what you're looking for would be to implement an SNMP Extension Agent (DLL). There may already be somebody who has implemented an extension agent that would allow you to execute arbitrary commands (as it sounds like a handy thing) but I am not familiar with one.

Microsoft has various docs on developing and installing SNMP Extension Agents. There's a nice, succinct write-up on developing SNMP Extension Agents at CodeProject, too.

An SNMP Extension Agent that allowed for arbitrary definition of commands to execute would certainly be interesting, but I don't have the copious free time to write it.