Skip to content
Snippets Groups Projects
Commit 97ff6b23 authored by Mark Harrison's avatar Mark Harrison
Browse files

Fix error when reading meminfo

On some systems, there are lines in /proc/meminfo that don't match the regex.
Currently these cause resmon to throw an error and give a blank metric. This
change skips those metrics rather than throwing an error.
parent b93cfdbb
No related branches found
No related tags found
No related merge requests found
......@@ -131,6 +131,7 @@ sub handler {
open(MEMINFO, '/proc/meminfo') || die "Unable to read proc: $!\n";
while (<MEMINFO>) {
/(\w+)\:\s+(\d+).*/;
next unless defined($1);
$metrics{$1} = [$2, 'L'];
}
close(MEMINFO);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment