Michael Rapoport | 28 Oct 08:55 2014

snmpd with IPv6

Hello.

 

We are using snmpd for the IPv4 and now we add the IPv6 support.

I’ve configured and compiled the release net-snmp-5.7.1 with the following flags:

 

./configure --with-default-snmp-version=2 --with-logfile=$HOME/temp/snmp/snmpd.log --with-sys-location= --with-sys-contact= --with-persistent-directory=$HOME/snmp --with-mibs=RFC1213-MIB --with-mibdirs= --disable-scripts --with-out-mib-modules=examples/ucdDemoPublic,mibII/system_mib --without-kmem-usage --disable-mibs --disable-mib-loading --disable-manuals --without-perl-modules --enable-shared --host=mips64-angstrom-linux --with-cc=mips64-angstrom-linux-gcc --target=mips64-angstrom-linux --disable-embedded-perl --with-ar=mips64-angstrom-linux-ar --with-mib-modules="ucd-snmp/dlmod" --enable-ipv6 --with-transports="UDP UDPIPv6"

 

But when I try to run the snmd in the simplest way:

 

snmpd -V -Lo udp6:[2003::100:18]:161

 

the address is available:

 

asil8xx:/usr/bin # ifconfig

eth3      Link encap:Ethernet  HWaddr 00:A0:0A:17:3B:C4

          inet addr:192.168.14.30  Bcast:192.168.15.255  Mask:255.255.248.0

          inet6 addr: fe80::2a0:aff:fe17:3bc4/64 Scope:Link

          inet6 addr: 2003::100:18/64 Scope:Global

         

 

 

I receive:

 

Error opening specified endpoint "udp6:[2003::100:18]:161"

Server Exiting with code 1

 

If I try to run snmpd w/o address:

 

asil8xx:/usr/bin # snmpd -V -q -Lo udp6:161

 

Warning: no access control information configured.

  (Config search path: /usr/local/etc/snmp:/usr/local/share/snmp:/usr/local/lib/snmp:/root/.snmp)

  It's unlikely this agent can serve any useful purpose in this state.

  Run "snmpconf -g basic_setup" to help you configure the snmpd.conf file for this agent.

 

getaddrinfo: udp6 Temporary failure in name resolution

Error opening specified endpoint "udp6:161"

Server Exiting with code 1

asil8xx:/usr/bin #

 

My concern and my question is – what may be the problem with the IPv6 “specified endpoint” ?

 

When I provide the IPv4 address to the same strings – it runs.

 

Thank you,

Sincerely,

Michael.

 

------------------------------------------------------------------------------
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Vipul Mehta | 27 Oct 11:54 2014
Picon

snmpset failes with Reason: notWritable (That object does not support modification) ...Even with rwcommunity permissions

Hello,
Need some help related to snmpset command.

I am trying to use netsnmp agent for publishing Statistics of my
application on SNMP.

My application will call snmpset to push the statistics in snmpd and
the monitoring tool will pull statistics from snmpd.

Problem is :: that snmp set fails with below error

snmpset -v 2c -c writer 127.0.0.1 .1.3.6.1.4.1.99987.100 i 10

Error in packet.
Reason: notWritable (That object does not support modification)
Failed object: SNMPv2-SMI::enterprises.99987.100

Also when i fire snmpget

snmpget -v 2c -c writer 127.0.0.1 .1.3.6.1.4.1.99987.100
SNMPv2-SMI::enterprises.99987.100 = No Such Object available on this
agent at this OID

+++++++++++++++++++++
My snmpd.conf file :::

rwcommunity writer
rwcommunity public
rwcommunity private 127.0.0.1

++++++++++++++++

snmpd process is running

snmp     38888     1  0 15:58 ?        00:00:01 /usr/sbin/snmpd -LE 7
-Lsd -Lf /tmp/snmpdd.log -u snmp -g snmp -I -smux mteTrigger
mteTriggerConf -p /var/run/snmpd.pid

+++++++++++++++++++++++++

MIB file

SAMPLE-MIB DEFINITIONS ::= BEGIN

IMPORTS
        enterprises, IpAddress
                FROM RFC1155-SMI
        DisplayString
                FROM RFC1213-MIB
        OBJECT-TYPE
                FROM RFC-1212;

notifAppStats OBJECT IDENTIFIER ::= { enterprises 99987 }

        tempObjj OBJECT-TYPE
                SYNTAX INTEGER
                MAX-ACCESS  read-write
                STATUS  mandatory
                DESCRIPTION
                        "for testing."

                ::= { notifAppStats 100 }

END
++++++++++++++++++

------------------------------------------------------------------------------
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

ganeshyellapu | 25 Oct 09:09 2014
Picon

Printing DESCRIPTION of OID

Hi,

I am using net-snmp.5.7.2 on windows 7.

I tried to print oid description inside the funtion which is defined in mib.c:

static void print_subtree_oid_report(FILE * f, struct tree *tree, int count)
{
struct tree *tp;
....

if (print_subtree_oid_report_suffix) { //here i printed }

......
}

When i tried to print the address of description variable i.e. tp->description,
it is prining zero.

How could i get the description of a given oid?

Looking forward to the valuable answer.

regards,
Ganesh Y


Every Sheets of paper is made from a tree.. Save trees... Conserve Trees.... Go Green .... Don't print this email or any Files unless you really need to!!!!
Confidentiality Notice
The information contained in this electronic message and any attachments to this
message are intended for the exclusive use of the addressee(s) and may contain
confidential or privileged information. If you are not the intended recipient,
please notify the sender at Bharat Electronics or support <at> bel.co.in
immediately and destroy all copies of this message and any attachments.
------------------------------------------------------------------------------
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Brad Baker | 24 Oct 20:00 2014
Picon

SNMP Timeout: No Response from 127.0.0.1

I recently cloned a centos 6.5 virtual machine from one location to
another. In the process, the IP and netmask of the system changed. For
awhile after the clone everything seemed to work fine, and then
suddenly SNMP monitoring stopped working.

I restarted the snmp service - the restart succeeded but snmpwalks and
remote snmp monitoring still didn't work. I rebooted my VM and
everything resumed working, until a few hours later when SNMP stopped
again.

Rebooting helps for awhile, but then snmpwalks take longer and longer
until they simply don't complete at all.

Here's my /etc/snmp/snmpd.conf file:

       rocommunity supersecret
       syslocation  "Our Location"
       syscontact  admin <at> ourdomain.com
       disk / 10%               # list / (root) disk
       #includeAllDisks   10%   # list all disks
       master agentx

I've tried:

- Turning off iptables
- Disabling selinux
- Uninstalling and Re-installing VMware tools
- Uninstalling and Re-installing the NIC
- Doing the SNMPWALK with 127.0.0.1 as well as the internal DNS name,
and internal IP
- Removing masterx

If I stop the snmpd service and instead start it from the cli as:
/usr/sbin/snmpd -f -Lo -C --rwcommunity=supersecret --master=agentx

snmpwalks work just fine

If I start the service back up - failures. So clearly something about
snmpd starting as a service vs interactively is the key but I'm at a
loss as to what that might be.

Can anyone provide any suggestions or ideas for what else I might check?

Thanks
Brad

Additional Details:

- I'm using net-snmp version 5.5 (from the default centos repository).

- I can also ping my gateway, other devices, and other devices can
ping me so this doesn't appear to be a network connectivity issue.

0 netstat -anp shows the snmpd running and listening:

    udp   126408      0 0.0.0.0:161                 0.0.0.0:*
 22958/snmpd
    unix  2      [ ]         STREAM     CONNECTED     2937161
22958/snmpd  /var/agentx/master

------------------------------------------------------------------------------
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Mohd Azamhar Mohd Tawil | 24 Oct 06:41 2014
Picon

GetBulk with Pass-persist

Hi,

Currently I am successfully use python and php with pass_persist to handle get and getnext. The problem occurs went I try using getbulk to my pass_persist script. I dont receive any reply from pass_persist.  

I need to deal with getbulk request. Can anybody give suggestion to me. Thanks

--
Mohd Azamhar Bin Muhamad Tawil

V.Net Computer Services Sdn Bhd
M: +60 13 300 1013 | T: 1700 81 4222  | F: +6 03 8912 7000  | www.vn.my
TG1-07, UPM-MTDC Technology Centre, Universiti Putra Malaysia, 43400, Serdang, Selangor. Malaysia.
 
------------------------------------------------------------------------------
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Vesa Jääskeläinen | 22 Oct 17:00 2014
Picon

Changing community names on the fly

Hi,

I need to implement feature that allows on the fly modification to
community names.

I have been using "dlmod" feature to load my own extension plugin to
snmpd process and do every other custom OID and necessarily operation
from there.

vacm_parse_rocommunity and vacm_parse_rwcommunity (eventually
vacm_create_simple) seems to be callbacks for configuration file
parser that eventually adds the community names and other
configurations for those into the system.

These are not callable from extension plugin. Also there is no
matching remove/clear operations even if I would export those.

Next thing would of course be to use the real operations behind this
to manage the entries.

Problem becomes from fact that I would need to use:
vacm_gen_com2sec, netsnmp_udp_parse_security, netsnmp_udp6_parse_security

vacm_gen_com2sec is local static function. Functionality in here could
be broken to pieces so that can be handled by splitting to calling of
netsmp_udp/udp6_parser_security and vacm_createGroupEntry.

Those all would be exportable so I could call them. Then next step
would be removing entries so that new entries could replace them. This
functionality is not exported (and there is only
netsnmp_udp_com2SecList_free).

In theory I could go and modify the net-snmp that we use but calling
those functions does not sound clean solution for the management of
the community names.

So I would like to get advice what should be modified (preferably so
that we can upstream the change) to enable community name management.

Also community names do not have get-list feature like other items in vacm has.

Thanks,
Vesa Jääskeläinen

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Krzysztof Szarlej | 21 Oct 17:51 2014
Picon

snmpget timeout when being run from a script

Hi all!

I have a strange problem. I want to monitor my Synology NAS Device. I created in snmpd.conf an exec statement for my sample script that has to run one snmpget and multiply the result by 4 to give me the correct value:

exec synology_disk_usage /opt/bin/bash /usr/bin/diskusage.sh

And the script looks like

- -
#!/opt/bin/bash

value=`snmpget -v 1 -c public localhost HOST-RESOURCES-MIB::hrStorageSize.33 -O Qve`
echo "$value * 4" | bc
- -

When I run it just from the shell then everything looks good:

- -
bash-3.2# /usr/bin/diskusage.sh
956787604
- -

But when I make an snmpwalk then the OID that should take the value out of the script gets snmp timeout:

- -
bash-3.2# snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.8.1
iso.3.6.1.4.1.2021.8.1.1.1 = INTEGER: 1
iso.3.6.1.4.1.2021.8.1.2.1 = STRING: "synology_disk_usage"
iso.3.6.1.4.1.2021.8.1.3.1 = STRING: "/opt/bin/bash"
Timeout: No Response from localhost
- -

The problem must be related to the snmpget because when I comment the snmpget in script, and for example add line

value=123

then the snmpwalk show me correct value (123 multiplied by 4). Any ideas why this can occcur? I am fighting with it since yesterday and I have no idea why is that.

Regards,
Krzysztof!

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
timingsrc src | 21 Oct 15:02 2014
Picon

Fwd: Getting snmpv2c response for garbage community string.


---------- Forwarded message ----------
From: timingsrc src <timingsrc <at> gmail.com>
Date: Tue, Oct 21, 2014 at 6:32 PM
Subject: Getting snmpv2c response for garbage community string.
To: "net-snmp-coders <at> lists.sourceforge.net" <net-snmp-coders <at> lists.sourceforge.net>



Hello all,

I am facing a problem with authenticating snmpv2c requests. Agent is responding for all garbage community strings, which is not right.
In snmpd.conf file has below lines
rocommunity bangalore
rwcommunity wilson

But still am getting responses when i query with wrong community string
snmpwalk -v2c -c qazw localhost system  displays the system mib variables.

I am using net-snmp 5.7.2 version. I have private mib files loaded.Generated .c and .h files are of ucd-snmp style. SNMPV3 authentication works fine. Facing problem with SNMPV1 and V2c authentication.

Am not able find the root cause, can some one please help me where i went wrong or possibly what can be done to fix this problem.


Thanks,
Wilson



------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Matt Kappel | 21 Oct 06:53 2014
Picon

COUNTER64 C type?

Hello,

I'm trying to write an AgentX subagent and used mib2c to successfully have some Unsigned32 values (uint32_t in C) being reported properly.  I'm also trying to get COUNTER64 values reported, but it doesn't appear that uint64_t translates well.

Here's a snippet of my edited mib2c-generated code:

    case MODE_GET:

        snmp_set_var_typed_value(requests->requestvb, ASN_COUNTER64,

                                 (u_char *)&my_64_bit_unsigned_val, sizeof(uint64_t));


Any idea what I'm doing wrong.  Is there some other C int type I should be using for ASN_COUNTER64?


Thanks,

Matt

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Ali Azar | 21 Oct 02:35 2014
Picon

using Mib2c on an entire MIB, not individual MIB objects

I have a mib file which has many tables.

I have used mib2c to generate code for each of the tables separately in the following fashion

mib2c -c someconfigFile tablename1
mib2c -c someconfigFile tablename2
mib2c -c someconfigFile tablename3
... etc

I am not aware if there is a way that I could specify a mib name itself, and a particular configuration and that it would auto-generate code for ALL the tables. So my question is, is such a thing possible?






--
Ali Eshragi
MEng electrical & computer engineering
University of Waterloo
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Guenther.Lukas | 17 Oct 13:48 2014

Build error, crypto library linking problem?

Hi!
 
I want to use NET-SNMP for setting up SNMP access eith DTLS. Since several days I’m trying to compile NET-SNMP. It seemed to be so easy following the manuals…
 
Following options where (last) used for configuring…
 
sudo ./configure --with-security-modules=tsm --with-transports=DTLSUDP --with-default-snmp-version="3" --with-sys-contact=" <at> <at> no.where" --with-sys-location="Unknown" --with-logfile="/var/log/snmpd.log" --with-persistent-directory="/var/net-snmp" --with-openssl="/usr/local/ssl/bin" --disable-snmpv1 --disable-snmpv2c
 
which lead to…
 
---------------------------------------------------------
            Net-SNMP configuration summary:
---------------------------------------------------------
 
  SNMP Versions Supported:    3
  Building for:               linux
  Net-SNMP Version:           5.7.2
  Network transport support:  Callback Unix Alias TCP UDP DTLSUDP IPv4Base SocketBase TCPBase UDPIPv4Base UDPBase TLSBase
  SNMPv3 Security Modules:     tsm usm
  Agent MIB code:             default_modules =>  snmpv3mibs mibII ucd_snmp notification notification-log-mib target agent_mibs agentx disman/event disman/schedule utilities host
  MYSQL Trap Logging:         unavailable
  Embedded Perl support:      enabled
  SNMP Perl modules:          building -- embeddable
  SNMP Python modules:        disabled
  Crypto support from:        crypto
  Authentication support:     MD5 SHA1
  Encryption support:         DES AES
  Local DNSSEC validation:    disabled
 
---------------------------------------------------------
 
 
During the build some errors appear which might be dependant to the crypto library…
 
libtool: compile:  gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib -fno-strict-aliasing -g -O2 -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.18/CORE -c snmpd.c -o snmpd.o >/dev/null 2>&1
/bin/bash ../libtool  --mode=link gcc -fno-strict-aliasing -g -O2 -Ulinux -Dlinux=linux  -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/lib/perl/5.18/CORE   -o snmpd snmpd.lo   libnetsnmpagent.la libnetsnmpmibs.la ../snmplib/libnetsnmp.la -lm  -Wl,-E
libtool: link: gcc -fno-strict-aliasing -g -O2 -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.18/CORE -o .libs/snmpd .libs/snmpd.o -Wl,-E  ./.libs/libnetsnmpagent.so -L/usr/local/lib -L/usr/lib/perl/5.18/CORE ./.libs/libnetsnmpmibs.so /home/update/net-snmp-5.7.2~dfsg/agent/.libs/libnetsnmpagent.so /home/update/net-snmp-5.7.2~dfsg/snmplib/.libs/libnetsnmp.so -lperl -ldl -lpthread -lc -lcrypt ../snmplib/.libs/libnetsnmp.so -lssl -lcrypto -lm
./.libs/libnetsnmpagent.so: undefined reference to `netsnmp_unix_parse_security'
./.libs/libnetsnmpagent.so: undefined reference to `netsnmp_udp_parse_security'
./.libs/libnetsnmpagent.so: undefined reference to `netsnmp_udp_getSecName'
./.libs/libnetsnmpagent.so: undefined reference to `netsnmp_unix_getSecName'
collect2: error: ld returned 1 exit status
make[1]: *** [snmpd] Error 1
make[1]: Leaving directory `/home/update/net-snmp-5.7.2~dfsg/agent'
make: *** [subdirs] Error 1
 
How can this be resolved?
 
OS: Ubuntu 14.04 (tried on version: 64 bit server, 32 bit server, 32 bit desktop)
 
Regards,
Guenther
 
 
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Gmane