RE: file monitoring
Leigh Peterson <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hi David, Please see rely below: > Date: Fri, 19 Oct 2007 09:04:27 +0100> From: [email protected]> To: [email protected]> Subject: Re: file monitoring> CC: [email protected]> > On 18/10/2007, Leigh Peterson <[email protected]> wrote:> > Even though the file size is beyond the specified "657000", when I do an> > "snmpget" on the value, it returns a "0":> >> > [leigh@syslog ~]$ snmpget -v 2c -c public localhost 1.3.6.1.4.1.2021.15.1.3.1> > UCD-SNMP-MIB::fileSize.1 = INTEGER: 0 kB> > That would certainly explain why your system isn't generating traps!> > What is the output of a full walk of the 1.3.6.1.4.1.2021.15 tree? [root@ leigh]# snmpwalk -v 2c -c rocom localhost 1.3.6.1.4.1.2021.15UCD-SNMP-MIB::fileIndex.1 = INTEGER: 1UCD-SNMP-MIB::fileName.1 = STRING: /var/lib/mysql/Syslog/SystemEvents.MYDUCD-SNMP-MIB::fileSize.1 = INTEGER: 0 kBUCD-SNMP-MIB::fileMax.1 = INTEGER: 657000 kBUCD-SNMP-MIB::fileErrorFlag.1 = INTEGER: 0UCD-SNMP-MIB::fileErrorMsg.1 = STRING: > What O/S are you working with? I'm using CentOS 4.5 > What version of the Net-SNMP agent are you using? net-snmp-5.1.2-11 > What is the exact size of the file "/var/lib/mysql/Syslog/SystemEvents.MYD" ? [root@syslog leigh]# ll /var/lib/mysql/Syslog/SystemEvents.MYD -rw-rw---- 1 mysql mysql 2063092 Oct 19 09:46 /var/lib/mysql/Syslog/SystemEvents.MYD > > > Unfortunately the fileTable code doesn't include much in the way of> debug code, so it's a bit difficult to track exact what it is actually doing> (as opposed to what it should be doing).> > But try compiling and running the following code fragment;> > int main( int argc, char *argv[] )> {> struct stat sb;> int ret;> > ret = stat( "/var/lib/mysql/Syslog/SystemEvents.MYD", &sb );> printf("stat returned %d, size = %d\n", ret, sb.st_size >> 10);> }> > What does that display? [root@syslog leigh]# ./snmp_test stat returned 0, size = 2014 > > Dave Thanks for the reply. Cheers, Leigh _________________________________________________________________ Feel like a local wherever you go. http://www.backofmyhand.com ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ 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