Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Beatnik (493)

  (email not shown publicly)

A 29 year old belgian who likes Mountain Dew, Girl Scout Cookies, Tim Hortons French Vanilla Flavoured Cappucinno, Belgian beer, Belgian chocolate, Belgian women, Magners Cider, chocolate chipped cookies and Perl. Likes snowboarding, snorkling, sailing and silence. Bach can really cheer him up! He still misses his dog.

Project Daddy of Spine [], a mod_perl based CMS.

In his superhero time (8.30 AM to 5.30 PM), he works on world peace.

Journal of Beatnik (493)

Friday January 27, 2006
05:57 AM

Net-SNMP on Cygwin as Win32 Service

[ #28495 ]
I've had to swear and curse too much to get this up and running. Google turned out nada so I'm hoping this will help some who'll struggle with the same problem. I wanted Net-SNMP on Windows to start automatically and handle some poll requests by having it processed by an external script. The commands below register the Cygwin binaries for Net-SNMP as a service (adding a number of parameters for configuration purposes).

cygrunsrv --install "Net-SNMP Agent" --path /usr/local/sbin/snmpd.exe --args "-f -c c:/cygwin/usr/local/share/snmp/snmpd.conf -C -Lf c:/cygwin/var/log/snmpd.log tcp:16100,udp:16100" --desc "Net-SNMP Service" --type auto --dep Tcpip --shutdown -e"SNMPCONFPATH=C:/cygwin/usr/local/share/snmp"
cygrunsrv --install "Net-SNMP Trap Agent" --path /usr/local/sbin/snmptrapd.exe --args "-f -c c:/cygwin/usr/local/share/snmp/snmptrapd.conf -Lf c:\cygwin\var\log\snmptrapd.log tcp:16200,udp:16200" --desc "Net-SNMP Trap Service" --type auto --dep Tcpip --shutdown -e"SNMPCONFPATH=C:/cygwin/usr/local/share/snmp"

I compiled Net-SNMP from scratch on Cygwin since the on Win32 didn't work the way I wanted it and on Cygwin failed to compile for me. I assume your Cygwin installation is in C:\cygwin (change that \ to / to stop Cygwin/bash from escaping it). The SNMPCONFPATH is the path to snmp.conf. The SNMPCONFPATH turned out to be uberimportant! /usr/local/share/snmp/snmp.conf contains something like

persistentDir /var/net-snmp
mibdirs /usr/local/share/snmp/mibs
mibs +BLAH

BLAH is where you put extra MIBs you want to load.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.