Evgeny Mugerman | 1 May 2011 08:27
Picon

Re: fail to access first row in the table

Thank you Dave, you were right.
I had the limitation for index value in it's "SYNTAX" line in my mib file.

      SYNTAX       Integer32 (1..2147483647)                       <------

When I changed it to start from zero - I got access to first line (index 0)
Thank you very much.

On Sat, Apr 30, 2011 at 2:31 PM, Dave Shield <D.T.Shield <at> liverpool.ac.uk> wrote:
2011/4/29 Boris Zweimüller <boris.zweimueller <at> gmail.com>:
> Integer Indices start always at 1 in snmp.

That's not strictly true.

The *convention* is for arbitrary integer indexes to start at 1,
but there's nothing inherent within SNMP that enforces this.
It is perfectly possible to have an integer index of 0,
if a particular MIB table is defined that way.



>>  MTYPE-MIB::mtypeTable.1.2.0: Unknown Object Identifier (Index out of range: 0 (Idx))

That error implies to me that the MIB definition for this particular
table probably includes a range of valid indexes (which does not
include 0).   But since this seems to be a private MIB, it's difficult
to verify this assumption.

Dave

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
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
Umesh Kumar L.R | 2 May 2011 13:31
Picon

Generating Trap for low disk space

Hi All,
I would like to know how to  generate Trap for Low Disk Space, I am using Fedora 8.
Please help me
 
 
Thanks and Regards
Umesh Kumar L R
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
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
Autuori Gianluigi | 2 May 2011 14:57
Picon
Favicon

help on win32 lib

Hello, I want to use netsnmp.lib in my C application under Win32 and MinGW.
I have done it under Linux and it works very well (using libnetsnmp.a).
I want to do a simple program written in c to get values of mibs of a switch.
Could somebody help me?
 
thanks
Gianluigi

Questo messaggio e-mail e ogni documento ad esso eventualmente allegato puo' avere carattere riservato ed essere tutelato da segreto. Esso,comunque, e'
ad esclusivo utilizzo del destinatario in indirizzo. Qualora non foste il destinatario del messaggio vi preghiamo di volerci avvertire immediatamente per e-mail o telefono e di cancellare il presente messaggio e ogni eventuale allegato dal vostro sistema. E' vietata la duplicazione o l'utilizzo per qualunque fine del messaggio e di ogni allegato, nonche' la loro divulgazione, distribuzione o inoltro a terzi senza l'espressa autorizzazione del mittente. In ragione del mezzo di trasmissione utilizzato, il mittente non assume alcuna responsabilita' sulla segretezza/riservatezza delle informazioni contenute nel messaggio e nei relativi allegati.

This e-mail and any file transmitted with it may contain material that is confidential, privileged and/or attorney work product for the sole use of the intended recipient. If you are not the intended recipient of this e-mail, please do not read it, notify us immediately by e-mail or by telephone and then delete this message and any file attached from your system. You should not copy or use it for any purpose, disclose the contents of the same to any other person or forward it without express permission.
Considering the means of transmission, we do not undertake any liability with respect to the secrecy and confidentiality of the information contained in this e-mail and its attachments.

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
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
Chi.Guan | 2 May 2011 20:51
Favicon

can not make snmp perl

Hi,

I have got errors to make snmp perl.

make[1]: Entering directory `/work/snmp/net-snmp-5.5/perl'

make[1]: *** No rule to make target `/opt/lib/perl5/5.8.0/x86pc-nto/Config.pm', needed by `Makefile'.  Stop.

make[1]: Leaving directory `/work/snmp/net-snmp-5.5/perl'

the perl5 in my system is actually in /usr/pkg/lib/perl5

In the Makefile, I do see the following line

CFLAGS          = -g -O2 -Unto -Dnto=nto  -U__STRICT_ANSI__ -fno-strict-aliasing -pipe  -I/usr/pkg/lib/perl5/5.12.0/x86pc-nto/CORE

Any suggestions?

Thanks

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
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
Chi.Guan | 3 May 2011 00:12
Favicon

Can not create template file by mib2c

I finally got snmp perl installed by changing a bunch of Makefiles.

But when I use mib2c to create template files from a MIB file, I got the following error:

#env MIBS="+RTIRIDIUM-MIB" mib2c -c mib2c.scalar.conf iridium

writing to iridium.h

writing to iridium.c

running indent on iridium.c

indent: Command line: unknown parameter "-orig"

running indent on iridium.h

indent: Command line: unknown parameter "-orig"

No OID file was create in irdium.c except

void init_iridium(void)

{

  DEBUGMSGTL(("iridium", "Initializing\n"));

}

What went worng?

Thanks.

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
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
liuying | 3 May 2011 02:27
Favicon

problem about sending V2 trap

Dear:

    I have a problem about sending V2 trap.

 

When I use "snmp.c, snmp.so" to send trap,I can recerive it sucessfully.


    But when I use:

 

   $ gcc main.c -L -lsnmp …… -I ./include -o main

 

    In the main.c,Iuse: 

       write_exampletrap2(COMMIT,NULL,0,0,NULL,NULL,0)

   to send trap.

 

In my snmp.c, I use:

 

 var_trap.next_variable = &var_str;      /* next variable */
       var_trap.name = objid_snmptrap; /* snmpTrapOID.0 */
       var_trap.name_length = sizeof(objid_snmptrap) / sizeof(oid);    /* number of sub-ids */
       var_trap.type = ASN_OBJECT_ID;
       var_trap.val.objid = demo_trap; /* demo-trap objid */
       var_trap.val_len = sizeof(demo_trap);   /* length in bytes (not number of subids!) */
     
        /*
         * additional objects
         */      
        var_str.next_variable = &var_pon;   /* next variable*/
        var_str.type = ASN_INTEGER;   /* type of variable */
        var_str.val.integer = &var_default.traptype;      /* value */
        var_str.val_len = sizeof(var_default.traptype);

        var_pon.next_variable = &var_onu;   /* next variable */
        var_pon.name = var_default.pon_oid;
        var_pon.name_length = sizeof(var_default.pon_oid)/ sizeof(oid); /* number of sub-ids */
        var_pon.type = ASN_OCTET_STR;   /* type of variable */
        var_pon.val.string = "PONoid";      /* value */
        var_pon.val_len = sizeof("PONoid");

        if(var_default.is485==1)
            {
              var_onu.next_variable = &var_onu485; 
            }
        else
            {
            var_onu.next_variable = NULL;
             }
 
        var_onu.name = var_default.onu_oid;
        var_onu.name_length = sizeof(var_default.onu_oid)/ sizeof(oid); /* number of sub-ids */
        var_onu.type = ASN_OCTET_STR;   /* type of variable */
        var_onu.val.string = "ONUoid";       /* value */
        var_onu.val_len = sizeof("ONUoid");

        var_onu485.next_variable = NULL;   /* No more variables after this one */
        var_onu485.name = var_default.onu485_oid;
        var_onu485.name_length = sizeof(var_default.onu485_oid) / sizeof(oid);/* number of sub-ids */
        var_onu485.type = ASN_OCTET_STR;   /* type of variable */
        var_onu485.val.string = "ONU485oid";       /* value */
        var_onu485.val_len = sizeof("ONU485oid");
       

        DEBUGMSGTL(("example", "write_exampletrap2 sending the v2 trap\n"));
        send_v2trap(&var_trap);
        DEBUGMSGTL(("example", "write_exampletrap2 v2 trap sent\n"));

 

 

There are some errors. It returns:


   $ No log handling enabled - turning on stderr logging

    send_trap: no v2 trapOID varbind provided

 

 

  What can I do to solve the problem?

 

   Looking forward for your help!Thanks!

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
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
liuying | 3 May 2011 08:12
Favicon

How to trigger the sending of a v2 trap


Dear:

    I have a problem about how to trigger the sending of a  V2 trap

 

 In the program,Iuse: 

 

$snmpset -v2c -c private localhost snmptrap.0 i 1

 

Then,it can send a trap to the destination ip.

 

 Or I test like this,  In the var_snmp: 

 

   case OLTFIRMWAREVER:
        *var_len = sizeof(oltfirmwareVer);
         write_exampletrap2(COMMIT,NULL,0,0,NULL,NULL,0);    //test  sending  trap
        return (u_char *) oltfirmwareVer; 
    case CHIPNEWERFIRMWAREVER:
        *var_len = sizeof(g_olt_dev.chipNewerFirmwareVer_tmp);
        return (u_char *) g_olt_dev.chipNewerFirmwareVer_tmp;
       

      When I use the snmpget commond :snmpget -v2c -c private localhost oltfirmwareVer.0

      It can also send a v2 trap.

 

 But all these are not what I need.I want to send a trap when the trapflag=1.

 

I use this in my main funcation :

 

if(trapflag==1)

{

    write_exampletrap2(COMMIT,NULL,0,0,NULL,NULL,0);   

}

 

There are some errors. It returns:


   $ No log handling enabled - turning on stderr logging

    send_trap: no v2 trapOID varbind provided

 

 

  What can I do to solve the problem?

 

   Looking forward for your help!Thanks!




===================================================

刘盈
中国电力科学研究院 通信与用电技术分公司 通信业务部
电话:010-62937070-657
传真:010-62937070-662
地址:北京市海淀区西小口路东升科技园北领地D-3座215室
邮编:100192

===================================================

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
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
Dave Shield | 3 May 2011 09:25
Picon
Favicon

Re: problem about sending V2 trap

On 3 May 2011 01:27, liuying <liuying <at> sgchip.com> wrote:
>     In the main.c,Iuse:
>
>        write_exampletrap2(COMMIT,NULL,0,0,NULL,NULL,0)
>
>    to send trap.

And what is the (full) code of this routine?
What is the MIB definition of the trap that you are trying to send?

Dave

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
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

liuying | 3 May 2011 09:34
Favicon

Re: Re: problem about sending V2 trap

>And what is the (full) code of this routine?
int
write_exampletrap2(int action,
                   u_char * var_val,
                   u_char var_val_type,
                   size_t var_val_len,
                   u_char * statP,oid * name, size_t name_len)
{
    long            intval;
    oid             objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };     /* snmpTrapOID.0 */
    oid             demo_trap[] = { 1, 3, 6, 1, 4, 1, 43571, 6,2,0 };  /*demo-trap */

    oid             pon_oid[]={ 1, 3, 6, 1, 4, 1, 43571, 2, 1,1,4};
    oid             onu_oid[]={1,3,6,1,4,1,43571,3,2,1,1,34};
    oid             onu485_oid[]={1,3,6,1,4,1,43571,3,4,1,1,134};

    printdebug(pon_oid,sizeof(pon_oid) / sizeof(oid));  

    static netsnmp_variable_list var_trap;
    static netsnmp_variable_list var_str;
    static netsnmp_variable_list var_pon;
    static netsnmp_variable_list var_onu;
    static netsnmp_variable_list var_onu485;
    static sendtrap_list var_default;

    DEBUGMSGTL(("example", "write_exampletrap2 entered: action=%d\n",action));
    switch (action) {
    case RESERVE1:
        /*
         *  The only acceptable value is the integer 1
         */
        if (var_val_type != ASN_INTEGER) {
            DEBUGMSGTL(("example", "%x not integer type", var_val_type));
            return SNMP_ERR_WRONGTYPE;
        }
        if (var_val_len > sizeof(long)) {
            DEBUGMSGTL(("example", "wrong length %x", var_val_len));
            return SNMP_ERR_WRONGLENGTH;
        }

        intval = *((long *) var_val);
        if (intval != 1) {
            DEBUGMSGTL(("example", "wrong value %x", intval));
            return SNMP_ERR_WRONGVALUE;
        }
        break;

    case RESERVE2:
        /*
         * No resources are required.... 
         */
        break;

    case FREE:
        /*
         * ... so no resources need be freed 
         */
        break;

    case ACTION:
        /*
         *  Having triggered the sending of a trap,
         *   it would be impossible to revoke this,
         *   so we can't actually invoke the action here.
         */
        break;

    case UNDO:
        /*
         * We haven't done anything yet,
         * so there's nothing to undo 
         */
        break;

    case COMMIT:
              strcpy(var_default.trap_str,"onureg");
       var_default.trap_str_len = sizeof(var_default.trap_str);   
     //  memset(var_default.sgcc_trap_oid,0,sizeof(var_default.sgcc_trap_oid));
       memcpy(var_default.pon_oid,pon_oid,sizeof(pon_oid));
       memcpy(var_default.onu_oid,onu_oid,sizeof(onu_oid));
       memcpy(var_default.onu485_oid,onu485_oid,sizeof(onu485_oid));
       var_default.pon_oid_len = sizeof(var_default.pon_oid);
       var_default.onu_oid_len = sizeof(var_default.onu_oid);
       var_default.onu485_oid_len = sizeof(var_default.onu485_oid);
       var_default.is485 = 1;
       var_default.traptype = 8;

      printf("in  var objects\n");  

       var_trap.next_variable = &var_str;      /* next variable */
       var_trap.name = objid_snmptrap; /* snmpTrapOID.0 */
       var_trap.name_length = sizeof(objid_snmptrap) / sizeof(oid);    /* number of sub-ids */
       var_trap.type = ASN_OBJECT_ID;
       var_trap.val.objid = demo_trap; /* demo-trap objid */
       var_trap.val_len = sizeof(demo_trap);   /* length in bytes (not number of subids!) */

        /*
         * additional objects 
         */       
        var_str.next_variable = &var_pon;   /* next variable*/
        var_str.type = ASN_INTEGER;   /* type of variable */
        var_str.val.integer = &var_default.traptype;      /* value */
        var_str.val_len = sizeof(var_default.traptype);

        var_pon.next_variable = &var_onu;   /* next variable */
        var_pon.name = var_default.pon_oid;
        var_pon.name_length = sizeof(var_default.pon_oid)/ sizeof(oid); /* number of sub-ids */
        var_pon.type = ASN_OCTET_STR;   /* type of variable */
        var_pon.val.string = "PONoid";      /* value */
        var_pon.val_len = sizeof("PONoid");

        if(var_default.is485==1)
            {
              var_onu.next_variable = &var_onu485;  
            }
        else
            {
            var_onu.next_variable = NULL;
             }

        var_onu.name = var_default.onu_oid;
        var_onu.name_length = sizeof(var_default.onu_oid)/ sizeof(oid); /* number of sub-ids */
        var_onu.type = ASN_OCTET_STR;   /* type of variable */
        var_onu.val.string = "ONUoid";       /* value */
        var_onu.val_len = sizeof("ONUoid");

        var_onu485.next_variable = NULL;   /* No more variables after this one */
        var_onu485.name = var_default.onu485_oid;
        var_onu485.name_length = sizeof(var_default.onu485_oid) / sizeof(oid);/* number of sub-ids */
        var_onu485.type = ASN_OCTET_STR;   /* type of variable */
        var_onu485.val.string = "ONU485oid";       /* value */
        var_onu485.val_len = sizeof("ONU485oid");

        DEBUGMSGTL(("example", "write_exampletrap2 sending the v2 trap\n"));
        send_v2trap(&var_trap);
        DEBUGMSGTL(("example", "write_exampletrap2 v2 trap sent\n"));

        break;

    }
    return SNMP_ERR_NOERROR;
}

>What is the MIB definition of the trap that you are trying to send?
>

-- 1.3.6.1.4.1.43571.6
		trapall OBJECT IDENTIFIER ::= { sgcc 6 }
		
--    1.3.6.1.4.1.43571.6.1
		trigger OBJECT-TYPE
			SYNTAX Integer32
			MAX-ACCESS read-write
			STATUS current
			DESCRIPTION
				"Description."
			::= { trapall 1 }

-- 1.3.6.1.4.1.43571.6.2
		onutrap NOTIFICATION-TYPE
			OBJECTS { trigger }
			STATUS current
			DESCRIPTION 
				"Description."
			::= { trapall 2 }

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
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

Bart Van Assche | 3 May 2011 12:40
Picon
Favicon

Re: Re: Net-snmp in Windows: SNMPV3 Encryption Support Not Enabled

2011/5/3 chengkeke <chengkeke <at> 163.com>
At 2011-04-26 00:25:02,"Bart Van Assche" <bvanassche <at> acm.org> wrote:
2011/4/25 chengkeke <chengkeke <at> 163.com>
I met a issue with net-snmp in windows. It is a little urgency. Could anybody help me with this issue?

OS version: Windows XP Professional 2002 SP3

Install steps:
1. Install VC++2008.
2. Install OpenSSL.
Refer to http://www.slproweb.com/products/Win32OpenSSL.html
3. Install net-snmp, check 'with windows extension dll support' and 'encryption support' checkbox.
4. Execute snmp commands.
V1, V2 commands can works well.
V3 commands, can work well with authNoPriv. If use -authPriv, error is displayed:
Encryption support not enabled.
snmpget: USM encryption error

The snmp command with authPriv works well in one of computers which is also same os version and same steps to install the softwares.

Which OpenSSL version have you installed ?

I installed 1.0 before.

After installed openSSL 0.9.8. it works.

(CC-ed net-snmp-users)

Thanks for the feedback. A note about this was added some time ago on http://www.net-snmp.org/download.html:

IMPORTANT NOTE FOR WINDOWS USERS: the Net-SNMP 5.5 Windows binaries have been built with OpenSSL version 0.9. Since the OpenSSL 0.9 and 1.0 DLLs are incompatible, any attempt to run Net-SNMP on a system where OpenSSL 1.0 has been installed will make Net-SNMP crash.

Regards,

Bart.
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
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