Here they are. The last file is the freshly generated snmpwalk output log file with a shortened syslog sample.
I'm trying the one with stCnt removed... On Tue, Apr 12, 2011 at 10:15 AM, Dave Shield <[email protected]>wrote: > On 12 April 2011 14:57, Zimmer Hu <[email protected]> wrote: > > Dave, attached is my code. > > And the header files? > > > > The rationale behind the code is to set index value at every beginning of > > column loop. When loop goes back to the beginning of next column, the > index > > is reset to 1 and count again. > > The iterator framework should already take care of wrapping > round to the next column. > Please try *without* this statement. > > > Dave >
/*
* Note: this file originally auto-generated by mib2c using
* : mib2c.iterate.conf 17821 2009-11-11 09:00:00Z dts12 $
*/
#ifndef SYSLOGMSGTABLE_H
#define SYSLOGMSGTABLE_H
#include "syslogMsgTable_access.h"
/* function declarations */
void init_syslogMsgTable(void);
void initialize_table_syslogMsgTable(void);
Netsnmp_Node_Handler syslogMsgTable_handler;
/* column number definitions for table syslogMsgTable */
#define COLUMN_SYSLOGMSGINDEX 1
#define COLUMN_SYSLOGMSGFACILITY 2
#define COLUMN_SYSLOGMSGSEVERITY 3
#define COLUMN_SYSLOGMSGVERSION 4
#define COLUMN_SYSLOGMSGTIMESTAMP 5
#define COLUMN_SYSLOGMSGHOSTNAME 6
#define COLUMN_SYSLOGMSGAPPNAME 7
#define COLUMN_SYSLOGMSGPROCID 8
#define COLUMN_SYSLOGMSGMSGID 9
#define COLUMN_SYSLOGMSGSDPARAMS 10
#define COLUMN_SYSLOGMSGMSG 11
#define NNN 128
#endif /* SYSLOGMSGTABLE_H */
/*
* Note: this file originally auto-generated by mib2c using
* : mib2c.access_functions.conf 11358 2004-10-14 12:57:34Z dts12 $
*/
#ifndef SYSLOGMSGTABLE_ACCESS_H
#define SYSLOGMSGTABLE_ACCESS_H
#include <stdint.h>
#include <stdlib.h>
#define SyslogFacility uint8_t
#define SyslogSeverity uint8_t
#define DisplayString char
#define SyslogTimeStamp char
#define MAX_BUFFER_SIZE 200000
#define MAX_SYSLOG_INDEX_SIZE 0xFFFFFFFF //4294967295
FILE *filep;
char cBuffer[MAX_BUFFER_SIZE];
char strRet[16]; // temporary buffer
/* psmlogd */
/* loopctx */
typedef struct Netsnmp_First_Data_Point_s {
uint32_t syslogMsgIndex;
SyslogFacility syslogMsgFacility;
SyslogSeverity syslogMsgSeverity;
uint32_t syslogMsgVersion;
SyslogTimeStamp syslogMsgTimeStamp[64];
DisplayString syslogMsgHostName[64];
DisplayString syslogMsgAppName[64];
DisplayString syslogMsgProcID[32];
DisplayString syslogMsgMsgID[32];
uint32_t syslogMsgSDParams;
char syslogMsgMsg[1024];
uint32_t iLineNo;
struct Netsnmp_First_Data_Point_s *next;
} syslogMsgTable_loop_context;
/* datactx */
typedef struct Netsnmp_Next_Data_Point_s {
uint32_t syslogMsgIndex;
SyslogFacility syslogMsgFacility;
SyslogSeverity syslogMsgSeverity;
uint32_t syslogMsgVersion;
SyslogTimeStamp syslogMsgTimeStamp[64];
DisplayString syslogMsgHostName[64];
DisplayString syslogMsgAppName[64];
DisplayString syslogMsgProcID[32];
DisplayString syslogMsgMsgID[32];
uint32_t syslogMsgSDParams;
char syslogMsgMsg[1024];
uint32_t iLineNo;
} syslogMsgTable_data_context;
/** psm **/
/** User-defined data access functions for data in table syslogMsgTable */
/** row level accessors */
netsnmp_variable_list * syslogMsgTable_get_first_data_point(void **my_loop_context, void **my_data_context,
netsnmp_variable_list *put_index_data,
netsnmp_iterator_info *mydata);
netsnmp_variable_list * syslogMsgTable_get_next_data_point(void **my_loop_context, void **my_data_context,
netsnmp_variable_list *put_index_data,
netsnmp_iterator_info *mydata);
int syslogMsgTable_commit_row(void **my_data_context, int new_or_del);
void * syslogMsgTable_create_data_context(netsnmp_variable_list *index_data, int column);
void * syslogMsgTable_make_data_context(void* psm_loop_context, netsnmp_iterator_info *mydata);
void syslogMsgTable_data_free(void *data, netsnmp_iterator_info *iinfo);
void syslogMsgTable_loop_free(void *loopctx, netsnmp_iterator_info *iinfo);
char * HexStringOfMonth(syslogMsgTable_loop_context *pctx, char * strMonth);
char * HexStringOfDay(syslogMsgTable_loop_context *pctx, char * strDay);
char * HexStringOfTime(syslogMsgTable_loop_context *pctx, char * strTime);
void printTS(char * strTimeStamp);
/** column accessors */
long *get_syslogMsgFacility(void *data_context, size_t *ret_len);
long *get_syslogMsgSeverity(void *data_context, size_t *ret_len);
u_long *get_syslogMsgVersion(void *data_context, size_t *ret_len);
char *get_syslogMsgTimeStamp(void *data_context, size_t *ret_len);
char *get_syslogMsgHostName(void *data_context, size_t *ret_len);
char *get_syslogMsgAppName(void *data_context, size_t *ret_len);
char *get_syslogMsgProcID(void *data_context, size_t *ret_len);
char *get_syslogMsgMsgID(void *data_context, size_t *ret_len);
u_long *get_syslogMsgSDParams(void *data_context, size_t *ret_len);
char *get_syslogMsgMsg(void *data_context, size_t *ret_len);
#endif /* SYSLOGMSGTABLE_ACCESS_H */
mylogtable.log.gz
Description: GNU Zip compressed data
------------------------------------------------------------------------------ Forrester Wave Report - Recovery time is now measured in hours and minutes not days. Key insights are discussed in the 2010 Forrester Wave Report as part of an in-depth evaluation of disaster recovery service providers. Forrester found the best-in-class provider in terms of services and vision. Read this report now! http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
