https://bugs.contribs.org/show_bug.cgi?id=10493

--- Comment #1 from Jean-Philippe Pialasse <[email protected]> ---
(In reply to John Crisp from comment #0)
> Just noticed this in my logs on various boxes.
> 
> sadf used : Use of uninitialized value in addition (+) at /usr/sbin/sysmon
> line 99.
> Use of uninitialized value in addition (+) at /usr/sbin/sysmon line 99.
> Use of uninitialized value in concatenation (.) or string at
> /usr/sbin/sysmon line 139.
> Use of uninitialized value in concatenation (.) or string at
> /usr/sbin/sysmon line 139.
> 
> Here is Line 99:
> 
> 99  $datahash->{swptotal} = $datahash->{swpused} + $datahash->{swpfree};
> 
> So presumably one of the values of swpused or swpfree have not been
> correctly obtained.
> 
> Line 139 runs an update that requires one of the above vars.
> 
> Here's where the array gets populated
> 
> 65  my @sardata;
> 66  if ( -x '/usr/bin/sadf' ) {  @sardata=`/usr/bin/sadf -- -qrbu -n DEV
> /var/lib/rrd/sysmon.process  2> /dev/null`;print "sadf used : ";}
> 67  else { @sardata = `/usr/bin/sar -hqru -P ALL -n DEV -f
> /var/lib/rrd/sysmon.process 2> /dev/null`; print "old systat : ";}
> 68  unlink("/var/lib/rrd/sysmon.process");
> 
> Essentially, from what I can see, if sadf is executable, it runs and passes
> the options to sar to generate the file eg it passes these "-qrbu -n DEV"
> 
> If sadf is not executable it tries to run sar directly using these options
> "-hqru -P ALL -n DEV"
> 
> It seems that the -S option for swap numbers (see man sar) is missing ?
> 
> I added S to the code like this:
> 
> if ( -x '/usr/bin/sadf' ) {  @sardata=`/usr/bin/sadf -- -qrbuS -n DEV
> /var/lib/rrd/sysmon.process  2> /dev/null`;print "sadf used : ";}
> 
> The uninitialised errors have disappeared and I just get this in the logs:
> 
> sadf used : 
> 
> After waiting a little while I have now got swap level appearing in the
> graphs (give it half an hour at least)
> 
> I'll work a patch for this - the 'print' lines in the log can probably be
> dispensed with as well.


I confirm the issue, my log:
# tail -f /var/log/sysmon
Use of uninitialized value in concatenation (.) or string at /usr/sbin/sysmon
line 139.
Use of uninitialized value in concatenation (.) or string at /usr/sbin/sysmon
line 139.
sadf used : Use of uninitialized value in addition (+) at /usr/sbin/sysmon line
99.
Use of uninitialized value in addition (+) at /usr/sbin/sysmon line 99.



sysmon reports swap at 0 on graphs
but

#  free -m
             total       used       free     shared    buffers     cached
Mem:          3016       2800        215          0        134        661
-/+ buffers/cache:       2004       1011
Swap:         4031        263       3768


modified the line to add S

# service sysmon restart
Stopping sysmon daemon:                                    [  OK  ]
Starting sysmon daemon:                                    [  OK  ]
# Damonizing sysmon...
#
 (seems there is a bug with this not wanted printed line "Damonizing sysmon..."

# tail -f /var/log/sysmon
sadf used : 



and also a happy graph reporting the swap correctly !


considering the line printed:
        if ( -x '/usr/bin/sadf' ) {  @sardata=`/usr/bin/sadf -- -qrbuS -n DEV
/var/lib/rrd/sysmon.process  2> /dev/null`;print "sadf used : ";}
        else { @sardata = `/usr/bin/sar -hqru -P ALL -n DEV -f
/var/lib/rrd/sysmon.process 2> /dev/null`; print "old systat : ";}

both could be removed or a \n added ; by the way , should you also add the S to
the second line ?


anyway the second line gives seems to not work anymore on SME9 and might have
been there for sme7 / sme8 or older legacy release:

# /usr/bin/sar -hqru -P ALL -n DEV -f /var/lib/rrd/sysmon.process
Utilisation : /usr/bin/sar [ options... ] [ <intervalle> [ <itérations> ] ]
Options are:
[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -m ] [ -p ] [ -q ] [ -r ] [ -R ]
[ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]
[ -I { <int> [,...] | SUM | ALL | XALL } ] [ -P { <cpu> [,...] | ALL } ]
[ -j { ID | LABEL | PATH | UUID | ... } ] [ -n { <keyword> [,...] | ALL } ]
[ -o [ <filename> ] | -f [ <filename> ] ] [ --legacy ]
[ -i <interval> ] [ -s [ <hh:mm:ss> ] ] [ -e [ <hh:mm:ss> ] ]


****go on !*****

> One other oddity - is this # correct or is it a typo?
> 
> if($#sardata > 0 && $sardata[0] =~
>     ^
> I haven't seen that before?

this means number of elements in array /hash

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
_______________________________________________
Mail for each SME Contribs bug report
To unsubscribe, e-mail [email protected]
Searchable archive at https://lists.contribs.org/mailman/public/contribteam/

Reply via email to