Guest User!

You are not Sophos Staff.

[7.108] wrong calculation of available days (negative) to store logfiles [CONFIRMED]

It isn't important but I never noticed this on my test box :
in "logging", number of day is negative...
 
Log partition status 

Log partition size: 122610 MB
Free space:         116109 MB
Current fillup rate:    2 MB/day
Free space is exhausted in  -4069 days at current fillup rate.

Bye.
ulong
  • i forwarded this to one of our developers to investigate it.

    thanks
    Gert
  • Hi,
    please post the ouput of these commands:

    perl -e 'use Storable qw(lock_retrieve); $data = lock_retrieve("/etc/initial_usage_correction"); use Data:[:D]umper; print Dumper($data)'; 
    cat /etc/sysmond.ph 


    Thank you,
     andreas
  • Hi,
    that is quite an old error, it was highlighted back in v6.*** days.

    Ian M
  • Even old bugs can get fixed eventually [:P]
  • Here the following requested output :

    Noticed that since this days, the new version log a lot more information : by now it's ok it display since it logs more that 52Mo by days in packet filter...

    Ulong

    -----------------------------------------------------------
    test:/home/login # perl -e 'use Storable qw(lock_retrieve); $data = lock_retrieve("/etc/initial_usage_correction"); use Data:[[:D]]umper; print Dumper($data)';
    $VAR1 = {
              '/' => 1160228,
              '__timestamp' => 1205157946,
              '/var/storage' => 5421456,
              '/var/log' => 6612516
            };
    test:/home/login # cat /etc/sysmond.ph
    $VAR1 = {
              'Internal::CpuLoad' => [
                                       '0.55',
                                       '0.41',
                                       '0.36'
                                     ],
              'Internal::CpuUsage' => {
                                        'cpu_0' => '1.73001949317739',
                                        'cpu_1' => '1.78777393310266',
                                        'cpu_total' => '1.75670320961564'
                                      },
              'Internal:[[:D]]iskUsage' => {
                                         '/' => {
                                                  'blocks_avail' => 4016500,
                                                  'blocks_total' => 5542276,
                                                  'blocks_usage' => 24,
                                                  'est_blocksfullin' => '17063444',
                                                  'est_blockspersec' => '0.24',
                                                  'inodes_avail' => 663952,
                                                  'inodes_total' => 704512,
                                                  'inodes_usage' => 6
                                                },
                                         '/var/log' => {
                                                         'blocks_avail' => 118830724,
                                                         'blocks_total' => 125552992,
                                                         'blocks_usage' => 0,
                                                         'est_blocksfullin' => '1681433306',
                                                         'est_blockspersec' => '0.07',
                                                         'inodes_avail' => 32406615,
                                                         'inodes_total' => 32407552,
                                                         'inodes_usage' => 0
                                                       },
                                         '/var/storage' => {
                                                             'blocks_avail' => 90401692,
                                                             'blocks_total' => 95845360,
                                                             'blocks_usage' => 1,
                                                             'est_blocksfullin' => '-1',
                                                             'est_blockspersec' => '0.01',
                                                             'inodes_avail' => 24732953,
                                                             'inodes_total' => 24739840,
                                                             'inodes_usage' => 0
                                                           }
                                       },
              'Internal::ItfUsage' => {
                                        'eth0' => [
                                                    '5954.68996025474',
                                                    '2043.20603418881'
                                                  ],
                                        'eth1' => [
                                                    '1728.4153756538',
                                                    '5918.82435790577'
                                                  ],
                                        'eth2' => [
                                                    '158.395299593221',
                                                    '0'
                                                  ]
                                      },
              'Internal::MemSwapUsage' => {
                                            'mem_pct' => '95.51',
                                            'mem_total' => 1034976,
                                            'mem_used' => 988468,
                                            'swap_pct' => '98.54',
                                            'swap_total' => 1052248,
                                            'swap_used' => 1036896
                                          },
              'lastupdate' => 1206710933
            };
  • Hi,
    to test the report you need a disk greater than 80gb, it doesn't show up on my 36gb disk.

    Ian M
  • Hi,

    the number of days is by now negative ( see .jpg).
    i also re-do the 2 command line, maybe it can help you !!!

    Ulong

    test:/home/login # perl -e 'use Storable qw(lock_retrieve); $data = lock_retrieve("/etc/initial_usage_correction"); use Data:[[:D]]umper; print Dumper($data)';
    
    $VAR1 = {
              '/' => 1160228,
              '__timestamp' => 1205157946,
              '/var/storage' => 5421456,
              '/var/log' => 6612516
            };
    test:/home/login # cat /etc/sysmond.ph
    $VAR1 = {
              'Internal::CpuLoad' => [
                                       '0.25',
                                       '0.18',
                                       '0.11'
                                     ],
              'Internal::CpuUsage' => {
                                        'cpu_0' => '4.64718947548266',
                                        'cpu_1' => '0.583090379008752',
                                        'cpu_total' => '2.63585793752674'
                                      },
              'Internal:[[:D]]iskUsage' => {
                                         '/' => {
                                                  'blocks_avail' => 4016288,
                                                  'blocks_total' => 5542276,
                                                  'blocks_usage' => 24,
                                                  'est_blocksfullin' => '17901953',
                                                  'est_blockspersec' => '0.22',
                                                  'inodes_avail' => 663871,
                                                  'inodes_total' => 704512,
                                                  'inodes_usage' => 6
                                                },
                                         '/var/log' => {
                                                         'blocks_avail' => 118882556,
                                                         'blocks_total' => 125552992,
                                                         'blocks_usage' => 0,
                                                         'est_blocksfullin' => '-948694279',
                                                         'est_blockspersec' => '0.04',
                                                         'inodes_avail' => 32406576,
                                                         'inodes_total' => 32407552,
                                                         'inodes_usage' => 0
                                                       },
                                         '/var/storage' => {
                                                             'blocks_avail' => 90401684,
                                                             'blocks_total' => 95845360,
                                                             'blocks_usage' => 1,
                                                             'est_blocksfullin' => '-1',
                                                             'est_blockspersec' => '0.01',
                                                             'inodes_avail' => 24732955,
                                                             'inodes_total' => 24739840,
                                                             'inodes_usage' => 0
                                                           }
                                       },
              'Internal::ItfUsage' => {
                                        'eth0' => [
                                                    '17822.8537254547',
                                                    '733033.94984711'
                                                  ],
                                        'eth1' => [
                                                    '732862.906976815',
                                                    '17572.4885575558'
                                                  ],
                                        'eth2' => [
                                                    '118.783474226794',
                                                    '0'
                                                  ]
                                      },
              'Internal::MemSwapUsage' => {
                                            'mem_pct' => '31.97',
                                            'mem_total' => 1034976,
                                            'mem_used' => 330908,
                                            'swap_pct' => '14.89',
                                            'swap_total' => 1052248,
                                            'swap_used' => 156648
                                          },
              'lastupdate' => 1206788271
            };
    test:/home/login #
  • Hi,
    thanks for posting the updated information - obviously it is much more useful to have the data at the moment when the error occurs [:D]
    With the data you provided I traced through every step of the calculation and was now able to find spot the problem. The maths is correct all the time, the root of all evil is when the "seconds until disk full" is being print to the file. The sprintf which is used there is treating the integer as signed, which leads to an overflow if the time needed to fill the disk is larger than 2^31 seconds, which you can achieve on machines having large disks and few log data throughput.

    Thanks for the help! This was a really nagging thing, glad to be rid of it [:)]

    Cheers,
     maj