Berkeley CSUA MOTD:Entry 15942
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2024/12/24 [General] UID:1000 Activity:popular
12/24   

1999/6/10-12 [Computer/SW/Languages/Perl] UID:15942 Activity:moderate
6/10    Pretend I'm four years old.  I just want to setup a script to send
        an SNMP message (or PDU or whatever it's called) to a machine every
        X minutes.  It could be a fake message that's dropped.  I just want
        the sockets opened and closed to simulate a real-world setup.  I have
        root access.  What's the simplest way to do this without having to
        re-invent the wheel?  My machine is running Solaris 2.6 .
        \_ Go to your room.
        \_ There's snmp perl code.  Try cpan.  I've read snmp values but never
           tried traps or setting values or anything like that.
           \_ even easier is the ucd-snmp package, grab it compile it, and
       you can do snmp gets sets and whatever with simple command lines. -ERic
        \_ FYI, here's how I did it:
                #! /usr/local/bin/scotty2.1.5

                set s [snmp session -address mymachinename]
                set result [$s get "sysDescr.0 sysName.0 sysContact.0"]
                puts $result
                after 15000
                $s destroy