cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl/libcurl SNMP protocol support

From: Sergei Nikulov <sergey.nikulov_at_gmail.com>
Date: Wed, 10 Aug 2016 19:07:26 +0300

2016-08-10 18:45 GMT+03:00 Gisle Vanem via curl-library
<curl-library_at_cool.haxx.se>:
> Sergei Nikulov wrote:
>
>> curl will dump object pointed by url snmp://example.com/common/1.3.6.1.2.1.1.3.0
>> It's not just another protocol :)
>
> I once did something like this. But only for Windows-SNMP.
> Not very useful with libcurl either (mostly for the trace).
> But here it is:
> https://gist.github.com/gvanem/6c7b43fc694f0e26e3e56e99714888c7
>
> And here 'snmpmgr.exe -v snmp://router/1.3.6.1.2.1.1.1.0' gives:
> ...
> * STATE: CONNECT => WAITRESOLVE handle 0x3903ec0; line 1433 (connection #0)
> * Trying 10.0.0.1...
> * Could not set TCP_NODELAY: Invalid arguments << [1]
> * STATE: WAITRESOLVE => WAITCONNECT handle 0x3903ec0; line 1514 (connection #0)
> * Connected to router (10.0.0.1) port 161 (#0)
> * STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x3903ec0; line 1556 (connection #0)
> * Marked for [keep alive]: HTTP default
> * STATE: SENDPROTOCONNECT => DO handle 0x3903ec0; line 1574 (connection #0)
> * STATE: DO => DONE handle 0x3903ec0; line 1615 (connection #0)
> * multi_done
> * Connection #0 to host router left intact
> * Expire cleared
> String: Linux Snurre-Router 3.2.41-svn21039 #101 Mon Mar 25 10:30:36 CET 2013 mips
>

Great job!

It can be useful for querying devices from scripts as stated on curl's website.
I believe SET operation also can be added as well.

Wondering why LDAP is considering useful, but is SNMP is not?

Daniel,
What do you think?

> ----
>
> [1] Winsock doesn't allow this on a SOCK_DGRAM socket.
>
> --
> --gv
> -------------------------------------------------------------------
> List admin: https://cool.haxx.se/list/listinfo/curl-library
> Etiquette: https://curl.haxx.se/mail/etiquette.html

-- 
Best Regards,
Sergei Nikulov
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html
Received on 2016-08-10