snmpwalk and snmpget give different result for same object

"Kumar Sanjay-XJD784" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi All,

 

When I do the snmpwalk to "wsAceessBanner" I get the following result :

 

***** SNMP QUERY STARTED *****

1: wsAceessBanner(7).0 (OCTET STRING) This Device is running in Common
Criteria Mode. Attention: This is a protected and private wireless
system. No un-authorized access allowed.You must have proper rights to
access and manage this system from the authorized personnel.

***** SNMP QUERY FINISHED *****

 

 

When I do the snmpget  to "wsAceessBanner" I get the following result :

 

1: wsAceessBanner(7).0 (OCTET STRING)
54.68.69.73.20.44.65.76.69.63.65.20.69.73.20.72.75.6E.6E.69.6E.67.20.69.
6E.20.43.6F.6D.6D.6F.6E.20.43.72.69.74.65.72.69.61.20.4D.6F.64.65.2E.20.
41.74.74.65.6E.74.69.6F.6E.3A.20.54.68.69.73.20.69.73.20.61.20.70.72.6F.
74.65.63.74.65.64.20.61.6E.64.20.70.72.69.76.61.74.65.20.77.69.72.65.6C.
65.73.73.20.73.79.73.74.65.6D.2E.20.4E.6F.20.75.6E.2D.61.75.74.68.6F.72.
69.7A.65.64.20.61.63.63.65.73.73.20.61.6C.6C.6F.77.65.64.2E.59.6F.75.20.
6D.75.73.74.20.68.61.76.65.20.70.72.6F.70.65.72.20.72.69.67.68.74.73.20.
74.6F.20.61.63.63.65.73.73.20.61.6E.64.20.6D.61.6E.61.67.65.20.74.68.69.
73.20.73.79.73.74.65.6D.20.66.72.6F.6D.20.74.68.65.20.61.75.74.68.6F.72.
2B.15.D9.50.20.70.65.72.73.6F.6E.6E.65.6C.2E (hex)

 

 

What could be the reason that snmpget give the "HEX" value but snmpwalk
give the "string"  for the same object with same implementation ?

String is expected J

 

Code for  the get part of wsAceessBanner:

 

char accbanr[MAXCHARS+1] = {'\0'};

 

case IMI_ACCESS_BANNER:

*write_method = imi_write_scalars;

 

      fp = pal_fopen(CCBANRFILE, "r");

      if(fp){

          pal_fgets(accbanr, MAXCHARS+1, fp);

          pal_fclose(fp);

      }

      else {

        strcpy(accbanr, "This Device is running in Common Criteria Mode.
Attention: This is a protected and private wireless system. No
un-authorized access allowed.You must have proper rights to access and
manage this system from the authorized personnel.");

      }

      IMI_SNMP_RETURN_STRING(accbanr, strlen(accbanr)+1);

 

}

 

/********Above macro defined as ******/

 

#define IMI_SNMP_RETURN_STRING(V, L) \

  do { \

     *var_len = L; \

     imi_string_val = (u_char *)V; \

    return (imi_string_val); \

  } while (0)

 

 

Please look at the else part of the code

 

Thanks,

Sanjay

------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.