linode / longview

Linode Longview Agent
Other
334 stars 45 forks source link

OpenVZ w/ UBC (User Bean Counters) - meminfo Buffers: not defined #10

Open Cyth opened 10 years ago

Cyth commented 10 years ago

Identified by; Existence of /proc/user_beancounters file. Reproducible; Always Workaround; Possibly upgrading to OpenVZ w/ VSwap, CentOS 6 on hardware node, or silencing error in file;

/opt/linode/longview/Linode/Longview/DataGetter/Memory.pm

Line 50;

( $dataref->{LONGTERM}->{'Memory.real.buffers'} ) = ( $meminfo =~ /Buffers:\s+(\d+)/ )[0] + 0;

Effect; (Every 30-31 seconds, or 5 minutes, a error is written in file:)

/var/log/linode/longview.log;
03/31 11:05:28 WARN Longview[22508] - Use of uninitialized value in addition (+) at /opt/linode/longview/Linode/Longview/DataGetter/Memory.pm line 50.

Steps to Authenticate; (Free shows 0 Buffers, but meminfo doesn't show Buffers.)

free -m
             total       used       free     shared    buffers     cached
Mem:           192        148         43          0          0         66
-/+ buffers/cache:         81        110
Swap:          192         45        146

cat /proc/meminfo
MemTotal:         196608 kB
MemFree:           44860 kB
Cached:            68152 kB
Active:            68708 kB
Inactive:          31604 kB
Active(anon):      16040 kB
Inactive(anon):    16120 kB
Active(file):      52668 kB
Inactive(file):    15484 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:        196608 kB
SwapFree:         150000 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         32160 kB
Shmem:              6140 kB
Slab:              51420 kB
SReclaimable:      45048 kB
SUnreclaim:         6372 kB
Cyth commented 10 years ago

I fixed the error myself;

    {
    no warnings 'uninitialized';
    ( $dataref->{LONGTERM}->{'Memory.real.buffers'} ) = ( $meminfo =~ /Buffers:\s+(\d+)/ )[0] + 0;
    }

Suppresses the uninitialized error. It no longer beeps uninitialized error in the log file. I suppose this is not the most desirable solution.