mirror of
https://github.com/librenms/librenms-agent.git
synced 2024-05-09 09:54:52 +00:00
Error checking with two line stats (#365)
* Error checking with two line stats * Fixed some spacing problems
This commit is contained in:
@@ -74,9 +74,12 @@ my @sysctls_pull = `/sbin/sysctl -q @to_pull`;
|
||||
foreach my $stat (@sysctls_pull) {
|
||||
chomp( $stat );
|
||||
my ( $var, $val ) = split(/:/, $stat, 2);
|
||||
|
||||
$val =~ s/^ //;
|
||||
$sysctls->{$var}=$val;
|
||||
# If $val is empty, skip it. Likely a var with a newline before
|
||||
# the data so it is trying to "split" the data.
|
||||
if( length $val ) {
|
||||
$val =~ s/^ //;
|
||||
$sysctls->{$var}=$val;
|
||||
}
|
||||
}
|
||||
|
||||
# does not seem to exist for me, but some of these don't seem to be created till needed
|
||||
|
||||
Reference in New Issue
Block a user