fixed a message of 'Argument isn't numeric in int ...' in 'nvidia' graph when using newer official drivers

This commit is contained in:
Jordi Sanfeliu 2013-07-08 12:04:12 +02:00
parent 9e553dc64b
commit 1d284f9fcc
2 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,8 @@
- Fixed a bug that prevented a correctly data collection in the 'fail2ban'
graph. [#23]
- Fixed the description of 'netstats_in_bps' in monitorix.conf(5) man page.
- Fixed a message of 'Argument "" isn't numeric in int ...' in 'nvidia' graph
when using newer official drivers.
- Little code cleaning.

View File

@ -208,10 +208,12 @@ sub get_nvidia_data {
my ($value, undef) = split(' ', $tmp);
$value =~ s/[-]/./;
$value =~ s/[^0-9.]//g;
$value ||= 0; # zero if not numeric
if(int($value) > 0) {
$cpu = int($value);
}
}
# not used
if($data[$l] =~ /Memory/) {
my (undef, $tmp) = split(':', $data[$l]);
if($tmp eq "\n") {
@ -221,6 +223,7 @@ sub get_nvidia_data {
my ($value, undef) = split(' ', $tmp);
$value =~ s/[-]/./;
$value =~ s/[^0-9.]//g;
$value ||= 0; # zero if not numeric
if(int($value) > 0) {
$mem = int($value);
}