From: Chun Tian
Subject: [ANN] cl-net-snmp 0.01 released
Date: 
Message-ID: <1175276261.827428.36170@d57g2000hsg.googlegroups.com>
Hi, all

I'm a Chinese Lisper, a Linux system administrator of NetEase.com,
Inc. I made a Net-SNMP OO interface for Common Lisp based on CLOS,
CFFI, and ASDF. This package is to be used for managing my servers.

This project home page is on http://common-lisp.net/project/cl-net-snmp

Suggestions or patches are welcome.

Chun Tian (binghe)

Release 0.01, download from

 http://common-lisp.net/project/cl-net-snmp/release/cl-net-snmp_0.01.tar.gz

Sample code:

CL-USER> (in-package :snmp)
#<PACKAGE "ORG.NET-SNMP">
NET-SNMP> (snmp-msg-get "binghe.people.163.org" "sysDescr.0")
"Linux binghe.people.163.org 2.6.18-4-686 #1 SMP Wed Feb 21 16:06:54
UTC 2007 i686"
NET-SNMP> (snmp-msg-get "binghe.people.163.org" "laLoad.1")
"0.00"
NET-SNMP> (defvar binghe (make-instance 'snmp-session
                                        :peername "binghe.people.
163.org"
                                        :version +snmp-version-2c+
                                        :community "public"))
BINGHE
NET-SNMP> (snmp-msg-get binghe "sysDescr.0")
"Linux binghe.people.163.org 2.6.18-4-686 #1 SMP Wed Feb 21 16:06:54
UTC 2007 i686"
NET-SNMP> (defvar descr (make-instance 'oid :name "sysDescr.0"))
DESCR
NET-SNMP> (snmp-msg-get binghe descr)
"Linux binghe.people.163.org 2.6.18-4-686 #1 SMP Wed Feb 21 16:06:54
UTC 2007 i686"

From: Drew Crampsie
Subject: Re: [ANN] cl-net-snmp 0.01 released
Date: 
Message-ID: <87fy7mcxi6.fsf@osiris.tech.coop>
"Chun Tian" <···········@gmail.com> writes:

> Hi, all
>
> I'm a Chinese Lisper, a Linux system administrator of NetEase.com,
> Inc. I made a Net-SNMP OO interface for Common Lisp based on CLOS,
> CFFI, and ASDF. This package is to be used for managing my servers.
>
> This project home page is on http://common-lisp.net/project/cl-net-snmp
>
> Suggestions or patches are welcome.

Suggestion: Why not start from SYSMAN? 
(http://www.switch.ch/misc/leinen/snmp/sysman.html). 

Most Lispers i know much prefer pure lisp libraries over bindings, and
SYSMAN seems like a great start.

Cheers, 

drewc

>
> Chun Tian (binghe)
>
> Release 0.01, download from
>
>  http://common-lisp.net/project/cl-net-snmp/release/cl-net-snmp_0.01.tar.gz
>
> Sample code:
>
> CL-USER> (in-package :snmp)
> #<PACKAGE "ORG.NET-SNMP">
> NET-SNMP> (snmp-msg-get "binghe.people.163.org" "sysDescr.0")
> "Linux binghe.people.163.org 2.6.18-4-686 #1 SMP Wed Feb 21 16:06:54
> UTC 2007 i686"
> NET-SNMP> (snmp-msg-get "binghe.people.163.org" "laLoad.1")
> "0.00"
> NET-SNMP> (defvar binghe (make-instance 'snmp-session
>                                         :peername "binghe.people.
> 163.org"
>                                         :version +snmp-version-2c+
>                                         :community "public"))
> BINGHE
> NET-SNMP> (snmp-msg-get binghe "sysDescr.0")
> "Linux binghe.people.163.org 2.6.18-4-686 #1 SMP Wed Feb 21 16:06:54
> UTC 2007 i686"
> NET-SNMP> (defvar descr (make-instance 'oid :name "sysDescr.0"))
> DESCR
> NET-SNMP> (snmp-msg-get binghe descr)
> "Linux binghe.people.163.org 2.6.18-4-686 #1 SMP Wed Feb 21 16:06:54
> UTC 2007 i686"

-- 
Posted via a free Usenet account from http://www.teranews.com
From: Chun Tian
Subject: Re: cl-net-snmp 0.01 released
Date: 
Message-ID: <1175300165.783843.176470@r56g2000hsd.googlegroups.com>
On Mar 31, 4:00 am, Drew Crampsie <····@tech.coop> wrote:
> "Chun Tian" <···········@gmail.com> writes:
> > Hi, all
>
> > I'm a Chinese Lisper, a Linux system administrator of NetEase.com,
> > Inc. I made a Net-SNMP OO interface for Common Lisp based on CLOS,
> > CFFI, and ASDF. This package is to be used for managing my servers.
>
> > This project home page is onhttp://common-lisp.net/project/cl-net-snmp
>
> > Suggestions or patches are welcome.
>
> Suggestion: Why not start from SYSMAN?
> (http://www.switch.ch/misc/leinen/snmp/sysman.html).
>
> Most Lispers i know much prefer pure lisp libraries over bindings, and
> SYSMAN seems like a great start.

Before starting this bindings, I've learnt SYSMAN for a long time.
SYSMAN cannot use ASN.1 format MIB file right now, if I want it, I
must use some thing like cl-yacc to parse ASN.1 myself. To implement
SNMPv3, I must use something like cl-ironclad. Further more, I cannot
find a good network library to base on, cl-trivial-sockets is too
simple, sb-bsd-sockets only for SBCL, simple-stream is great but only
full support on Allegro CL right now... let net-snmp C library to do
networking operation itself may be a good choice.

Another point, why should I spent much time on RE-implement SNMP
protocol? (which the Net-SNMP project has do this for almost 20 years
and still lots of bugs) And I think a smart lisper should interface to
other language's work, not write them again.
From: drewc
Subject: Re: cl-net-snmp 0.01 released
Date: 
Message-ID: <87bqiacgz5.fsf@osiris.tech.coop>
"Chun Tian" <···········@gmail.com> writes:

> On Mar 31, 4:00 am, Drew Crampsie <····@tech.coop> wrote:
>> Suggestion: Why not start from SYSMAN?
>> (http://www.switch.ch/misc/leinen/snmp/sysman.html).
>>
>> Most Lispers i know much prefer pure lisp libraries over bindings, and
>> SYSMAN seems like a great start.
>
> Before starting this bindings, I've learnt SYSMAN for a long time.
> SYSMAN cannot use ASN.1 format MIB file right now, if I want it, I
> must use some thing like cl-yacc to parse ASN.1 myself. 

Ah ok, i didn't know that. I've never used SYSMAN myself, but the
documentation says "Because SNMP is based on ASN.1 (Abstract Syntax
Notation One), the library contains functions for constructing and
accessing ASN.1 objects, as well as encoding and decoding them using
BER (the Basic Encoding Rules).". I had assumed that was sufficient.

> To implement
> SNMPv3, I must use something like cl-ironclad. Further more, I cannot
> find a good network library to base on, cl-trivial-sockets is too
> simple, sb-bsd-sockets only for SBCL, simple-stream is great but only
> full support on Allegro CL right now... let net-snmp C library to do
> networking operation itself may be a good choice.

I think cl+ssl is widely used for Secure Sockets. The newer IOlib[1]
is supposed to be an excellent choice for portable BSD sockets using
CFFI.

> Another point, why should I spent much time on RE-implement SNMP
> protocol? (which the Net-SNMP project has do this for almost 20 years
> and still lots of bugs) 

Well, because the existing implementations are 20 years old, full of
bugs, and written in a low-level language that is no where near as
much fun to hack (and therefore bugfix) than Lisp. You answered your
own question here ;).

> And I think a smart lisper should interface to
> other language's work, not write them again.

Unless those other libraries have 'still lots of bugs'. There are
cases where a binding is a better idea than a native
implementation. You've obviously come the the conclusion that this is
one of them. I think otherwise, but that's just my $0.02. I'd
personally rather wrestle with bugs in _my_ implementation (in CL)
than someone elses (in C), but i'm weird like that :).

Really, i just wanted to know if you had good reason for not starting
with an existing lisp library. I suppose if the ASN.1 implementation
is not good enough for your needs, that's reason enough for me. 

drewc


[1] http://www.cliki.net/IOlib

-- 
Posted via a free Usenet account from http://www.teranews.com
From: Robert Uhl
Subject: Re: [ANN] cl-net-snmp 0.01 released
Date: 
Message-ID: <m38xd9f8ov.fsf@latakia.dyndns.org>
"Chun Tian" <···········@gmail.com> writes:
>
> I'm a Chinese Lisper, a Linux system administrator of NetEase.com,
> Inc. I made a Net-SNMP OO interface for Common Lisp based on CLOS,
> CFFI, and ASDF. This package is to be used for managing my servers.
>
> This project home page is on http://common-lisp.net/project/cl-net-snmp

Very cool!  I'll mention it to some of my network admin friends.

Maybe someone could roll up a CL version of mrtg...

-- 
Robert Uhl <http://public.xdi.org/=ruhl>
'The only meaningful numbers in computer science are zero, one, and infinity.'
'Though you can often get significant performance improvements by treating 2
as a special case of 1 rather than a special case of infinity.'
                            --Russ Allbery and Peter da Silva
From: Chun Tian
Subject: [ANN] cl-net-snmp 0.10 (SNMPv3 support added)
Date: 
Message-ID: <1176036392.751117.52710@o5g2000hsb.googlegroups.com>
Hi, all

I just take one afternoon to improve my code, now I got a basic SNMPv3
support (authNoPriv), example code here:

;;; SNMPv3 and GETs Example
(defun v3-test ()
  (let ((s (make-instance 'snmp:snmp-session
			  :peername "binghe.people.163.org"
			  :version snmp:+snmp-version-3+
			  :security-name "binghe"
			  :password "bBtB0bxs"
			  :security-auth-proto :hmac-sha1)))
    (snmp:snmp-msg-get-list s
			    '("sysDescr.0" "sysContact.0"))))
;; => ("Linux binghe.people.163.org 2.6.18-4-686 #1 SMP Wed Feb 21
16:06:54 UTC 2007 i686" "Chun Tian (binghe) <······@163.org>")

GET SOURCE for asdf loadable:

http://common-lisp.net/project/cl-net-snmp/release/cl-net-snmp_0.01.tar.gz

Test only on Debian i386, using SBCL, Allegro CL, and CLISP. Welcome
use or test or fix it.

Thanks.

Chun Tian (binghe)

On Apr 4, 5:29 am, Robert Uhl <·········@NOSPAMgmail.com> wrote:
> "Chun Tian" <···········@gmail.com> writes:
>
> > I'm a Chinese Lisper, a Linux system administrator of NetEase.com,
> > Inc. I made a Net-SNMP OO interface for Common Lisp based on CLOS,
> > CFFI, and ASDF. This package is to be used for managing my servers.
>
> > This project home page is onhttp://common-lisp.net/project/cl-net-snmp
>
> Very cool!  I'll mention it to some of my network admin friends.
>
> Maybe someone could roll up a CL version of mrtg...
>
> --
> Robert Uhl <http://public.xdi.org/=ruhl>
> 'The only meaningful numbers in computer science are zero, one, and infinity.'
> 'Though you can often get significant performance improvements by treating 2
> as a special case of 1 rather than a special case of infinity.'
>                             --Russ Allbery and Peter da Silva
From: Chun Tian
Subject: Re: cl-net-snmp 0.10 (SNMPv3 support added)
Date: 
Message-ID: <1176036572.375949.304510@n76g2000hsh.googlegroups.com>
On Apr 8, 8:46 pm, "Chun Tian" <···········@gmail.com> wrote:
> Hi, all
>
> I just take one afternoon to improve my code, now I got a basic SNMPv3
> support (authNoPriv), example code here:
>
> ;;; SNMPv3 and GETs Example
> (defun v3-test ()
>   (let ((s (make-instance 'snmp:snmp-session
>                           :peername "binghe.people.163.org"
>                           :version snmp:+snmp-version-3+
>                           :security-name "binghe"
>                           :password "bBtB0bxs"
>                           :security-auth-proto :hmac-sha1)))
>     (snmp:snmp-msg-get-list s
>                             '("sysDescr.0" "sysContact.0"))))
> ;; => ("Linux binghe.people.163.org 2.6.18-4-686 #1 SMP Wed Feb 21
> 16:06:54 UTC 2007 i686" "Chun Tian (binghe) <······@163.org>")
>
> GET SOURCE for asdf loadable:
>
> http://common-lisp.net/project/cl-net-snmp/release/cl-net-snmp_0.01.t...

URL correct:
  http://common-lisp.net/project/cl-net-snmp/release/cl-net-snmp_0.10.tar.gz

Sorry.