Hi... :)
I have some questions about the snmp server
I have an access point that runs snmp server ... I
send to the access point as much traffic as it can
support..
I have noticed that the IpInDiscards, IpOutDiscards
dont increment (using snmpget command)
After some time poking around i have noticed that the 
oid
.1.3.6.1.2.1.2.2.1.13.1  (IfInDiscars) increment as
the time pass. So i have thought that the packets are
discarded to the ethernet level so no ip packets will
be discarded... Is this statement correct? Does this
statement have any rational basis? 
A.h In this point let me ask if the oid
.1.3.6.1.2.1.2.2.1.13.1 
.1.3.6.1.2.1.2.2.1.13.2
.1.3.6.1.2.1.2.2.1.13.3
and so on are for the specific ethernet interfaces...

Now after having the correct oid (i think so)
I have tried to put it in my c code
 but they return different values
snmpget -v1 -c public 143.233.227.67
.1.3.6.1.2.1.2.2.1.13.1
returns 
IF-MIB::ifInDiscards.1 = Counter32: 35550

and my program returns
Counter32:0

Before giving my c code i would like to say that i
have used ethereal for capturing the request from
snmpget and from my c code.. I have noticed after
looking in depth in the snmp protocol that they
request the same oid the same PDU TYPE:GET(0)
The only difference i have found is that they have
different request id.. I dont think i can do sth more
than that... So i would like to shed some light on my
task :)
Dave this time i will be patient enough :)

I give u the c code


oid myoid[] = { 1, 3, 6, 1, 2, 1, 2, 2, 1, 13, 1 };
size_t length_myoid = sizeof(myoid) / sizeof(oid);

long snmp_fetch_oid_value(char *hostname,oid
*oidvalue,size_t length_myoid){
  /*skipped a bunch of declaration lines */
    init_snmp("APC Check");  
    snmp_sess_init( &session );
    session.version = SNMP_VERSION_1;
    session.community = "public";
    session.community_len = strlen(session.community);
    session.peername = hostname;
    sess_handle = snmp_open(&session);
    pdu = snmp_pdu_create(SNMP_MSG_GET);
    /* Add variable to the snmp packet */
    snmp_add_null_var(pdu, oidvalue,length_myoid);
    status = snmp_synch_response(sess_handle, pdu,
&response);


    if (status == STAT_SUCCESS){
        if (response->errstat == SNMP_ERR_NOERROR){
            for(vars = response->variables; vars; vars
= vars->next_variable) {
                local_dropped= *vars->val.integer;
                print_value(vars->name,
vars->name_length, vars);
                //printf("snmp_fetch_oid_value To
intvalue einai %ld \n", dropped);
            }
        }
    }
    snmp_free_pdu(response);
    snmp_close(sess_handle);
    return (local_dropped);








                
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to